284 lines
12 KiB
Plaintext
284 lines
12 KiB
Plaintext
---
|
||
title: ReadoutError
|
||
description: API reference for qiskit.providers.aer.noise.ReadoutError
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: class
|
||
python_api_name: qiskit.providers.aer.noise.ReadoutError
|
||
---
|
||
|
||
<span id="qiskit-providers-aer-noise-readouterror" />
|
||
|
||
# qiskit.providers.aer.noise.ReadoutError
|
||
|
||
<Class id="qiskit.providers.aer.noise.ReadoutError" isDedicatedPage={true} github="https://github.com/qiskit/qiskit-aer/tree/stable/0.7/qiskit/providers/aer/noise/errors/readout_error.py" signature="ReadoutError(probabilities, atol=1e-08)" modifiers="class">
|
||
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:
|
||
|
||
```python
|
||
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**
|
||
|
||
```python
|
||
probabilities[0] = [P("0"|"0"), P("1"|"0")]
|
||
probabilities[1] = [P("0"|"1"), P("1"|"1")]
|
||
```
|
||
|
||
**Example: 2-qubit**
|
||
|
||
```python
|
||
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\_\_
|
||
|
||
<Function id="qiskit.providers.aer.noise.ReadoutError.__init__" signature="__init__(probabilities, atol=1e-08)">
|
||
Create a readout error for a noise model.
|
||
|
||
For an N-qubit readout error probabilities are entered as vectors:
|
||
|
||
```python
|
||
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**
|
||
|
||
```python
|
||
probabilities[0] = [P("0"|"0"), P("1"|"0")]
|
||
probabilities[1] = [P("0"|"1"), P("1"|"1")]
|
||
```
|
||
|
||
**Example: 2-qubit**
|
||
|
||
```python
|
||
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).
|
||
</Function>
|
||
|
||
## Methods
|
||
|
||
| | |
|
||
| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------- |
|
||
| [`__init__`](#qiskit.providers.aer.noise.ReadoutError.__init__ "qiskit.providers.aer.noise.ReadoutError.__init__")(probabilities\[, atol]) | Create a readout error for a noise model. |
|
||
| [`compose`](#qiskit.providers.aer.noise.ReadoutError.compose "qiskit.providers.aer.noise.ReadoutError.compose")(other\[, front]) | Return the composition readout error other \* self. |
|
||
| [`copy`](#qiskit.providers.aer.noise.ReadoutError.copy "qiskit.providers.aer.noise.ReadoutError.copy")() | Make a copy of current ReadoutError. |
|
||
| [`dot`](#qiskit.providers.aer.noise.ReadoutError.dot "qiskit.providers.aer.noise.ReadoutError.dot")(other) | Return the composition readout error self \* other. |
|
||
| [`expand`](#qiskit.providers.aer.noise.ReadoutError.expand "qiskit.providers.aer.noise.ReadoutError.expand")(other) | Return the tensor product readout error self ⊗ other. |
|
||
| [`ideal`](#qiskit.providers.aer.noise.ReadoutError.ideal "qiskit.providers.aer.noise.ReadoutError.ideal")() | Return True if current error object is an identity |
|
||
| [`power`](#qiskit.providers.aer.noise.ReadoutError.power "qiskit.providers.aer.noise.ReadoutError.power")(n) | Return the compose of the readout error with itself n times. |
|
||
| [`set_atol`](#qiskit.providers.aer.noise.ReadoutError.set_atol "qiskit.providers.aer.noise.ReadoutError.set_atol")(value) | Set the class default absolute tolerance parameter for float comparisons. |
|
||
| [`set_rtol`](#qiskit.providers.aer.noise.ReadoutError.set_rtol "qiskit.providers.aer.noise.ReadoutError.set_rtol")(value) | Set the class default relative tolerance parameter for float comparisons. |
|
||
| [`tensor`](#qiskit.providers.aer.noise.ReadoutError.tensor "qiskit.providers.aer.noise.ReadoutError.tensor")(other) | Return the tensor product readout error self ⊗ other. |
|
||
| [`to_dict`](#qiskit.providers.aer.noise.ReadoutError.to_dict "qiskit.providers.aer.noise.ReadoutError.to_dict")() | Return the current error as a dictionary. |
|
||
| [`to_instruction`](#qiskit.providers.aer.noise.ReadoutError.to_instruction "qiskit.providers.aer.noise.ReadoutError.to_instruction")() | Convert the ReadoutError to a circuit Instruction. |
|
||
|
||
## Attributes
|
||
|
||
| | |
|
||
| ------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------- |
|
||
| [`atol`](#qiskit.providers.aer.noise.ReadoutError.atol "qiskit.providers.aer.noise.ReadoutError.atol") | The default absolute tolerance parameter for float comparisons. |
|
||
| [`number_of_qubits`](#qiskit.providers.aer.noise.ReadoutError.number_of_qubits "qiskit.providers.aer.noise.ReadoutError.number_of_qubits") | Return the number of qubits for the error. |
|
||
| [`probabilities`](#qiskit.providers.aer.noise.ReadoutError.probabilities "qiskit.providers.aer.noise.ReadoutError.probabilities") | Return the readout error probabilities matrix. |
|
||
| [`rtol`](#qiskit.providers.aer.noise.ReadoutError.rtol "qiskit.providers.aer.noise.ReadoutError.rtol") | The relative tolerance parameter for float comparisons. |
|
||
|
||
### atol
|
||
|
||
<Attribute id="qiskit.providers.aer.noise.ReadoutError.atol">
|
||
The default absolute tolerance parameter for float comparisons.
|
||
</Attribute>
|
||
|
||
### compose
|
||
|
||
<Function id="qiskit.providers.aer.noise.ReadoutError.compose" signature="compose(other, front=False)">
|
||
Return the composition readout error other \* self.
|
||
|
||
Note that for front=True this is equivalent to the [`ReadoutError.dot()`](#qiskit.providers.aer.noise.ReadoutError.dot "qiskit.providers.aer.noise.ReadoutError.dot") method.
|
||
|
||
**Parameters**
|
||
|
||
* **other** ([*ReadoutError*](#qiskit.providers.aer.noise.ReadoutError "qiskit.providers.aer.noise.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**
|
||
|
||
[ReadoutError](#qiskit.providers.aer.noise.ReadoutError "qiskit.providers.aer.noise.ReadoutError")
|
||
|
||
**Raises**
|
||
|
||
* **NoiseError** – if other is not a ReadoutError or has incompatible
|
||
* **dimensions.** –
|
||
</Function>
|
||
|
||
### copy
|
||
|
||
<Function id="qiskit.providers.aer.noise.ReadoutError.copy" signature="copy()">
|
||
Make a copy of current ReadoutError.
|
||
</Function>
|
||
|
||
### dot
|
||
|
||
<Function id="qiskit.providers.aer.noise.ReadoutError.dot" signature="dot(other)">
|
||
Return the composition readout error self \* other.
|
||
|
||
**Parameters**
|
||
|
||
**other** ([*ReadoutError*](#qiskit.providers.aer.noise.ReadoutError "qiskit.providers.aer.noise.ReadoutError")) – a readout error.
|
||
|
||
**Returns**
|
||
|
||
The composition readout error.
|
||
|
||
**Return type**
|
||
|
||
[ReadoutError](#qiskit.providers.aer.noise.ReadoutError "qiskit.providers.aer.noise.ReadoutError")
|
||
|
||
**Raises**
|
||
|
||
* **NoiseError** – if other is not a ReadoutError or has incompatible
|
||
* **dimensions.** –
|
||
</Function>
|
||
|
||
### expand
|
||
|
||
<Function id="qiskit.providers.aer.noise.ReadoutError.expand" signature="expand(other)">
|
||
Return the tensor product readout error self ⊗ other.
|
||
|
||
**Parameters**
|
||
|
||
**other** ([*ReadoutError*](#qiskit.providers.aer.noise.ReadoutError "qiskit.providers.aer.noise.ReadoutError")) – a readout error.
|
||
|
||
**Returns**
|
||
|
||
the tensor product readout error other ⊗ self.
|
||
|
||
**Return type**
|
||
|
||
[ReadoutError](#qiskit.providers.aer.noise.ReadoutError "qiskit.providers.aer.noise.ReadoutError")
|
||
|
||
**Raises**
|
||
|
||
**NoiseError** – if other is not a ReadoutError.
|
||
</Function>
|
||
|
||
### ideal
|
||
|
||
<Function id="qiskit.providers.aer.noise.ReadoutError.ideal" signature="ideal()">
|
||
Return True if current error object is an identity
|
||
</Function>
|
||
|
||
### number\_of\_qubits
|
||
|
||
<Attribute id="qiskit.providers.aer.noise.ReadoutError.number_of_qubits">
|
||
Return the number of qubits for the error.
|
||
</Attribute>
|
||
|
||
### power
|
||
|
||
<Function id="qiskit.providers.aer.noise.ReadoutError.power" signature="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**
|
||
|
||
[ReadoutError](#qiskit.providers.aer.noise.ReadoutError "qiskit.providers.aer.noise.ReadoutError")
|
||
|
||
**Raises**
|
||
|
||
**NoiseError** – if the power is not a positive integer.
|
||
</Function>
|
||
|
||
### probabilities
|
||
|
||
<Attribute id="qiskit.providers.aer.noise.ReadoutError.probabilities">
|
||
Return the readout error probabilities matrix.
|
||
</Attribute>
|
||
|
||
### rtol
|
||
|
||
<Attribute id="qiskit.providers.aer.noise.ReadoutError.rtol">
|
||
The relative tolerance parameter for float comparisons.
|
||
</Attribute>
|
||
|
||
### set\_atol
|
||
|
||
<Function id="qiskit.providers.aer.noise.ReadoutError.set_atol" signature="set_atol(value)" modifiers="classmethod">
|
||
Set the class default absolute tolerance parameter for float comparisons.
|
||
</Function>
|
||
|
||
### set\_rtol
|
||
|
||
<Function id="qiskit.providers.aer.noise.ReadoutError.set_rtol" signature="set_rtol(value)" modifiers="classmethod">
|
||
Set the class default relative tolerance parameter for float comparisons.
|
||
</Function>
|
||
|
||
### tensor
|
||
|
||
<Function id="qiskit.providers.aer.noise.ReadoutError.tensor" signature="tensor(other)">
|
||
Return the tensor product readout error self ⊗ other.
|
||
|
||
**Parameters**
|
||
|
||
**other** ([*ReadoutError*](#qiskit.providers.aer.noise.ReadoutError "qiskit.providers.aer.noise.ReadoutError")) – a readout error.
|
||
|
||
**Returns**
|
||
|
||
the tensor product readout error self ⊗ other.
|
||
|
||
**Return type**
|
||
|
||
[ReadoutError](#qiskit.providers.aer.noise.ReadoutError "qiskit.providers.aer.noise.ReadoutError")
|
||
|
||
**Raises**
|
||
|
||
**NoiseError** – if other is not a ReadoutError.
|
||
</Function>
|
||
|
||
### to\_dict
|
||
|
||
<Function id="qiskit.providers.aer.noise.ReadoutError.to_dict" signature="to_dict()">
|
||
Return the current error as a dictionary.
|
||
</Function>
|
||
|
||
### to\_instruction
|
||
|
||
<Function id="qiskit.providers.aer.noise.ReadoutError.to_instruction" signature="to_instruction()">
|
||
Convert the ReadoutError to a circuit Instruction.
|
||
</Function>
|
||
</Class>
|
||
|