116 lines
6.5 KiB
Plaintext
116 lines
6.5 KiB
Plaintext
---
|
||
title: RepetitionCode
|
||
description: API reference for qiskit.ignis.verification.RepetitionCode
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: class
|
||
python_api_name: qiskit.ignis.verification.RepetitionCode
|
||
---
|
||
|
||
<span id="qiskit-ignis-verification-repetitioncode" />
|
||
|
||
# qiskit.ignis.verification.RepetitionCode
|
||
|
||
<Class id="qiskit.ignis.verification.RepetitionCode" isDedicatedPage={true} github="https://github.com/qiskit-community/qiskit-ignis/tree/stable/0.5/qiskit/ignis/verification/topological_codes/circuits.py" signature="RepetitionCode(d, T=0)" modifiers="class">
|
||
Implementation of a distance d repetition code, implemented over T syndrome measurement rounds.
|
||
|
||
Creates the circuits corresponding to a logical 0 and 1 encoded using a repetition code.
|
||
|
||
**Parameters**
|
||
|
||
* **d** (*int*) – Number of code qubits (and hence repetitions) used.
|
||
* **T** (*int*) – Number of rounds of ancilla-assisted syndrome measurement.
|
||
|
||
**Additional information:**
|
||
|
||
No measurements are added to the circuit if T=0. Otherwise T rounds are added, followed by measurement of the code qubits (corresponding to a logical measurement and final syndrome measurement round).
|
||
|
||
### \_\_init\_\_
|
||
|
||
<Function id="qiskit.ignis.verification.RepetitionCode.__init__" signature="__init__(d, T=0)">
|
||
Creates the circuits corresponding to a logical 0 and 1 encoded using a repetition code.
|
||
|
||
**Parameters**
|
||
|
||
* **d** (*int*) – Number of code qubits (and hence repetitions) used.
|
||
* **T** (*int*) – Number of rounds of ancilla-assisted syndrome measurement.
|
||
|
||
**Additional information:**
|
||
|
||
No measurements are added to the circuit if T=0. Otherwise T rounds are added, followed by measurement of the code qubits (corresponding to a logical measurement and final syndrome measurement round).
|
||
</Function>
|
||
|
||
## Methods
|
||
|
||
| | |
|
||
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
||
| [`__init__`](#qiskit.ignis.verification.RepetitionCode.__init__ "qiskit.ignis.verification.RepetitionCode.__init__")(d\[, T]) | Creates the circuits corresponding to a logical 0 and 1 encoded using a repetition code. |
|
||
| [`get_circuit_list`](#qiskit.ignis.verification.RepetitionCode.get_circuit_list "qiskit.ignis.verification.RepetitionCode.get_circuit_list")() | **returns**self.circuit as a list, with |
|
||
| [`process_results`](#qiskit.ignis.verification.RepetitionCode.process_results "qiskit.ignis.verification.RepetitionCode.process_results")(raw\_results) | **param raw\_results**A dictionary whose keys are logical values, |
|
||
| [`readout`](#qiskit.ignis.verification.RepetitionCode.readout "qiskit.ignis.verification.RepetitionCode.readout")() | Readout of all code qubits, which corresponds to a logical measurement as well as allowing for a measurement of the syndrome to be inferred. |
|
||
| [`syndrome_measurement`](#qiskit.ignis.verification.RepetitionCode.syndrome_measurement "qiskit.ignis.verification.RepetitionCode.syndrome_measurement")(\[reset, barrier]) | Application of a syndrome measurement round. |
|
||
| [`x`](#qiskit.ignis.verification.RepetitionCode.x "qiskit.ignis.verification.RepetitionCode.x")(\[logs, barrier]) | Applies a logical x to the circuits for the given logical values. |
|
||
|
||
### get\_circuit\_list
|
||
|
||
<Function id="qiskit.ignis.verification.RepetitionCode.get_circuit_list" signature="get_circuit_list()">
|
||
**Returns**
|
||
|
||
self.circuit as a list, with circuit\_list\[0] = circuit\[‘0’] circuit\_list\[1] = circuit\[‘1’]
|
||
|
||
**Return type**
|
||
|
||
circuit\_list
|
||
</Function>
|
||
|
||
### process\_results
|
||
|
||
<Function id="qiskit.ignis.verification.RepetitionCode.process_results" signature="process_results(raw_results)">
|
||
**Parameters**
|
||
|
||
**raw\_results** (*dict*) – A dictionary whose keys are logical values, and whose values are standard counts dictionaries, (as obtained from the get\_counts method of a `qiskit.Result` object).
|
||
|
||
**Returns**
|
||
|
||
**Dictionary with the same structure as the input, but with**
|
||
|
||
the bit strings used as keys in the counts dictionaries converted to the form required by the decoder.
|
||
|
||
**Return type**
|
||
|
||
results
|
||
|
||
**Additional information:**
|
||
|
||
The circuits must be executed outside of this class, so that their is full freedom to compile, choose a backend, use a noise model, etc. The results from these executions should then be used to create the input for this method.
|
||
</Function>
|
||
|
||
### readout
|
||
|
||
<Function id="qiskit.ignis.verification.RepetitionCode.readout" signature="readout()">
|
||
Readout of all code qubits, which corresponds to a logical measurement as well as allowing for a measurement of the syndrome to be inferred.
|
||
</Function>
|
||
|
||
### syndrome\_measurement
|
||
|
||
<Function id="qiskit.ignis.verification.RepetitionCode.syndrome_measurement" signature="syndrome_measurement(reset=True, barrier=False)">
|
||
Application of a syndrome measurement round.
|
||
|
||
**Parameters**
|
||
|
||
* **reset** (*bool*) – If set to true add a boolean at the end of each round
|
||
* **barrier** (*bool*) – Boolean denoting whether to include a barrier at the end.
|
||
</Function>
|
||
|
||
### x
|
||
|
||
<Function id="qiskit.ignis.verification.RepetitionCode.x" signature="x(logs=('0', '1'), barrier=False)">
|
||
Applies a logical x to the circuits for the given logical values.
|
||
|
||
**Parameters**
|
||
|
||
* **logs** (*list or tuple*) – List or tuple of logical values expressed as strings.
|
||
* **barrier** (*bool*) – Boolean denoting whether to include a barrier at the end.
|
||
</Function>
|
||
</Class>
|
||
|