Register
Quantum Registers
Register(support, spacing=1.0, device_specs=DEFAULT_DEVICE)
A register of qubits including 2D coordinates.
Instantiating the Register class directly is only recommended for building custom registers.
For most uses where a predefined lattice is desired it is recommended to use the various
class methods available, e.g. Register.triangular_lattice
.
PARAMETER | DESCRIPTION |
---|---|
support |
A NetworkX graph or number of qubits. Nodes can include a
TYPE:
|
spacing |
Value set as the distance between the two closest qubits. The spacing argument is also available for all the class method constructors.
TYPE:
|
Examples:
from qadence import Register
reg_all = Register.all_to_all(n_qubits = 4)
reg_line = Register.line(n_qubits = 4)
reg_circle = Register.circle(n_qubits = 4)
reg_squre = Register.square(qubits_side = 2)
reg_rect = Register.rectangular_lattice(qubits_row = 2, qubits_col = 2)
reg_triang = Register.triangular_lattice(n_cells_row = 2, n_cells_col = 2)
reg_honey = Register.honeycomb_lattice(n_cells_row = 2, n_cells_col = 2)
Source code in qadence/register.py
all_node_pairs: EdgeView
property
Return a list of all possible qubit pairs in the register.
coords: dict
property
Return the dictionary of qubit coordinates.
distances: dict
property
Return a dictionary of distances for all qubit pairs in the register.
edge_distances: dict
property
Return a dictionary of distances for the qubit pairs that are.
connected by an edge in the underlying NetworkX graph.
edges: EdgeView
property
Return the EdgeView of the underlying NetworkX graph.
min_distance: float
property
Return the minimum distance between two qubts in the register.
n_qubits: int
property
Total number of qubits in the register.
nodes: NodeView
property
Return the NodeView of the underlying NetworkX graph.
support: set
property
Return the set of qubits in the register.
all_to_all(n_qubits, spacing=1.0, device_specs=DEFAULT_DEVICE)
classmethod
Build a register with an all-to-all connectivity graph.
The graph is projected onto a 2D space and the qubit coordinates are set using a spring layout algorithm.
PARAMETER | DESCRIPTION |
---|---|
n_qubits |
Total number of qubits.
TYPE:
|
Source code in qadence/register.py
circle(n_qubits, spacing=1.0, device_specs=DEFAULT_DEVICE)
classmethod
Build a circle register.
PARAMETER | DESCRIPTION |
---|---|
n_qubits |
Total number of qubits.
TYPE:
|
Source code in qadence/register.py
draw(show=True)
Draw the underlying NetworkX graph representing the register.
Source code in qadence/register.py
from_coordinates(coords, lattice=LatticeTopology.ARBITRARY, spacing=None, device_specs=DEFAULT_DEVICE)
classmethod
Build a register from a list of qubit coordinates.
Each node is added to the underlying graph with the respective coordinates, but the edges are left empty.
PARAMETER | DESCRIPTION |
---|---|
coords |
List of qubit coordinate tuples.
TYPE:
|
Source code in qadence/register.py
honeycomb_lattice(n_cells_row, n_cells_col, spacing=1.0, device_specs=DEFAULT_DEVICE)
classmethod
Build a honeycomb lattice register.
Each cell is an hexagon made up of six qubits.
PARAMETER | DESCRIPTION |
---|---|
n_cells_row |
Number of cells in each row.
TYPE:
|
n_cells_col |
Number of cells in each column.
TYPE:
|
Source code in qadence/register.py
line(n_qubits, spacing=1.0, device_specs=DEFAULT_DEVICE)
classmethod
Build a line register.
PARAMETER | DESCRIPTION |
---|---|
n_qubits |
Total number of qubits.
TYPE:
|
Source code in qadence/register.py
rescale_coords(scaling)
Rescale the coordinates of all qubits in the register.
PARAMETER | DESCRIPTION |
---|---|
scaling |
Scaling value.
TYPE:
|
Source code in qadence/register.py
square(qubits_side, spacing=1.0, device_specs=DEFAULT_DEVICE)
classmethod
Build a square register.
PARAMETER | DESCRIPTION |
---|---|
qubits_side |
Number of qubits on one side of the square.
TYPE:
|
Source code in qadence/register.py
triangular_lattice(n_cells_row, n_cells_col, spacing=1.0, device_specs=DEFAULT_DEVICE)
classmethod
Build a triangular lattice register.
Each cell is a triangle made up of three qubits.
PARAMETER | DESCRIPTION |
---|---|
n_cells_row |
Number of cells in each row.
TYPE:
|
n_cells_col |
Number of cells in each column.
TYPE:
|