An open API service indexing awesome lists of open source software.

https://github.com/farukalpay/quantumlib

A modular quantum computing library in Python featuring QAOA, Grover, HHL, and VQC β€” built on Qiskit, with future plans to become a QPU-agnostic, from-scratch quantum SDK.
https://github.com/farukalpay/quantumlib

grover hhl ibm-quantum qaoa qft qiskit qpe qpu-agnostic quantum-algorithms quantum-annealing quantum-computing quantum-framework quantum-gradient quantum-machine-learning quantum-optimization quantum-research quantum-sdk quantum-simulation quantumlib vqc

Last synced: 4 months ago
JSON representation

A modular quantum computing library in Python featuring QAOA, Grover, HHL, and VQC β€” built on Qiskit, with future plans to become a QPU-agnostic, from-scratch quantum SDK.

Awesome Lists containing this project

README

          

# QuantumLib ✨

**QuantumLib** is a state-of-the-art Python library built on Qiskit, designed for quantum computing research and education. Optimized for macOS M4 Pro and compatible with IBM Quantum hardware, QuantumLib provides comprehensive tools to simulate, execute, and benchmark advanced quantum algorithms.

## πŸš€ Expanded Features

### Quantum Algorithms
- **Quantum Approximate Optimization Algorithm (QAOA)**: Solves combinatorial optimization problems.
- **Unitary Coupled Cluster (UCC)**: Quantum simulations for electronic structure problems.
- **Grover's Search Algorithm**: Efficiently searches unsorted databases with quantum speedup.
- **Quantum Fourier Transform (QFT)**: Fundamental for phase estimation and algorithmic speedup.
- **Quantum Phase Estimation (QPE)**: Accurately determines phases, essential for quantum simulations.
- **Harrow-Hassidim-Lloyd (HHL) Algorithm**: Exponentially faster solutions to linear systems.
- **Quantum Annealing**: Heuristic quantum optimization.
- **Kernel-based Quantum Machine Learning**: Integrates quantum methods into machine learning.

## πŸš€ Hybrid Optimizers
- Adam
- RMSProp
- Simultaneous Perturbation Stochastic Approximation (SPSA)
- Quantum Natural Gradient (QNG)

## πŸ›‘ Error Mitigation
- Richardson Extrapolation
- Readout Calibration

## πŸ›  Interactive Developer Tools
- **Command-Line Interface (CLI)**
- Jupyter Notebooks demonstrating quantum applications in finance, cryptography, etc.

## πŸ“ˆ Performance Benchmarks
- Simulator vs. IBM Quantum hardware performance evaluation.

## πŸ“¦ Installation

### Requirements
- Python β‰₯ 3.9
- Qiskit β‰₯ 1.0
- NumPy, SciPy, Matplotlib

### Quick Start

Clone QuantumLib and set up:
```bash
git clone https://github.com/FarukAlpay/QuantumLib.git
cd QuantumLib

conda create -n quantum_env python=3.9
conda activate quantum_env
pip install -r requirements.txt
pip install -e .
```

## 🎯 Usage

### CLI Examples

Run Grover's Algorithm:
```bash
run_circuit grover --num_qubits 3 --marked_state 101 --iterations 1
```

Optimize QAOA:
```bash
run_circuit qaoa --qubits 5 --optimizer spsa
```

Solve linear systems with HHL:
```bash
run_circuit hhl
```

Run Variational Quantum Circuit (VQC):
```bash
run_circuit vqc --num_qubits 3 --num_layers 2 --rotation_gate Ry --entanglement_pattern chain
```

### Python Integration

```python
from quantumlib.circuits import QAOACircuit
from quantumlib.optimizers import SPSAOptimizer

circuit = QAOACircuit(qubits=5)
optimizer = SPSAOptimizer(maxiter=300)
result = optimizer.optimize(circuit)
```

## πŸ§ͺ Testing

Execute tests to ensure robust performance:
```bash
python test_all.py
```

## 🀝 Contributing

Contributions are warmly welcomed! Please:

1. Fork and clone the repository.
2. Create a new branch (`git checkout -b feature-name`).
3. Implement and test your changes.
4. Commit (`git commit -am "Feature description"`).
5. Push (`git push origin feature-name`) and open a Pull Request.

## πŸ“œ License

QuantumLib is released under the MIT License. See [LICENSE](LICENSE).

## πŸ“§ Contact

Questions, suggestions, or contributions?

- Open an [issue on GitHub](https://github.com/FarukAlpay/QuantumLib/issues).
- Email: faruk.alpay@example.com

## πŸ§ͺ Testing

Run comprehensive tests:
```bash
python test_all.py
```

## 🌟 Getting Started

Explore QuantumLib quickly:

- **Run a basic Grover algorithm:**
```bash
run_circuit grover --num_qubits 3 --marked_state 101
```
- **Check out tutorials** provided in Jupyter notebooks to dive deeper.

## πŸ“‚ Project Structure

```
quantumlib/
β”œβ”€β”€ cli/
β”‚ └── run_circuit.py
β”œβ”€β”€ circuits/
β”‚ β”œβ”€β”€ qft.py
β”‚ β”œβ”€β”€ grover.py
β”‚ β”œβ”€β”€ hhl.py
β”‚ └── vqc.py
β”œβ”€β”€ optimizers/
β”‚ β”œβ”€β”€ classical_opt.py
β”‚ └── quantum_native_opt.py
β”œβ”€β”€ execution/
β”‚ └── backend_manager.py
β”œβ”€β”€ tests/
β”‚ └── test_all.py
β”œβ”€β”€ requirements.txt
└── README.md
```

## πŸ“œ License

QuantumLib is distributed under the MIT License.

## ✨ Developer's Note

Crafted passionately by **Faruk Alpay** in Nidderau, Germany, on 11 March 2025. Inspired by the synergy of vaporized herbs, innovative code, and the smooth performance of a MacBook M4 Pro.

_Euphoria in every quantum bit!_ πŸŒΏπŸ’»βœ¨