qitesse is an open-source python API for qitesse-sim, the performant Rust quantum simulator.
qitesse is built upon qitesse-sim, the high-performance CPU-based state-vector simulator for quantum circuits, fully built in Rust.
This PyPI module provides a high-level python interface for the purpose of production, research, and development.
- Performant CPU based simulation
- State-vector execution for common single-, two-, and multi-qubit gates
- Mid-circuit
measure,reset, andbarrieroperations - Custom unitary operations with
Gate.unitary(...) - Controlled custom unitaries with
Gate.controlled_unitary(...)
qitesse requires Python 3.8+. Install it via pip:
pip install qitesseOr install from source:
git clone https://github.com/OsamaMIT/qitesse.git
pip install maturin
maturin develop --releaseTo run examples:
python examples/h_example.py
python examples/qft._example.py
python examples/custom_unitary.py
Avaliable soon!
Single-qubit gates:
ixyzhssdgttdgrxryrzp/phaseu
Two-qubit gates:
cnot/cxcyczchswapiswapcrxcrycrzcp/cphasecu
Three-qubit and larger:
ccx/toffolicswap/fredkinmcxmczmcp/mcphasecontrolled_unitary
Circuit operations:
measureresetbarrier
Custom unitaries:
import numpy as np
import qitesse
hadamard = np.array([[1, 1], [1, -1]], dtype=np.complex64) / np.sqrt(2)
circuit = qitesse.Circuit([
qitesse.Gate.unitary([0], hadamard),
qitesse.Gate.controlled_unitary([0], [1], hadamard),
])
state = circuit.run(2)Use run_with_measurements(num_qubits) if the circuit contains measurement gates and you want the observed bit values back.
- Differentiable gradients
- Additional simulation backends
Contributions are welcome! To contribute:
- Fork the repository
- Create a new branch (feature-branch)
- Commit your changes and open a pull request
This project is licensed under the MIT License. See the LICENSE file for details.