Skip to main content

Python SDK to Deqart platform

Project description

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


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.7b2.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

deqart-0.0.7b2-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file deqart-0.0.7b2.tar.gz.

File metadata

  • Download URL: deqart-0.0.7b2.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.15

File hashes

Hashes for deqart-0.0.7b2.tar.gz
Algorithm Hash digest
SHA256 722d4a93342cb61ccd7daf52f02eadce15456149fcc4a27abbff1c9d185ef003
MD5 67cea06098d69d8d2c12c1e55f9a9a5d
BLAKE2b-256 15aa7dc80cd857b4c4d80876a1c5c9334ee8be100d3ac936d9d179f6c53c8871

See more details on using hashes here.

File details

Details for the file deqart-0.0.7b2-py3-none-any.whl.

File metadata

  • Download URL: deqart-0.0.7b2-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.15

File hashes

Hashes for deqart-0.0.7b2-py3-none-any.whl
Algorithm Hash digest
SHA256 c7f913a51310f7ac46ea32e413fdf80ec97e9d148fc51bc308fe2247842dec7b
MD5 2759fcca715d3ef70b19807923de86fb
BLAKE2b-256 67519da20f1f29059f560943c27ca7ef22c014fe5bf73d6a84a7e4c19bfd1f61

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