qiskit.providers.aer.noise.ReadoutError
class ReadoutError(probabilities, atol=1e-08)
Readout error class for Qiskit Aer noise model.
Create a readout error for a noise model.
For an N-qubit readout error probabilities are entered as vectors:
probabilities[m] = [P(0|m), P(1|m), ..., P(2 ** N - 1|m)]
where P(j|m)
is the probability of recording a measurement outcome of m
as the value j
. Where j
and m
are integer representations of bit-strings.
Example: 1-qubit
probabilities[0] = [P("0"|"0"), P("1"|"0")]
probabilities[1] = [P("0"|"1"), P("1"|"1")]
Example: 2-qubit
probabilities[0] = [P("00"|"00"), P("01"|"00"), P("10"|"00"), P("11"|"00")]
probabilities[1] = [P("00"|"01"), P("01"|"01"), P("10"|"01"), P("11"|"01")]
probabilities[2] = [P("00"|"10"), P("01"|"10"), P("10"|"10"), P("11"|"10")]
probabilities[3] = [P("00"|"11"), P("01"|"11"), P("10"|"11"), P("11"|"11")]
Parameters
- probabilities (matrix) – List of outcome assignment probabilities.
- atol (double) – Threshold for checking probabilities are normalized (Default: 1e-8).
__init__
__init__(probabilities, atol=1e-08)
Create a readout error for a noise model.
For an N-qubit readout error probabilities are entered as vectors:
probabilities[m] = [P(0|m), P(1|m), ..., P(2 ** N - 1|m)]
where P(j|m)
is the probability of recording a measurement outcome of m
as the value j
. Where j
and m
are integer representations of bit-strings.
Example: 1-qubit
probabilities[0] = [P("0"|"0"), P("1"|"0")]
probabilities[1] = [P("0"|"1"), P("1"|"1")]
Example: 2-qubit
probabilities[0] = [P("00"|"00"), P("01"|"00"), P("10"|"00"), P("11"|"00")]
probabilities[1] = [P("00"|"01"), P("01"|"01"), P("10"|"01"), P("11"|"01")]
probabilities[2] = [P("00"|"10"), P("01"|"10"), P("10"|"10"), P("11"|"10")]
probabilities[3] = [P("00"|"11"), P("01"|"11"), P("10"|"11"), P("11"|"11")]
Parameters
- probabilities (matrix) – List of outcome assignment probabilities.
- atol (double) – Threshold for checking probabilities are normalized (Default: 1e-8).
Methods
__init__ (probabilities[, atol]) | Create a readout error for a noise model. |
compose (other[, front]) | Return the composition readout error other * self. |
copy () | Make a copy of current ReadoutError. |
dot (other) | Return the composition readout error self * other. |
expand (other) | Return the tensor product readout error self ⊗ other. |
ideal () | Return True if current error object is an identity |
power (n) | Return the compose of the readout error with itself n times. |
set_atol (value) | Set the class default absolute tolerance parameter for float comparisons. |
set_rtol (value) | Set the class default relative tolerance parameter for float comparisons. |
tensor (other) | Return the tensor product readout error self ⊗ other. |
to_dict () | Return the current error as a dictionary. |
to_instruction () | Convert the ReadoutError to a circuit Instruction. |
Attributes
atol | The default absolute tolerance parameter for float comparisons. |
number_of_qubits | Return the number of qubits for the error. |
probabilities | Return the readout error probabilities matrix. |
rtol | The relative tolerance parameter for float comparisons. |
atol
The default absolute tolerance parameter for float comparisons.
compose
compose(other, front=False)
Return the composition readout error other * self.
Note that for front=True this is equivalent to the ReadoutError.dot()
method.
Parameters
- other (ReadoutError) – a readout error.
- front (bool) – If True return the reverse order composation self * other instead [default: False].
Returns
The composition readout error.
Return type
Raises
- NoiseError – if other is not a ReadoutError or has incompatible
- dimensions. –
copy
copy()
Make a copy of current ReadoutError.
dot
dot(other)
Return the composition readout error self * other.
Parameters
other (ReadoutError) – a readout error.
Returns
The composition readout error.
Return type
Raises
- NoiseError – if other is not a ReadoutError or has incompatible
- dimensions. –
expand
expand(other)
Return the tensor product readout error self ⊗ other.
Parameters
other (ReadoutError) – a readout error.
Returns
the tensor product readout error other ⊗ self.
Return type
Raises
NoiseError – if other is not a ReadoutError.
ideal
ideal()
Return True if current error object is an identity
number_of_qubits
Return the number of qubits for the error.
power
power(n)
Return the compose of the readout error with itself n times.
Parameters
n (int) – the number of times to compose with self (n>0).
Returns
the n-times composition channel.
Return type
Raises
NoiseError – if the power is not a positive integer.
probabilities
Return the readout error probabilities matrix.
rtol
The relative tolerance parameter for float comparisons.
set_atol
classmethod set_atol(value)
Set the class default absolute tolerance parameter for float comparisons.
set_rtol
classmethod set_rtol(value)
Set the class default relative tolerance parameter for float comparisons.
tensor
tensor(other)
Return the tensor product readout error self ⊗ other.
Parameters
other (ReadoutError) – a readout error.
Returns
the tensor product readout error self ⊗ other.
Return type
Raises
NoiseError – if other is not a ReadoutError.
to_dict
to_dict()
Return the current error as a dictionary.
to_instruction
to_instruction()
Convert the ReadoutError to a circuit Instruction.