Skip to main content

A tool to access the quantum devices from the QUDORA Cloud using Python.

Project description

QUDORA SDK

The QUDORA Software Development Kit (SDK) enables an interaction with quantum devices hosted on the QUDORA Cloud from Python code.

The included Qiskit-provider allows direct execution of Qiskit-QuantumCircuits on the QUDORA Cloud quantum devices.

Installation

To install the latest version of the QUDORA SDK run

pip install qudora-sdk

Qiskit-Provider Usage

This section explains the usage of the included Qiskit-provider to access QUDORA Cloud quantum devices. In order to use the provider an API-Token from the QUDORA Cloud is required. Such a token can be generated here.

Access to Quantum Devices

To authenticate with the QUDORA Cloud the provider requires the generated API-Token, which is here called my-example-token.

from qudora_sdk.qiskit import QUDORAProvider

provider = QUDORAProvider(token="my-example-token")

If the authentication was successful, all available quantum devices can be listed.

print(provider.backends())

Selecting a particular backend is done with the get_backend() function.

backend = provider.get_backend('QVLS Simulator')

Running Qiskit-QuantumCircuits

The quantum devices can execute QuantumCircuit-objects written with Qiskit. More information about writing circuits with qiskit can be found here. Previously created Backend-objects have a run()-function to submit circuits to a selected backend.

qc = QuantumCircuit(2,2)
qc.h(0)
qc.cx(0,1)

qc.measure(0,0)
qc.measure(1,1)

job = backend.run(qc, job_name='My example job')

The job object represents a job in the QUDORA Cloud. Its status can be retrieved by calling job.status(). To obtain the result of a job, the result() function can be called. This function will wait until the job finishes and return the measurement results.

result = job.result()
print(result)

Rudimentary classical control-flow is also supported by means of Qiskit's dynamic circuits, e.g.:

qc = QuantumCircuit(1,1)

qc.h(0)
qc.measure(0,0)
with qc.if_test((0, 1)):
    qc.x(0)
qc.measure(0,0)

(!) Note about mid-circuit measurements

Mid-circuit measurements are supported, but there is a small caveat. For our backends, measurements include an implicit reset. That means that the following two circuits are equivalent on our backends:

qc.measure(0, 0)

and

qc.measure(0, 0)
qc.reset(0)

In other words: qubits do not preserve their state after a measurement. This deviation from the standard rules of quantum mechanics is due to the nature of our trapped-ion qubits and how the measurement process is implemented. Should you need access to the post-measurement state, you can manually reset the qubit to the post-measurement state by using the dynamic circuit given in the example above.

Customised Settings

A backend has parameters (mostly used for noise models), which you can modify to your needs. You can list all available settings using the show_available_settings()-method.

backend.show_available_settings()

To run a job with custom settings, you can pass a settings dictionary to the run() method.

custom_settings = {
    'measurement_error_probability': 0.005,
    'two_qubit_gate_noise_strength': 1.0
}

job = backend.run(qc, job_name='Job with custom settings', backend_settings=custom_settings)

LICENSE

Copyright (C) 2024 QUDORA GmbH

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qudora_sdk-1.1.0.tar.gz (43.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qudora_sdk-1.1.0-py3-none-any.whl (34.1 kB view details)

Uploaded Python 3

File details

Details for the file qudora_sdk-1.1.0.tar.gz.

File metadata

  • Download URL: qudora_sdk-1.1.0.tar.gz
  • Upload date:
  • Size: 43.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.5

File hashes

Hashes for qudora_sdk-1.1.0.tar.gz
Algorithm Hash digest
SHA256 261cde41df57bc8ea3442bac27bffb0b914770077d97b84009b8937efd597822
MD5 327f07c4d4e562d9e5e3e97df84ae8c3
BLAKE2b-256 84681524643b98fac1044a46e7593e2bd43504eee8aef72010be93c9fb531e6a

See more details on using hashes here.

File details

Details for the file qudora_sdk-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: qudora_sdk-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 34.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.5

File hashes

Hashes for qudora_sdk-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba5070fd4725355992c5fc616c04a1e26f3a11dccfa541a6a8afa6c032e1b633
MD5 c9e1c8932e36f5420cdbfc6be35c6220
BLAKE2b-256 f2ba9733da066132aad80fe11269b017b9abf6de7cac8dbf6be928b269270c46

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page