tqec.circuit.generation.generate_circuit#

generate_circuit(template: Template, k: int, plaquettes: Plaquettes) ScheduledCircuit[source]#

Generate a quantum circuit from a template and its plaquettes.

This is one of the core methods of the tqec package. It generates a quantum circuit from the description of the template that should be implemented as well as the plaquettes that should be used to instantiate the provided template.

This function requires that a few pre-conditions on the inputs are met:

  1. the number of plaquettes provided should match the number of plaquettes required by the provided template.

  2. 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:
  • template – spatial description of the quantum error correction experiment we want to implement.

  • k – scaling parameter used to instantiate the provided template.

  • plaquettes – description of the computation that should happen at different time-slices of the quantum error correction experiment (or at least part of it).

Returns:

a ScheduledCircuit instance implementing the (part of) quantum error correction experiment represented by the provided inputs.