device
¶
Classes:
-
OqtopusDevice–A device embedded in the oqtopus framework.
-
OqtopusDeviceBackend–A class representing a device backend for Oqtopus.
OqtopusDevice
¶
OqtopusDevice(
device: DevicesDeviceInfo, device_api: DeviceApi
)
A device embedded in the oqtopus framework.
Parameters:
-
(device¶DevicesDeviceInfo) –The device information.
-
(device_api¶DeviceApi) –The device API for communication with the backend.
Raises:
-
ValueError–If the device or device_api is None.
Methods:
-
refresh–Retrieve the device information from OQTOPUS Cloud.
-
to_json–Return a json string representation of the OqtopusDevice.
Attributes:
-
available_at(datetime) –The
available_atof this DevicesDeviceInfo. -
basis_gates(list[str]) –The basis gates of the device.
-
calibrated_at(datetime) –The
calibrated_atof this DevicesDeviceInfo. -
description(str) –The description of the device.
-
device_id(str) –The device id of the device.
-
device_info(dict) –The device information of the device.
-
device_type(str) –The device type of the device.
-
n_pending_jobs(int) –The number of pending jobs in the device.
-
n_qubits(int) –The number of qubits in the device.
-
status(str) –The status of the device.
-
supported_instructions(list[str]) –The supported instructions of the device.
available_at
property
¶
available_at: datetime
The available_at of this DevicesDeviceInfo.
Returns:
-
datetime(datetime) –The
available_atof this DevicesDeviceInfo.
basis_gates
property
¶
basis_gates: list[str]
The basis gates of the device.
Returns:
-
list[str]–list[str]: The basis gates of the device.
calibrated_at
property
¶
calibrated_at: datetime
The calibrated_at of this DevicesDeviceInfo.
Returns:
-
datetime(datetime) –The
calibrated_atof this DevicesDeviceInfo.
description
property
¶
description: str
The description of the device.
Returns:
-
str(str) –The description of the device.
device_id
property
¶
device_id: str
The device id of the device.
Returns:
-
str(str) –The device id of the device.
device_info
property
¶
device_info: dict
The device information of the device.
Returns:
-
dict(dict) –The device information of the device.
device_type
property
¶
device_type: str
The device type of the device.
Returns:
-
str(str) –The device type of the device.
n_pending_jobs
property
¶
n_pending_jobs: int
The number of pending jobs in the device.
Returns:
-
int(int) –The number of pending jobs in the device.
n_qubits
property
¶
n_qubits: int
The number of qubits in the device.
Returns:
-
int(int) –The number of qubits in the device.
status
property
¶
status: str
The status of the device.
Returns:
-
str(str) –The status of the device.
supported_instructions
property
¶
supported_instructions: list[str]
The supported instructions of the device.
Returns:
-
list[str]–list[str]: The supported instructions of the device.
refresh
¶
refresh() -> None
Retrieve the device information from OQTOPUS Cloud.
Raises:
-
BackendError–If device cannot be found or if an authentication error occurred or timeout occurs, etc.
to_json
¶
to_json() -> str
Return a json string representation of the OqtopusDevice.
Returns:
-
str(str) –A json string representation of the OqtopusDevice.
OqtopusDeviceBackend
¶
OqtopusDeviceBackend(config: OqtopusConfig | None = None)
A class representing a device backend for Oqtopus.
This class is a placeholder and does not implement any functionality. It serves as a base for creating specific device backends in the future.
Methods:
-
get_device–Get a device by its ID.
-
get_devices–Get all devices registered in Oqtopus Cloud.
get_device
¶
get_device(device_id: str) -> OqtopusDevice
Get a device by its ID.
Parameters:
-
(device_id¶str) –The ID of the device.
Returns:
-
OqtopusDevice(OqtopusDevice) –An OqtopusDevice object.
get_devices
¶
get_devices() -> list[OqtopusDevice]
Get all devices registered in Oqtopus Cloud.
Returns:
-
list[OqtopusDevice]–list[OqtopusDevice]: A list of OqtopusDevice objects.