Skip to content

device

Classes:

OqtopusDevice

A device embedded in the oqtopus framework.

Parameters:

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_at of this DevicesDeviceInfo.

  • basis_gates (list[str]) –

    The basis gates of the device.

  • calibrated_at (datetime) –

    The calibrated_at of 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_at of 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_at of 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_device(device_id: str) -> OqtopusDevice

Get a device by its ID.

Parameters:

  • device_id

    (str) –

    The ID of the device.

Returns:

get_devices

get_devices() -> list[OqtopusDevice]

Get all devices registered in Oqtopus Cloud.

Returns:

  • list[OqtopusDevice]

    list[OqtopusDevice]: A list of OqtopusDevice objects.