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:
-
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()
-
shots
(integer) ifcreate_exec_code
isTrue
then generated code will performshots
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
(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.14.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 790f641b3c4eab7b289db3aaff9f0d51fc99470e67315c76ef890cf29f80aadb |
|
MD5 | a50d617db1f1fac2919ca5838d5eda12 |
|
BLAKE2b-256 | 211f1dbe335f1797fea38c47523fdc3b568ae6089b7b4c8b0981a6d99c98222b |
Hashes for quantastica_qconvert-0.9.14-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff1be3b87676f2da713884d0ac23bcb3200a74d751be3c554f61c6074d725faf |
|
MD5 | 03d5da9132ed632668c745b8181704ef |
|
BLAKE2b-256 | e23e7fa6825447bc3a74910a823d8b9053d5030ea909369657384a8c0e32d84b |