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:
-
JavaScript version as command line tool: https://www.npmjs.com/package/q-convert
-
JavaScript version as online web page: https://quantum-circuit.com/qconvert
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_formatFormat.QOBJ
-
dest_format-
Format.PYQUIL -
Format.TOASTER
-
options Dict:
For all destination formats:
-
all_experimentsFalse(default) only first experiment will be converted and returned as stringTrueall experiments form Qobj will be converted and returned as list of strings.
-
create_exec_codeTrue(default) generated source code will contain command which executes circuit e.g.qc.run()
-
shots(integer) ifcreate_exec_codeisTruethen generated code will performshotsnumber of samples
For PYQUIL destination:
latticename of the backend (e.g. for pyQuil destination"Aspen-7-28Q-A").-
If ommited then "Nq-qvm" will be generated where
Nis number fo qubits in the circuit. -
Special values:
"qasm_simulator"will produce "Nq-qvm" backend"statevector_simulator"will produce WaveFunction simulator code
-
as_qvm(defaultFalse) ifTrueQVM 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)
| File | Size | Uploaded | |
|---|---|---|---|
| quantastica-qconvert-0.9.20.tar.gz | 21.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|