pytket.unit_id¶
- class pytket._tket.unit_id.Bit¶
A handle to a bit
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: pytket._tket.unit_id.Bit, index: int) -> None
Constructs an id for some index in the default classical register
- Parameters:
index – The index in the register
__init__(self: pytket._tket.unit_id.Bit, name: str) -> None
Constructs a named id (i.e. corresponding to a singleton register)
- Parameters:
name – The readable name for the id
__init__(self: pytket._tket.unit_id.Bit, name: str, index: int) -> None
Constructs an indexed id (i.e. corresponding to an element in a linear register)
- Parameters:
name – The readable name for the register
index – The numerical index
__init__(self: pytket._tket.unit_id.Bit, name: str, row: int, col: int) -> None
Constructs a doubly-indexed id (i.e. corresponding to an element in a grid register)
- Parameters:
name – The readable name for the register
row – The row index
col – The column index
__init__(self: pytket._tket.unit_id.Bit, name: str, index: Sequence[int]) -> None
Constructs an id with an arbitrary-dimensional index
- Parameters:
name – The readable name for the register
index – The index vector
- static from_list(arg0: list) pytket._tket.unit_id.Bit ¶
Construct Bit instance from JSON serializable list representation of the Bit.
- to_list(self: pytket._tket.unit_id.Bit) list ¶
Return a JSON serializable list representation of the Bit.
- Returns:
list containing register name and index
- class pytket._tket.unit_id.BitRegister¶
Linear register of UnitID types.
- __init__(self: pytket._tket.unit_id.BitRegister, name: str, size: int) None ¶
Construct a new BitRegister.
- Parameters:
name – Name of the register.
size – Size of register.
- to_list(self: pytket._tket.unit_id.BitRegister) list[pytket._tket.unit_id.Bit] ¶
- property name¶
Name of register.
- property size¶
Size of register.
- class pytket._tket.unit_id.Node¶
A handle to a device node
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: pytket._tket.unit_id.Node, index: int) -> None
Constructs an id for some index in the default physical register
- Parameters:
index – The index in the register
__init__(self: pytket._tket.unit_id.Node, name: str, index: int) -> None
Constructs an indexed id (i.e. corresponding to an element in a linear register)
- Parameters:
name – The readable name for the register
index – The numerical index
__init__(self: pytket._tket.unit_id.Node, name: str, row: int, col: int) -> None
Constructs a doubly-indexed id (i.e. corresponding to an element in a grid register)
- Parameters:
name – The readable name for the register
row – The row index
col – The column index
__init__(self: pytket._tket.unit_id.Node, name: str, row: int, col: int, layer: int) -> None
Constructs a triply-indexed id (i.e. corresponding to an element in a 3D grid register)
- Parameters:
name – The readable name for the register
row – The row index
col – The column index
layer – The layer index
__init__(self: pytket._tket.unit_id.Node, name: str, index: Sequence[int]) -> None
Constructs an id with an arbitrary-dimensional index
- Parameters:
name – The readable name for the register
index – The index vector
- static from_list(arg0: list) pytket._tket.unit_id.Node ¶
Construct Node instance from JSON serializable list representation of the Node.
- to_list(self: pytket._tket.unit_id.Node) list ¶
- Returns:
a JSON serializable list representation of the Node
- class pytket._tket.unit_id.Qubit¶
A handle to a qubit
- __init__(*args, **kwargs)¶
Overloaded function.
__init__(self: pytket._tket.unit_id.Qubit, index: int) -> None
Constructs an id for some index in the default qubit register
- Parameters:
index – The index in the register
__init__(self: pytket._tket.unit_id.Qubit, name: str) -> None
Constructs a named id (i.e. corresponding to a singleton register)
- Parameters:
name – The readable name for the id
__init__(self: pytket._tket.unit_id.Qubit, name: str, index: int) -> None
Constructs an indexed id (i.e. corresponding to an element in a linear register)
- Parameters:
name – The readable name for the register
index – The numerical index
__init__(self: pytket._tket.unit_id.Qubit, name: str, row: int, col: int) -> None
Constructs a doubly-indexed id (i.e. corresponding to an element in a grid register)
- Parameters:
name – The readable name for the register
row – The row index
col – The column index
__init__(self: pytket._tket.unit_id.Qubit, name: str, index: Sequence[int]) -> None
Constructs an id with an arbitrary-dimensional index
- Parameters:
name – The readable name for the register
index – The index vector
- static from_list(arg0: list) pytket._tket.unit_id.Qubit ¶
Construct Qubit instance from JSON serializable list representation of the Qubit.
- to_list(self: pytket._tket.unit_id.Qubit) list ¶
- Returns:
a JSON serializable list representation of the Qubit
- class pytket._tket.unit_id.QubitRegister¶
Linear register of UnitID types.
- __init__(self: pytket._tket.unit_id.QubitRegister, name: str, size: int) None ¶
Construct a new QubitRegister.
- Parameters:
name – Name of the register.
size – Size of register.
- to_list(self: pytket._tket.unit_id.QubitRegister) list[pytket._tket.unit_id.Qubit] ¶
- property name¶
Name of register.
- property size¶
Size of register.
- class pytket._tket.unit_id.UnitID¶
A handle to a computational unit (e.g. qubit, bit)
- __init__(self: pytket._tket.unit_id.UnitID) None ¶
- property index¶
Index vector describing position in the register. The length of this vector is the dimension of the register
- property reg_name¶
Readable name of register
- property type¶
Type of unit, either
UnitType.qubit
orUnitType.bit
orUnitType.wasmstate
- class pytket._tket.unit_id.UnitType¶
Enum for data types of units in circuits (e.g. Qubits vs Bits).
Members:
qubit : A single Qubit
wasmstate : A single WasmState
bit : A single classical Bit
- __init__(self: pytket._tket.unit_id.UnitType, value: int) None ¶
- property name¶
- class pytket._tket.unit_id.WasmState¶
A handle to a wasmstate
- __init__(self: pytket._tket.unit_id.WasmState, index: int) None ¶
Constructs an id for some index in the default wasm register
- Parameters:
index – The index in the register
- static from_list(arg0: list) pytket._tket.unit_id.WasmState ¶
Construct WasmState instance from JSON serializable list representation of the WasmState.
- to_list(self: pytket._tket.unit_id.WasmState) list ¶
Return a JSON serializable list representation of the WasmState.
- Returns:
list containing register name and index