Quantum registers
In Qadence, quantum programs can be executed by specifying the layout of a register of resources as a lattice.
Built-in Register
types can be used or constructed for arbitrary topologies.
Common register topologies are available and illustrated in the plot below.
Building and drawing registers
Built-in topologies are directly accessible in the Register
:
Arbitrarily shaped registers can be constructed by providing coordinates.
Registers defined from coordinates
Register
constructed via the from_coordinates
method do not define edges in the connectivity graph.
import numpy as np
from qadence import Register
reg = Register.from_coordinates(
[(x, np.sin(x)) for x in np.linspace(0, 2*np.pi, 10)]
)
reg.draw(show=False)
Units for qubit coordinates
In general, Qadence makes no assumption about the units given to qubit coordinates. However, if used in the context of a Hamiltonian coefficient, the quantity \(H.t\) must be dimensionless for exponentiation in the PyQTorch backend, where it is assumed that \(\hbar = 1\) (consistent ). For registers passed to the Pulser backend, coordinates are in \(\mu \textrm{m}\).
Connectivity graphs
Register topology is often assumed in digital simulations to be an all-to-all qubit connectivity. When running on real devices that enable the digital-analog computing paradigm, qubit interactions must be specified either by specifying distances between qubits, or by defining edges in the register connectivity graph.
It is possible to access the abstract graph nodes and edges to work with if needed as in the perfect state transfer example.
It is possible to customize qubit interaction through the add_interaction
method.
In that case, Register.coords
are accessible from the concrete graph:
More details about their usage in the digital-analog paradigm can be found in the digital-analog basics section.