Skip to main content

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! :)

Release files for quantastica-qconvert 0.9.20

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for quantastica-qconvert 0.9.20
File Size Uploaded
quantastica-qconvert-0.9.20.tar.gz 21.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for quantastica-qconvert 0.9.20
File Interpreter ABI Platform
quantastica_qconvert-0.9.20-py3-none-any.whl Python 3 none any Details

Total release size: 46.4 kB

Release files / quantastica-qconvert-0.9.20.tar.gz

Download URL quantastica-qconvert-0.9.20.tar.gz
Size 21.5 kB
Tags Source
SHA-256 checksum
How to use checksums
01079051031266b58f8d2409ad4852068f317e3c9f3314b57990b979e4f2b1b2
BLAKE2b-256 checksum
How to use checksums
5e9c57779aa7124d5365e468f08e7b2f555a1a2c3c3e400f9bf8afd06aad68e7
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / quantastica_qconvert-0.9.20-py3-none-any.whl

Download URL quantastica_qconvert-0.9.20-py3-none-any.whl
Size 24.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39c3b80f0e942f09437fa116dbe10bf8d99b4150939470742975529e467e57c9
BLAKE2b-256 checksum
How to use checksums
17be7e7ca8ed56442fe46697cb73862a15a8b7f7faa814316f324d8fa4f8777a
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.9.20 This release

2 release files

0.9.19

2 release files

0.9.18

2 release files

0.9.17

2 release files

0.9.16

2 release files

0.9.15

2 release files

0.9.14

2 release files

0.9.13

2 release files

0.9.12

2 release files

0.9.10

2 release files

0.9.9

2 release files

0.9.8

2 release files

0.9.7

2 release files

0.9.6

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page