QSystem
A quantum computing simulator for Python.
The QSystem simulator is inspired in the quantum circuit model, so it's easy to convert any quantum circuit to Python.
Like the follow example:
from qsystem import QSystem
from cmath import exp, pi
q = QSystem(3, 24) # init q0, q1, q2
q.evol(gate='H', qbit=0, count=3) # H q0; H q1; H q2
q.add_ancillas(4) # init a0, a1, a2, a3
q.evol(gate='X', qbit=6) # X a3
q.cnot(target=4, control=[2]) # CNOT a1, q2
q.cnot(5, [2]) # CNOT a2, q2
q.cnot(5, [3]) # CNOT a2, a0
q.cnot(3, [1, 5]) # Toffoli a1, q1, a2
q.cnot(5, [3]) # CNOT a2, a0
q.cnot(4, [6]) # CNOT a1, a3
q.cnot(6, [1, 4]) # Toffoli a3, q1, a1
q.cnot(4, [6]) # CNOT a1, a3
q.measure(qbit=3, count=4) # measure a0, a1, a2, a3
print('ancillas measurement =', q.bits()[3:])
# ancillas measurement = [0, 1, 0, 0]
q.rm_ancillas() # rm a0, a1, a2, a3
q.evol('H', 0) # H q0 ┐
q.cphase(phase=1j, target=1, control=[0]) # Controlled S q1, q0 │
q.evol('H', 1) # H q1 │
q.cphase(exp(pi*1j/4), 2, [0]) # Controlled T q2, q0 │ = q.qft(0, 3)
q.cphase(1j, 2, [1]) # Controlled S q2, q1 │
q.evol('H', 2) # H q1 │
q.swap(0, 2) # SWAP q0, q2 ┘
q.measure(0, 3) # measure q0, q1, q2
print('final measurement =', q.bits())
# final measurement = [1, 0, 0]
Installation
QSystem depends on Boost C++ Libraries and requires a C/C++ compiler.
To install use the follow command:
pip install QSystem
Bitwise representation
The current release has three distinct ways to represent the quantum state: vector, matrix, and the proposed bitwise. The latter is a new way to store and manipulate both states and operations which shows an exponential advantage with the amount of superposition in the systems state.
For more information see our paper arXiv:2004.03560.
@article{qsystem,
title={QSystem: bitwise representation for quantum circuit simulations},
author={Evandro Chagas Ribeiro da Rosa and Bruno G. Taketani},
year={2020},
eprint={2004.03560},
archivePrefix={arXiv},
primaryClass={quant-ph}
}
Seed the API documentation.
This software is supported by
Metadata
Release files for QSystem 1.2.0.post1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| QSystem-1.2.0.post1.tar.gz | 644.6 kB | Without provenance | Details |
Release files / QSystem-1.2.0.post1.tar.gz
| Download URL | QSystem-1.2.0.post1.tar.gz |
|---|---|
| Size | 644.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0bfca7400a6cd881f7961091272d7978e2818ef7cf55333f9786b8610ba22c1e
|
|
BLAKE2b-256 checksum How to use checksums |
c505ca5407339ee0a49a097d223fd5f36192cc14873e3d3f91f5f78b1831dafc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.3
|
Security for QSystem 1.2.0.post1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.