QuantumError¶
- class QuantumError(noise_ops)[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 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]])])
- Parameters:
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.- Raises:
NoiseError – If input noise_ops is invalid, e.g. it’s not a CPTP map.
Attributes
Return the list of error circuits.
Return tuple (input_shape, output_shape).
Return unique ID string for error
Return the number of qubits if a N-qubit operator or None otherwise.
Return the list of error probabilities.
Return the qargs for the operator.
Return the number of error circuit.
Methods
QuantumError.__call__
(*qargs)Return a shallow copy with qargs attribute set
QuantumError.compose
(other[, qargs, front])Return the operator composition with another CLASS.
Make a copy of current QuantumError.
QuantumError.dot
(other[, qargs])Return the right multiplied operator self * other.
QuantumError.error_term
(position)Return a single term from the error.
QuantumError.expand
(other)Return the reverse-order tensor product with another CLASS.
Return True if this error object is composed only of identity operations.
QuantumError.input_dims
([qargs])Return tuple of input dimension for specified subsystems.
QuantumError.output_dims
([qargs])Return tuple of output dimension for specified subsystems.
Return the compose of a operator with itself n times.
QuantumError.reshape
([input_dims, ...])Return a shallow copy with reshaped input and output subsystem dimensions.
QuantumError.tensor
(other)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.
QuantumError.__call__
(*qargs)Return a shallow copy with qargs attribute set