Skip to main content

Blueqat cloud API

Project description

Blueqat cloud SDK (bqcloud)

Client SDK for Blueqat cloud.

Handling API key

Register API

import bqcloud
api = bqcloud.register_api("Your API key here")

Your API key is stored to $HOME/.bqcloud/api_key. If you don't want to save API key, use insteads following codes.

import bqcloud
api = bqcloud.api.Api("Your API key here")

Load API

Once API key is saved, the key can be loaded from file.

import bqcloud
api = bqcloud.load_api()

Gate

Create a task

from blueqat import Circuit
from bqcloud import load_api, Device
api = load_api()

task = api.execute(Circuit().h[0].cx[0, 1], Device.IonQDevice, 10)

Show a status

print(task.status())

Update a task

task.update()

Wait a task

# Wait until task is done. It may takes so long time.
result = task.wait()
print(result.shots())
# Wait 10 sec. If complete, result is returned, otherwise, None is returned.
result = task.wait(timeout=10)
if result:
    print(result.shots())
else:
    print("timeout")

Get fetched result again

# Once updated or waited after task completed, task.result() returns the result.
result = task.result()
if result:
    print(result.shots())
else:
    print("result is not fetched")

List tasks

tasks = api.tasks()
print(list(tasks))
if tasks[0].result() is not None:
    print(tasks[0].result().shots())

Annealing

import bqcloud
api = bqcloud.load_api()
api.annealing([[-1, 0], [0, 0.5]], 5, 10)

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

blueqat-cloud-0.0.3.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

blueqat_cloud-0.0.3-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file blueqat-cloud-0.0.3.tar.gz.

File metadata

  • Download URL: blueqat-cloud-0.0.3.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for blueqat-cloud-0.0.3.tar.gz
Algorithm Hash digest
SHA256 3c8b12fa5bde3605031c7d46f4b1475e35a81b067a42d7c6700cdc8c0ca19497
MD5 2248e96af9c46a5b588661ac2672f4dc
BLAKE2b-256 dd907b4cc77635a1c7d928bb81c3d1a584f3f60c27dfd7e265ff93fd485695df

See more details on using hashes here.

File details

Details for the file blueqat_cloud-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: blueqat_cloud-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

File hashes

Hashes for blueqat_cloud-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9814ad382db45005d001f1b530bd8c84fdacac8e511ca71e0bdc64143d5d8c5e
MD5 8ab4326f4fc64aeb5f00f3a56660e926
BLAKE2b-256 8eccdc2e68570b462ee59a508168355e840daf0c315b83a64f368c0c9889c6d8

See more details on using hashes here.

Supported by

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