qoolqit.register
source module qoolqit.register
Classes
-
Register — The Register in QoolQit, representing a set of qubits with coordinates.
source class Register(qubits: dict)
The Register in QoolQit, representing a set of qubits with coordinates.
Default constructor for the Register.
Parameters
-
qubits : dict — a dictionary of qubits and respective coordinates {q: (x, y), ...}.
Attributes
-
qubits : dict — Returns the dictionary of qubits and respective coordinates.
-
qubits_ids : list — Returns the qubit keys.
-
n_qubits : int — Number of qubits in the Register.
Methods
-
from_graph — Initializes a Register from a graph that has coordinates.
-
from_coordinates — Initializes a Register from a list of coordinates.
-
distances — Distance between each qubit pair.
-
min_distance — Minimum distance between all qubit pairs.
-
interactions — Interaction 1/r^6 between each qubit pair.
-
draw — Draw the register.
source classmethod Register.from_graph(graph: DataGraph) → Register
Initializes a Register from a graph that has coordinates.
Parameters
-
graph : DataGraph — a DataGraph instance.
Raises
-
ValueError
source classmethod Register.from_coordinates(coords: list) → Register
Initializes a Register from a list of coordinates.
Parameters
-
coords : list — a list of coordinates [(x, y), ...]
Raises
-
TypeError
source property Register.qubits: dict
Returns the dictionary of qubits and respective coordinates.
source property Register.qubits_ids: list
Returns the qubit keys.
source property Register.n_qubits: int
Number of qubits in the Register.
source method Register.distances() → dict
Distance between each qubit pair.
source method Register.min_distance() → float
Minimum distance between all qubit pairs.
source method Register.interactions() → dict
Interaction 1/r^6 between each qubit pair.
source method Register.draw(return_fig: bool = False) → plt.Figure | None
Draw the register.
Parameters
-
return_fig : bool — boolean argument to return the plt.Figure instance.