Python SDK to Deqart platform
Project description
Usage
Circuit serialization
You can decode a quantum circuit of Braket/Cirq/Qiskit to/from JSON string.
import deqart.lib.circuit_serialization as circuit_serialization
# Example with Cirq circuit
encoded_cirq = circuit_serialization.encode_circuit(qc_cirq)
decoded_cirq = circuit_serialization.decode_circuit(encoded_cirq)
Interface with the Deqart server
Initialization
import deqart
# If you have run the line below once, subsequent initialization no longer
# requires explicit API token, i.e. deqart.init() without an argument is
# sufficient. This is because the token is automatically saved to
# ~/.config/deqart/config.json.
dq = deqart.init(YOUR_API_TOKEN)
Estimating how long it takes to simulate a circuit
import deqart
dq = deqart.init()
qc = qiskit.QuantumCircuit(2)
qc.h(0)
qc.x(1)
result = dq.estimate_job_runtime(qc)
print(result)
# Output
# {
# 'device': 'qsim_simulator',
# 'estimate_ms': 100,
# 'num_qubits': 2,
# 'qc': 'UUlTS0lUBQAVAgAAAAAAAAABcQAKaQAIAAAAAgAAAAAAAAAAAAAABAAAAAEAAAAAAAAAAmNpcmN1aXQtNzgAAAAAAAAAAG51bGxxAQAAAAIAAQFxAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAUAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASEdhdGVxAAAAAAAFAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFhHYXRlcQAAAAEAAA==',
# 'warning_message': 'This is just an estimate; the actual runtime may be less or more.'
# }
Submitting a simulation job and retrieving it
import deqart
dq = deqart.init()
dq.submit_job(qc)
result = dq.search_jobs()
print(result)
# Output
# {
# 'column_names': ['job_id', 'run_status', 'success', 'worker_runtime_ms', 'created_on'],
# 'data': [['4j2u9lb031YgfPpB', 'QUEUED', None, None, '2022-10-20T07:10:20.316Z']], 'total_count': 1
# }
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
deqart-0.0.1b9.tar.gz
(12.8 kB
view details)
Built Distribution
deqart-0.0.1b9-py3-none-any.whl
(15.5 kB
view details)
File details
Details for the file deqart-0.0.1b9.tar.gz
.
File metadata
- Download URL: deqart-0.0.1b9.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0fab63f9fbf26c2127bd335d424fd3ecbd706e657484efa4d8d8badace7aa71 |
|
MD5 | 89c5ee701bf4de8eb64a5394182e98ad |
|
BLAKE2b-256 | b69a3c8411dda49f627c6764f8e95c74e1bea5be2786287f50047333b6b24a78 |
File details
Details for the file deqart-0.0.1b9-py3-none-any.whl
.
File metadata
- Download URL: deqart-0.0.1b9-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8d1ae2330f0ec7f82f0a375d1ab5f215450cfaba8db4d58b148b06c3f8dc17d |
|
MD5 | 483e4bfc1934a095b433dd5b8b57573b |
|
BLAKE2b-256 | b04df98580c8a0f51175e185a08f017aad18eda1765b6ac17c1dea54e9310879 |