French
Languages
English
Bengali
French
German
Japanese
Korean
Portuguese
Spanish
Tamil

QuantumError

class QuantumError(noise_ops)[source]

Bases : BaseOperator, TolerancesMixin

Quantum error class for Qiskit Aer noise model

Avertissement

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]])])
Paramètres

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.

Lève

NoiseError – If input noise_ops is invalid, e.g. it’s not a CPTP map.

Methods

compose

Return the operator composition with another CLASS.

copy

Make a copy of current QuantumError.

dot

Return the right multiplied operator self * other.

error_term

Return a single term from the error.

expand

Return the reverse-order tensor product with another CLASS.

ideal

Return True if this error object is composed only of identity operations.

input_dims

Return tuple of input dimension for specified subsystems.

output_dims

Return tuple of output dimension for specified subsystems.

power

Return the compose of a operator with itself n times.

reshape

Return a shallow copy with reshaped input and output subsystem dimensions.

tensor

Return the tensor product with another CLASS.

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 = 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.

probabilities

Return the list of error probabilities.

qargs

Return the qargs for the operator.

rtol = 1e-05
size

Return the number of error circuit.