qrunch.quantum.backends.oqc_cloud.oqc_cloud
Module with implementation of Oxford Quantum Circuit’s backend for running quantum circuits.
Classes
Class for handling Oxford Quantum Circuit's (OQC) quantum devices through the OQC cloud. |
|
Available Oxford Quantum Circuit devices. |
|
Job class for handling job on Oxford Quantum Circuit. |
- class OqcCloudBackend
Bases:
BackendClass for handling Oxford Quantum Circuit’s (OQC) quantum devices through the OQC cloud.
- __init__(token: str, device: OqcCloudDevices = OqcCloudDevices.TOKYO, *, compiler: Compiler | None = None, error_mitigation: ErrorMitigationConfig | None = None, compiler_configuration: CompilerConfig | None = None) None
Initialize an OQC Cloud Backend.
The backend can be used to launch quantum circuits to quantum devices on OQC’s cloud.
- Parameters:
token (str) – Token used to access OQC’s cloud.
device (OqcCloudDevices) – Device to run circuit on.
compiler (Compiler | None) – Compiler for changing into universal gates. the compiler must implement the to_universal_gates method.
error_mitigation (ErrorMitigationConfig | None) – Optional OQC error mitigation to use. Mutually exclusive with compiler_config.
compiler_configuration (CompilerConfig | None) – Optional compiler configuration to use. The compiler configuration contains optimizations and error mitigation. Number of repeats and output format will be overwritten. Mutually exclusive with error_mitigation.
- Return type:
None
- property client: OQCClient
OQC Client.
- get_device_data() DeviceData
Device data is not currently available for OQC devices.
- Return type:
- get_qpus() list[dict[str, Any]]
Return all available QPUs from Oxford Quantum Circuit.
- Return type:
list[dict[str, Any]]
- property name: str
Name of the backend.
- property qpu_id: str
QPU id.
- supports_shots_equals_none() bool
Return whether the backend supports shots = None.
Oxford Quantum Circuit’s devices requires number of shots.
- Return type:
bool
- class OqcCloudDevices
Bases:
EnumAvailable Oxford Quantum Circuit devices.
- TOKYO = 'OQC Toshiko Tokyo-1'
- class OqcJob
Bases:
BackendJobJob class for handling job on Oxford Quantum Circuit.
- __init__(backend: OqcCloudBackend, job_id: str, tasks: list[QPUTask], shots: int, error_log: str) None
Initialize an Oxford Quantum Circuit job.
- Parameters:
backend (OqcCloudBackend) – Backend used for the job.
job_id (str) – id of the job as a string.
tasks (list[QPUTask]) – list of the tasks running on Oxford Quantum Circuit’s backend.
shots (int) – number of shots.
error_log (str) – Message to be logged in case of errors.
- Return type:
None
- cancel() None
Cancel all tasks in the job.
- Return type:
None
- property job_id: str
ID of the job.
- result() BackendResult
Get the results of the tasks.
- Return type:
- status() BackendJobStatus
Return the collective status of all tasks in the job.
- Return type:
- wait_for_final_state(timeout: float | None = None) None
Wait until the job status is in a final state, i.e.,
DONE,CANCELLED, orFAILED.- Parameters:
timeout (float | None) – Seconds to wait for the job. If
None, wait forever.- Raises:
TimeoutError – If the job does not reach a final state before the specified timeout.
- Return type:
None