qoolqit.devices
source package qoolqit.devices
Classes
-
MockDevice — A virtual device for unconstrained prototyping.
-
AnalogDevice — A realistic device for analog sequence execution.
-
DigitalAnalogDevice — A device with digital and analog capabilities.
-
Device — QoolQit Device wrapper around a Pulser BaseDevice.
Functions
-
available_default_devices — Show the default available devices in QooQit.
source class MockDevice()
Bases : Device
A virtual device for unconstrained prototyping.
Attributes
-
specs : dict[str, float | None] — Return the device specification constraints.
-
energy_ratio : float | None — Return the ratio between the max amplitude and max interaction energy on this device.
source class AnalogDevice()
Bases : Device
A realistic device for analog sequence execution.
Attributes
-
specs : dict[str, float | None] — Return the device specification constraints.
-
energy_ratio : float | None — Return the ratio between the max amplitude and max interaction energy on this device.
source class DigitalAnalogDevice()
Bases : Device
A device with digital and analog capabilities.
Attributes
-
specs : dict[str, float | None] — Return the device specification constraints.
-
energy_ratio : float | None — Return the ratio between the max amplitude and max interaction energy on this device.
source class Device(pulser_device: BaseDevice, default_converter: Optional[UnitConverter] = None)
QoolQit Device wrapper around a Pulser BaseDevice.
Parameters
-
pulser_device : BaseDevice — a
BaseDeviceto build the QoolQit device from. -
default_converter : Optional[UnitConverter] — optional unit converter to handle unit conversion. Defaults to the unit converter that rescales energies by the maximum allowed amplitude by the device.
Examples
From Pulser device:
From remote Pulser device:
from pulser_pasqal import PasqalCloud
from qoolqit import Device
# Fetch the remote device from the connection
connection = PasqalCloud()
pulser_fresnel_device = connection.fetch_available_devices()["FRESNEL"]
# Wrap a Pulser device object into a QoolQit Device
fresnel_device = Device(pulser_device=PulserFresnelDevice)
From custom Pulser device:
from dataclasses import replace
from pulser import AnalogDevice
from qoolqit import Device
# Converting the pulser Device object in a VirtualDevice object
VirtualAnalog = AnalogDevice.to_virtual()
# Replacing desired values
ModdedAnalogDevice = replace(
VirtualAnalog,
max_radial_distance=100,
max_sequence_duration=7000
)
# Wrap a Pulser device object into a QoolQit Device
mod_analog_device = Device(pulser_device=ModdedAnalogDevice)
Attributes
-
specs : dict[str, float | None] — Return the device specification constraints.
-
energy_ratio : float | None — Return the ratio between the max amplitude and max interaction energy on this device.
Methods
-
reset_converter — Resets the unit converter to the default one.
-
set_time_unit — Changes the unit converter according to a reference time unit.
-
set_energy_unit — Changes the unit converter according to a reference energy unit.
-
set_distance_unit — Changes the unit converter according to a reference distance unit.
-
info — Show the device short description and constraints.
-
from_connection — Return the specified device from the selected device from a connection.
source property Device.converter: UnitConverter
source method Device.reset_converter() → None
Resets the unit converter to the default one.
source method Device.set_time_unit(time: float) → None
Changes the unit converter according to a reference time unit.
source method Device.set_energy_unit(energy: float) → None
Changes the unit converter according to a reference energy unit.
source method Device.set_distance_unit(distance: float) → None
Changes the unit converter according to a reference distance unit.
source property Device.specs: dict[str, float | None]
Return the device specification constraints.
source property Device.energy_ratio: float | None
Return the ratio between the max amplitude and max interaction energy on this device.
source property Device.name: str
source method Device.info() → None
Show the device short description and constraints.
source classmethod Device.from_connection(connection: RemoteConnection, name: str) → Device
Return the specified device from the selected device from a connection.
Available devices through the provided connection are can be seen with
the connection.fetch_available_devices() method.
Parameters
-
connection : RemoteConnection — connection object to fetch the available devices.
-
name : str — The name of the desired device.
Example
Raises
-
ValueError
source available_default_devices() → None
Show the default available devices in QooQit.