Skip to main content

Quantastica quantum programming tools

Project description

Quantum programming language converter

Convert between quantum programming languages

More goodies at https://quantastica.com

Supported languages

Python version of quantastica-qconvert currently supports only:

  • Qobj to pyQuil

  • Qobj to QubitToaster

More formats will be added soon.

Until then, for more formats see:

Usage

from quantastica import qconvert

source_code = ...
options = {}

converted = qconvert.convert(qconvert.Format.QOBJ,
                    source_code,
                    qconvert.Format.PYQUIL,
                    options)
print(converted)

Details

convert(source_format, source_dict, dest_format, options)

  • source_format

    • Format.QOBJ
  • dest_format

    • Format.PYQUIL

    • Format.TOASTER

options Dict:

For all destination formats:

  • all_experiments

    • False (default) only first experiment will be converted and returned as string
    • True all experiments form Qobj will be converted and returned as list of strings.
  • create_exec_code

    • True (default) generated source code will contain command which executes circuit e.g. qc.run()
  • shots (integer) if create_exec_code is True then generated code will perform shots number of samples

For PYQUIL destination:

  • lattice name of the backend (e.g. for pyQuil destination "Aspen-7-28Q-A").
    • If ommited then "Nq-qvm" will be generated where N is number fo qubits in the circuit.

    • Special values:

      • "qasm_simulator" will produce "Nq-qvm" backend
      • "statevector_simulator" will produce WaveFunction simulator code
    • as_qvm (default False) if True QVM will mimic QPU specified by lattice argument.

For TOASTER destination:

No options yet

That's it. Enjoy! :)

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

quantastica-qconvert-0.9.20.tar.gz (21.5 kB view details)

Uploaded Source

Built Distribution

quantastica_qconvert-0.9.20-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

Details for the file quantastica-qconvert-0.9.20.tar.gz.

File metadata

  • Download URL: quantastica-qconvert-0.9.20.tar.gz
  • Upload date:
  • Size: 21.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.10

File hashes

Hashes for quantastica-qconvert-0.9.20.tar.gz
Algorithm Hash digest
SHA256 01079051031266b58f8d2409ad4852068f317e3c9f3314b57990b979e4f2b1b2
MD5 4fe803d78e8e143feca7f187e1874117
BLAKE2b-256 5e9c57779aa7124d5365e468f08e7b2f555a1a2c3c3e400f9bf8afd06aad68e7

See more details on using hashes here.

File details

Details for the file quantastica_qconvert-0.9.20-py3-none-any.whl.

File metadata

  • Download URL: quantastica_qconvert-0.9.20-py3-none-any.whl
  • Upload date:
  • Size: 24.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.10

File hashes

Hashes for quantastica_qconvert-0.9.20-py3-none-any.whl
Algorithm Hash digest
SHA256 39c3b80f0e942f09437fa116dbe10bf8d99b4150939470742975529e467e57c9
MD5 4c147f1d0e49cc29eae98e6084c6d220
BLAKE2b-256 17be7e7ca8ed56442fe46697cb73862a15a8b7f7faa814316f324d8fa4f8777a

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