QuantumError¶
- class QuantumError(noise_ops, number_of_qubits=None, standard_gates=None, atol=None)[Quellcode]¶
Bases:
qiskit.quantum_info.operators.base_operator.BaseOperator
,qiskit.quantum_info.operators.mixins.tolerances.TolerancesMixin
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 a
QuantumChannel
for a general CPTP map, or as a list of(circuit, p)
pairs wherecircuit
is a circuit-like object for the noise, andp
is the probability of the noise event. Any type of input will be converted to the probabilistic mixture of circuit format.Example
An example noise_ops for a bit-flip error with error probability
p = 0.1
is:noise_ops = [(IGate(), 0.9), (XGate(), 0.1)]
or specifying explicit qubit arguments,
noise_ops = [((IGate(), [0]), 0.9), ((XGate(), [0]), 0.1)]
The same error represented as a Kraus channel can be input as:
noise_ops = Kraus([np.sqrt(0.9) * np.array([[1, 0], [0, 1]]), np.sqrt(0.1) * np.array([[0, 1], [1, 0]])])
- Parameter
noise_ops (QuantumChannel or Iterable) – Either a quantum channel or a list of
(circuit, p)
pairs, which represents a quantum error, wherecircuit
is a circuit-like object for the noise, andp
is the probability of the noise event. Circuit-like types includeQuantumCircuit
,(Instruction, qargs)
and a list of(Instruction, qargs)
. Note thatqargs
should be a list of integers and can be omitted (default qubits are used in that case). See also examples above.number_of_qubits (int) – [DEPRECATED] specify the number of qubits for the error. If None this will be determined automatically (default None).
standard_gates (bool) – [DEPRECATED] Check if input matrices are standard gates.
atol (double) – [DEPRECATED] Threshold for testing if probabilities are equal to 0 or 1 (Default:
QuantumError.atol
).
- Verursacht
NoiseError – If input noise_ops is invalid, e.g. it’s not a CPTP map.
Methods
Return the operator composition with another CLASS.
Make a copy of current QuantumError.
Return the right multiplied operator self * other.
Return a single term from the error.
Return the reverse-order tensor product with another CLASS.
Return True if this error object is composed only of identity operations.
Return tuple of input dimension for specified subsystems.
Return tuple of output dimension for specified subsystems.
Return the compose of a operator with itself n times.
Return a shallow copy with reshaped input and output subsystem dimensions.
Set the class default absolute tolerance parameter for float comparisons.
Set the class default relative tolerance parameter for float comparisons.
Return the tensor product with another CLASS.
Return the current error as a dictionary.
Convert the QuantumError to a circuit Instruction.
Convert the QuantumError to a SuperOp quantum channel.
Attributes
- atol = 1e-08¶
- circuits¶
Return the list of error circuits.
- dim¶
Return tuple (input_shape, output_shape).
- id¶
Return unique ID string for error
- num_qubits¶
Return the number of qubits if a N-qubit operator or None otherwise.
- number_of_qubits¶
Return the number of qubits for the error.
- probabilities¶
Return the list of error probabilities.
- qargs¶
Return the qargs for the operator.
- rtol = 1e-05¶
- size¶
Return the number of error circuit.