Skip to content

loqs.codepacks.codepack_5_1_3_quantinuum2022

A LoQS QEC codepack for the 5-qubit code.

This implementation is based on the 2022 implementation from Quantinuum in [ryananderson_implementing_2022], which is in turn based on piecewise fault-tolerance from [yoder_universal_2016] and flag fault-tolerance from [chao_quantum_2018].

As we are using flag fault-tolerance, we require two auxiliary qubits: a measurement qubit for stabilizer checks, and an additional flag qubit. Thus, we will have 7 qubits total: 5 data and 2 auxiliary.

Functions

create_ideal_model

create_ideal_model(qubits: Sequence[str], model_backend: type[BaseNoiseModel] = PyGSTiNoiseModel, gaterep: type[GateRep] = QSimSuperopGateRep, instrep: type[InstrumentRep] = ZBasisProjectionInstrumentRep)

Create an ideal (i.e. noiseless) model for the [[5,1,3]] code.

This model will contain all the instructions needed to run the physical circuits in the QECCode returned by create_qec_code().

Parameters:

Name Type Description Default
qubits Sequence[str]

List of qubit labels to use. It should be have 7 entries, and the first two qubits should be the auxiliary qubits.

required
model_backend type[BaseNoiseModel]

The model backend to use when generating operations. Currently, only PyGSTiNoiseModel is allowed. Default is PyGSTiNoiseModel.

PyGSTiNoiseModel
gaterep type[GateRep]

Gate representation class to use. Default is QSimSuperopGateRep.

QSimSuperopGateRep
instrep type[InstrumentRep]

Instrument representation class to use. Default is ZBasisProjectionInstrumentRep.

ZBasisProjectionInstrumentRep

Returns:

Type Description
BaseNoiseModel

A noiseless model for the QECCode returned by create_qec_code().


create_qec_code

create_qec_code(ft_state_prep_max_repeats: int = 100, include_idles: bool = False, gate_durations: dict[str, int | float] | None = None, idle_gates: dict[int | float, str] | None = None, circuit_backend: type[BasePhysicalCircuit] = PyGSTiPhysicalCircuit)

Create a QECCode implementing the [[5,1,3]] code.

Parameters:

Name Type Description Default
ft_state_prep_max_repeats int

The number of max repeats to include in the repeat-until-success fault-tolerant state prep instruction. Default is 100.

100
include_idles bool

Whether to include (True) or not (False, default) idle gates in physical circuits.

False
gate_durations dict[str, int | float] | None

Mapping from gate names to durations. Defaults to None, which uses dummy values 1, 2, 3 for 1Q gates, 2Q gates, and mid-circuit measurements, respectively. See durations from pad_single_qubit_idles_by_duration_inplace() for more details.

None
idle_gates dict[int | float, str] | None

Mapping from gate duration to idle gate names. Defaults to None, which maps the dummy values from gate_durations to "Gi1Q", "Gi2Q", and "GiMCM", respectively. See idle_names from pad_single_qubit_idles_by_duration_inplace() for more details.

None
circuit_backend type[BasePhysicalCircuit]

The circuit backend to use when generating physical circuits. Default is PyGSTiPhysicalCircuit.

PyGSTiPhysicalCircuit

Returns:

Type Description
QECCode

A QECCode implementing the [[5,1,3]] code.