Quantastica quantum simulator tools
Project description
Quantum programming language converter
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_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 stringTrue
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()
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 whereN
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
(defaultFalse
) ifTrue
QVM will mimic QPU specified by lattice argument.
-
For TOASTER
destination:
No options yet
That's it. Enjoy! :)
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
Built Distribution
Hashes for quantastica-qconvert-0.9.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5db4413342f1156ad945bb62c9a6f61ac8238bca5e7bc9aac175f3ea812f26e |
|
MD5 | 6c6a16580ae1e8f3bc77c02ac2b7b354 |
|
BLAKE2b-256 | 0cff3e37d0fa0fd8d9dec3cf5f7e03a5ecc557276c15161d77052fae8c799e2e |
Hashes for quantastica_qconvert-0.9.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85996f7d0fb1a0aae4e07bf96fa50c63ef658f3f9f3d77ae8b4e4011127b74c0 |
|
MD5 | 4d23bba05f99475049eb21f98d0fad74 |
|
BLAKE2b-256 | c8fa368bc5df021670c1008842cbe2436b5a423a8f95716edf8f2c0b0808f214 |