pyqsim is a Python library designed to simplify quantum computing simulation through high-level abstractions. It aims to make quantum programming more accessible and intuitive, bridging the gap between classical and quantum computing paradigms.
- High-Level Abstraction: Move beyond low-level circuit and qubit manipulations to a more intuitive programming model.
- Automatic Inverse Operations: Objects automatically perform inverse operations upon deletion, maintaining quantum state consistency.
- Familiar Programming Model: Use quantum data types similarly to classical types like int, making the transition to quantum computing smoother for classical programmers.
- Eager Execution: Computations are performed immediately as Python functions are called, allowing for real-time interaction and debugging.
- Quantum-Classical Hybrid Programming: Seamlessly mix quantum operations with classical programming constructs.
pip install pyqsim
Here's a simple example implementing Deutsch's algorithm:
import pyqsim
from pyqsim.types import qint
from pyqsim.gates import h, z
def oracle(x): return x & ~x # Constant function
a = qint(0, size=1)
z(oracle(h(a)))
print("Constant" if int(a) == 0 else "Balanced")
Check out the examples/
directory for more complex quantum algorithms implementations, including Grover's search algorithm.
We welcome contributions! Please contact me through email.
This project is licensed under the MIT License - see the LICENSE file for details.
For any queries or support, please open an issue on our GitHub repository or contact me at [email protected].