deltakit.circuit.Qubit#
- class deltakit.circuit.Qubit(unique_identifier: T, stim_identifier: int | None = None)#
Bases:
Generic[T]Abstraction of an immutable qubit type. This is generic over the provided type but that type must be hashable. This permits you to represent each qubit in whichever way is required. For most purposes, qubits will be identified using indices.
Note if you want to use coordinates as the unique identifier you should use the Coordinate class in this module rather than a general tuple.
- Parameters:
unique_identifier (T) – The unique way of identifying this qubit.
stim_identifier (int | None) – Optional id for qubits in the context of a stim circuit, that being which int id they have in the stim circuit representation. Can be separate from the deltakit_circuit unique identifier.
Examples
>>> Qubit(0) Qubit(0) >>> Qubit("top left qubit") Qubit(top left qubit) >>> Qubit(Coordinate(0, 1, 2, 3)) Qubit(Coordinate(0, 1, 2, 3))
Methods#
A generator yielding pairs of qubit instances from a single sequence. |
|
Generate a stim circuit for a qubit. |
|
Get the stim target gate target for this qubit. |