# QuantumError¶

class QuantumError(noise_ops, number_of_qubits=None, standard_gates=True, atol=1e-08)[source]

Bases: object

Quantum error class for Qiskit Aer noise model

WARNING: The init interface for this class is not finalized and may

change in future releases. For maximum backwards compatibility use the QuantumError generating functions in the noise.errors module.

Create a quantum error for a noise model.

Noise ops may either be specified as list of Kraus operators for a general CPTP map, or as a list of (circuit, p) pairs where circuit is a qobj circuit for the noise, and p is the probability of the error circuit. If the input is Kraus operators they will be converted to the circuit format, with checks applied for determining if any Kraus operators are unitary matrices.

Example

An example noise_ops for a bit-flip error with error probability p = 0.1 is:

noise_ops = [([{"name": "id", "qubits": 0}], 0.9),
([{"name": "x", "qubits": 0}], 0.1)]


The same error represented as a Kraus channel can be input as:

noise_ops = [np.sqrt(0.9) * np.array([[1, 0], [0, 1]]),
np.sqrt(0.1) * np.array([[0, 1], [1, 0]])]

Parameters
• noise_ops (list) -- A list of noise ops. See additional information.

• number_of_qubits (int) -- specify the number of qubits for the error. If None this will be determined automatically (default None).

• standard_gates (bool) -- Check if input matrices are standard gates.

• atol (double) -- Threshold for testing if probabilities are equal to 0 or 1 (Default: 1e-8).

Raises

NoiseError -- If input noise_ops are not a CPTP map.

Methods

 compose Return the composition error channel other * self. copy Make a copy of current QuantumError. dot Return the composition error channel self * other. error_term Return a single term from the error. expand Return the tensor product quantum error channel self ⊗ other. ideal Return True if current error object is an identity power Return the compose of a error channel with itself n times. set_atol Set the class default absolute tolerance parameter for float comparisons. set_rtol Set the class default relative tolerance parameter for float comparisons. tensor Return the tensor product quantum error channel self ⊗ other. to_dict Return the current error as a dictionary. to_instruction Convert the QuantumError to a circuit Instruction. to_quantumchannel Convert the QuantumError to a SuperOp quantum channel.

Attributes

atol

The default absolute tolerance parameter for float comparisons.

circuits

Return the list of error circuits.

number_of_qubits

Return the number of qubits for the error.

probabilities

Return the list of error probabilities.

rtol

The relative tolerance parameter for float comparisons.

size

Return the number of error circuit.