deltakit.circuit.SweepBit#

class deltakit.circuit.SweepBit(bit_index: int)#

Bases: object

Abstraction of a sweep bit as used by stim. A sweep bit represents a classical bit and is used as the control of a two-qubit gate.

The index represents the index in a numpy array to read the classical bit from so the classical result doesn’t need to be known at compile time, but only at sampling time. This makes using sweep bits different to using the results of measurements via rec[-k] because the sweep information is known separately from the circuit. The sweep bit array data must be stored in a separate file and passed in to stim when sampling.

Methods#

SweepBit.stim_targets

Get this sweep bit as a stim gate target.