# qiskit.ignis.verification.RepetitionCode¶

class RepetitionCode(d, T=0)[código fonte]

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.

Parâmetros
• d (int) – Number of code qubits (and hence repetitions) used.

• T (int) – Number of rounds of ancilla-assisted syndrome measurement.

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__(d, T=0)[código fonte]

Creates the circuits corresponding to a logical 0 and 1 encoded using a repetition code.

Parâmetros
• d (int) – Number of code qubits (and hence repetitions) used.

• T (int) – Number of rounds of ancilla-assisted syndrome measurement.

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

Methods

 __init__(d[, T]) Creates the circuits corresponding to a logical 0 and 1 encoded using a repetition code. returns self.circuit as a list, with process_results(raw_results) param raw_results A dictionary whose keys are logical values, 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([reset, barrier]) Application of a syndrome measurement round. x([logs, barrier]) Applies a logical x to the circuits for the given logical values.
get_circuit_list()[código fonte]
Retorna

self.circuit as a list, with circuit_list[0] = circuit[‘0’] circuit_list[1] = circuit[‘1’]

Tipo de retorno

circuit_list

process_results(raw_results)[código fonte]
Parâmetros

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

Retorna

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.

Tipo de retorno

results

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.

readout()[código fonte]

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(reset=True, barrier=False)[código fonte]

Application of a syndrome measurement round.

Parâmetros
• 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.

x(logs=('0', '1'), barrier=False)[código fonte]

Applies a logical x to the circuits for the given logical values.

Parâmetros
• 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.