QuantumError¶
- class QuantumError(noise_ops, number_of_qubits=None, standard_gates=True, atol=1e-08)[source]¶
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 wherecircuit
is a qobj circuit for the noise, andp
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.
Attributes
The default absolute tolerance parameter for float comparisons.
Return the list of error circuits.
Return the number of qubits for the error.
Return the list of error probabilities.
The relative tolerance parameter for float comparisons.
Return the number of error circuit.
Methods
QuantumError.__mul__
(other)QuantumError.compose
(other[, front])Return the composition error channel other * self.
Make a copy of current QuantumError.
QuantumError.dot
(other)Return the composition error channel self * other.
QuantumError.error_term
(position)Return a single term from the error.
QuantumError.expand
(other)Return the tensor product quantum error channel self ⊗ other.
Return True if current error object is an identity
Return the compose of a error channel with itself n times.
QuantumError.set_atol
(value)Set the class default absolute tolerance parameter for float comparisons.
QuantumError.set_rtol
(value)Set the class default relative tolerance parameter for float comparisons.
QuantumError.tensor
(other)Return the tensor product quantum error channel self ⊗ other.
Return the current error as a dictionary.
Convert the QuantumError to a circuit Instruction.
Convert the QuantumError to a SuperOp quantum channel.