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
Release history Release notifications | RSS feed
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.5.tar.gz
(7.3 kB
view details)
Built Distribution
File details
Details for the file blueqat-cloud-0.0.5.tar.gz
.
File metadata
- Download URL: blueqat-cloud-0.0.5.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fbda6e70c50a2110face17f9e0931f9304fb20b85fb31f411acbbdd2ca25b9d |
|
MD5 | d4dbd806991b675e80af912f5f8a146e |
|
BLAKE2b-256 | 8b63dae3aa691979c6655a04a0a91ce83de95619dbfe87dfb1d50c9521f4f076 |
File details
Details for the file blueqat_cloud-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: blueqat_cloud-0.0.5-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ae968bb46772b10acdb5c052c76d8e76a4ce2c0e17e4554155c619560e2e586 |
|
MD5 | 168767c7b3021800caadf2b2278ccb53 |
|
BLAKE2b-256 | 6ea39184e09d7652ac6e320daa81c2ac61c3833126f4f2059b1da132507c709f |