Double Quant - A high-performance quantum computing framework for solving quantitative finance problems.
Double Quant is a framework that bridges quantum computing and quantitative finance. By leveraging quantum algorithms and advanced optimization techniques, it provides efficient solutions to complex financial computational problems.
- π Optimized Quantum Solvers: State-of-the-art quantum solvers, including lots of bottom-level optimization algorithms.
- π― Three-Layer Architecture: Clean separation of concerns with Data β Solver β Application layers.
- π Type-Safe Design: Full type hints support for better IDE integration and code reliability.
- π§ Easy to Use: Intuitive API design that makes quantum finance accessible to practitioners.
- βοΈ Modular Structure: Flexible components that can be combined for various financial applications.
Double Quant follows a well-designed three-layer architecture:
βββββββββββββββββββββββββββββββββββββββ
β Application Layer β
β (Portfolio, Pricing, ...) β
βββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββ
β Solver Layer β
β (VQA, HHL, ...) β
βββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββ
β Data Layer β
β (Stock data, ...) β
βββββββββββββββββββββββββββββββββββββββ
-
Data Layer (
double_quant.common): Core data structures and utilities. -
Solver Layer (
double_quant.solver): Quantum algorithms and solvers. -
Application Layer: High-level financial applications
- Portfolio optimization
- Option pricing
- Risk analysis
- (More coming soon...)
- Python 3.11 or higher
- uv package manager (recommended)
# Clone the repository
git clone https://github.com/yourusername/double-quant.git
cd double-quant
# Install dependencies
uv sync# Clone the repository
git clone https://github.com/yourusername/double-quant.git
cd double-quant
# Install in development mode
pip install -e .from double_quant import LinearSystem, QuantumLinearSolver
# Define a linear system Ax = b
A = [[4, 1], [1, 3]]
b = [1, 2]
# Create a linear system model
system = LinearSystem(A, b)
# Initialize quantum solver
solver = QuantumLinearSolver()
# Solve the system
solution = solver.solve(system)
print(f"Solution: {solution}")from double_quant import SAPO, LinearSystem
from double_quant.solver import QuantumLinearSolver
# Create a linear system
system = LinearSystem([[2, 1], [1, 2]], [1, 1])
# Use SAPO optimizer for better performance
optimizer = SAPO()
solver = QuantumLinearSolver(optimizer=optimizer)
# Solve with optimization
solution = solver.solve(system)The QuantumLinearSolver implements the HHL (Harrow-Hassidim-Lloyd) algorithm, one of the most important quantum algorithms for solving linear systems exponentially faster than classical methods.
For detailed documentation, API reference, and tutorials, visit our documentation site (coming soon).
# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov=double_quantuv buildThis project follows ruff guidelines and uses type hints throughout.
We welcome contributions! Whether it's bug reports, feature requests, or code contributions, please feel free to get involved.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat(scope): add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
We follow the Angular commit message convention:
<type>(<scope>): <description>
[optional body]
[optional footer]
Types: feat, fix, docs, style, refactor, test, chore
This project is licensed under the GPLv3 - see the LICENSE file for details.
This project draws inspiration from:
- Qiskit - Open-source quantum computing framework.
- Qiskit Finance - Quantum algorithms for finance and its architecture.
- Core linear system solver with HHL algorithm
- Portfolio optimization applications
- Option pricing modules
- Risk analysis tools
- Integration with major quantum computing platforms
- Comprehensive documentation and tutorials
- Performance benchmarks
- Real-world case studies
