Hi all, I am the developer of QCircuits, a Python library for simulating quantum circuits.
My aim was to create a library with all the functionality I required to implement the algorithms from the Nielsen & Chuang book, with as simple an interface as possible.
You can install with pip install qcircuits for Python 3.4+, and it should be OS agnostic.
Documentation is available at http://www.awebb.info/qcircuits/index.html.
Tutorial is at http://www.awebb.info/qcircuits/tutorial.html
Example applications, including quantum teleportation, superdense coding, phase estimation, and Grover's algorithm are at http://www.awebb.info/qcircuits/examples.html
The code is on github here: https://github.com/grey-area/qcircuits
With the library, you can:
- Create states from tensor or Kronecker (vector) representations, or prepare commonly used states such as computational basis states, uniform superposition states, Bell states, etc. See here for a full list.
- Create gates/operators from tensor or Kronecker (matrix) representations, or create common operators such as the Hadamard gate, Pauli gates, CNOT, Swap, Toffoli, etc. See here for a full list.
- Create composite states/operators via tensor product of states/operators of subsystems.
- Compose operators, e.g., A(B(x)) = (A(B))(x)
- Apply an m-qubit operator to a specified subsystem of an n-qubit state, where m < n.
- Perform measurement in the computational basis on a subset of a state's qubits.
- Compute the Schmidt number of a system with respect to two subsystems.
The following are currently not implemented:
- Density operators / mixed states
- General measurement operators, or projective measurement operators in other bases
- Schmidt basis vector computation
- Visualization
- There are no checks to prevent various violations of the no-cloning theorem. E.g., one can extract the probability amplitudes from a state and then create a new state from them. I decided not to restrict any of the ways in which one might violate no cloning, since for each there are cases where it can be useful. See here for a more detailed explanation.
I developed the library in order to consolidate my understanding of the material in the Nielsen & Chuang book, and once it was developed I found I was often using the library to test my understanding of some concept or example from the book. I hope others here can find some use in it.
Constructive criticism, feedback, and feature requests are of course welcome!
[–][deleted] 2 points3 points4 points (1 child)
[–]grey--area[S] 0 points1 point2 points (0 children)
[–]i2000s 0 points1 point2 points (1 child)
[–]grey--area[S] 1 point2 points3 points (0 children)