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 where circuit is a circuit-like object for the noise, and p 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, where circuit is a circuit-like object for the noise, and p is the probability of the noise event. Circuit-like types include QuantumCircuit, (Instruction, qargs) and a list of (Instruction, qargs). Note that qargs 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

QuantumError.atol

QuantumError.circuits

Return the list of error circuits.

QuantumError.dim

Return tuple (input_shape, output_shape).

QuantumError.id

Return unique ID string for error

QuantumError.num_qubits

Return the number of qubits if a N-qubit operator or None otherwise.

QuantumError.probabilities

Return the list of error probabilities.

QuantumError.qargs

Return the qargs for the operator.

QuantumError.rtol

QuantumError.size

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.

QuantumError.copy()

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.

QuantumError.ideal()

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.

QuantumError.power(n)

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.

QuantumError.to_dict()

Return the current error as a dictionary.

QuantumError.to_instruction()

Convert the QuantumError to a circuit Instruction.

QuantumError.to_quantumchannel()

Convert the QuantumError to a SuperOp quantum channel.

QuantumError.__call__(*qargs)

Return a shallow copy with qargs attribute set