tqec.circuit.generation.generate_circuit_from_instantiation#
- generate_circuit_from_instantiation(plaquette_array: ndarray[Any, dtype[int64]], plaquettes: Plaquettes, increments: Displacement) ScheduledCircuit [source]#
Generate a quantum circuit from an array of plaquette indices and the associated plaquettes.
This is one of the core methods of the tqec package. It generates a quantum circuit from a spatial description of where the plaquettes should be located as well as the actual plaquettes used.
This function requires that a few pre-conditions on the inputs are met:
the number of plaquettes provided should match the number of plaquettes required by the provided template.
all the provided plaquettes should be implemented on
GridQubit
instances only.
If any of the above pre-conditions is not met, the inputs are considered invalid, in which case this function might raise an error.
- Parameters:
plaquette_array – an array of indices referencing Plaquette instances in the plaquettes argument.
plaquettes – description of the computation that should happen at different time-slices of the quantum error correction experiment (or at least part of it).
increments – the displacement between each plaquette origin.
- Returns:
a ScheduledCircuit instance implementing the (part of) quantum error correction experiment represented by the provided inputs.
- Raises:
TQECException – if any index in plaquette_array is not correctly associated to a plaquette in plaquettes.