Skip to content

Fresnel-1 register

from_layout(register_transform)

Transforms a data from coordinates into a register with calibrated layout.

PARAMETER DESCRIPTION
register_transform

The instance of RegisterTransform containing the coordinates and device settings

TYPE: RegisterTransform

RETURNS DESCRIPTION
RegisterLayout

A register data with calibrated layout

Source code in qadence2_platforms/backends/fresnel1/register.py
def from_layout(register_transform: RegisterTransform) -> RegisterLayout:
    """
    Transforms a data from coordinates into a register with calibrated layout.

    Args:
        register_transform (RegisterTransform): The instance of RegisterTransform containing
            the coordinates and device settings

    Returns:
        A register data with calibrated layout
    """

    layout = register_transform.get_calibrated_layout("TriangularLatticeLayout(61, 5.0µm)")
    traps = layout.get_traps_from_coordinates(*register_transform.coords)
    register = layout.define_register(*traps, qubit_ids=range(len(traps)))

    return register  # type: ignore