qutrunk is an open source library for quantum computing.
Project description
qutrunk
qutrunk is a free, open-source and cross-platform Python library for quantum computing. qutrunk also work as a foundation of high-level applications, such as: quantum algorithm, quantum machine learning, quantum composer and so on
qutrunk features
- Quantum programming based on quantum circuit and quantum gate.
- Simulate quantum programs on classical computers, provide full amplitude calculation
- Device independent, Run the same quantum circuit on various quantum backends(e.g: BackendLocalCpp, BackendLocalPy, BackendQuSprout, BackendIBM, etc.)
- Compatible with openqasm/2.0
- Provide resource statistics
Install
- Install from whl package, run the following command directly:
pip install qutrunk
- Install from source code(the cpp simulater BackendLocalCpp will be used as default), run the following command to install qutrunk by source code(see the detailed installation steps xxx):
python3 setup.py install
Example:
bell-pair quantum algorithm:
# import package
from qutrunk.circuit import QCircuit
from qutrunk.circuit.gates import H, CNOT, Measure, All
# allocate resource
qc = QCircuit()
qr = qc.allocate(2)
# apply quantum gates
H * qr[0]
CNOT * (qr[0], qr[1])
All(Measure) * qr
# print circuit
qc.print(qc)
# run circuit
res = qc.run(shots=1024)
# print result
print(res.get_counts())
# draw circuit
qc.draw()
License
qutrunk is free and open source, release under the Apache Licence, Version 2.0.
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
qutrunk-0.1.10.tar.gz
(1.1 MB
view hashes)