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