Python SDK to Deqart platform
Project description
Deqart Python SDK
Usage
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
# }
Circuit serialization
You can decode a quantum circuit of Braket/Cirq/Qiskit to/from JSON string.
import deqart.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)
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.10b1.tar.gz
(13.9 kB
view details)
Built Distribution
deqart-0.0.10b1-py3-none-any.whl
(17.0 kB
view details)
File details
Details for the file deqart-0.0.10b1.tar.gz
.
File metadata
- Download URL: deqart-0.0.10b1.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f927d4c8eab8883001f1b2107219264814d5007a2ad0d43027e5736d9d8526e |
|
MD5 | 989925410556fcdf0313b3b5ab322768 |
|
BLAKE2b-256 | 36213caaddec747a34a0b717bcbf843dceca50337c93c8ff8e2bba1208443b2c |
File details
Details for the file deqart-0.0.10b1-py3-none-any.whl
.
File metadata
- Download URL: deqart-0.0.10b1-py3-none-any.whl
- Upload date:
- Size: 17.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 406b54ff0a3dfb86777b0a4a5e86a316f602236bcb7a791d8141b2ef3fa1fbe7 |
|
MD5 | 4e9ecddaf6c2a43c93c2609c7cfef4fd |
|
BLAKE2b-256 | 48bf2da99a8cb4ce98e5eca3a04bb07523420fc64c371365c3e5c32a1987a0ae |