qlass: A Python Package for Variational Quantum Algorithms on Photonic Devices
qlass: A Python Package for Variational Quantum Algorithms on Photonic Devices - Published in JOSS (2026)
Science Score: 87.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
✓DOI references
Found 1 DOI reference(s) in JOSS metadata -
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Keywords
Keywords from Contributors
Repository
VQE on photonic quantum devices
Basic Info
- Host: GitHub
- Owner: unitaryfoundation
- License: apache-2.0
- Language: Python
- Default Branch: main
- Homepage: https://qlass.readthedocs.io/
- Size: 1.96 MB
Statistics
- Stars: 16
- Watchers: 3
- Forks: 16
- Open Issues: 9
- Releases: 6
Topics
Metadata Files
README.md
qlass
qlass is a package to compile quantum algorithms on photonic devices. Part of the Quantum Glass-based Photonic Integrated Circuits (QLASS)
project funded by the European Union.
Installing qlass
Stable release (PyPI)
To install the latest stable release of qlass from PyPI:
bash
pip install qlass
Development install
To install the development version, set the working directory to the top level of the repository and run:
bash
uv sync --all-groups
If you don't have uv installed, you can checkout the installation instructions here.
Or, you can install it via pip:
bash
pip install uv
qlass builds upon open-source scientific software packages in Python: scipy for numerical optimization, pyscf and openfermion for quantum chemistry, qiskit for quantum computing, and perceval for quantum photonics compilation. Optionally, one can also use the piquasso package for quantum optics simulations, which can offer improved performance compared to perceval in certain regimes.
Getting started
You can use this demo notebook on the variational quantum eigensolver (VQE) to get started with the qlass package, or check out the example script.
Features
Circuit Compilation
qlass provides a convenient function to compile Qiskit quantum circuits to Perceval processors:
```python from qiskit import QuantumCircuit from qlass import compile
Create a Qiskit circuit
qc = QuantumCircuit(2) qc.h(0) qc.cx(0, 1)
Compile to Perceval processor
processor = compile(qc) ```
Variational Quantum Eigensolver (VQE)
qlass includes tools for implementing the Variational Quantum Eigensolver on photonic quantum computers:
```python from qlass.vqe import VQE, leansatz from qlass.utils import lossfunction from qlass.quantumchemistry import LiHhamiltonian
from perceval.algorithm import Sampler
Generate a Hamiltonian for the LiH molecule
hamiltonian = LiHhamiltonian(numelectrons=2, num_orbitals=1)
Define an executor function that uses the linear entangled ansatz
def executor(params, paulistring): processor = leansatz(params, paulistring) sampler = Sampler(processor) samples = sampler.samples(10000) return samples
Initialize the VQE solver
vqe = VQE( hamiltonian=hamiltonian, executor=executor, num_params=4, # Number of parameters in the linear entangled ansatz )
Run the VQE optimization
vqeenergy = vqe.run( maxiterations=10, verbose=True ) ```
Quantum Chemistry
The package provides tools for working with quantum chemistry Hamiltonians:
```python from qlass.quantumchemistry import LiHhamiltonian, bruteforceminimize
Generate a Hamiltonian for the LiH molecule
hamiltonian = LiHhamiltonian(numelectrons=2, num_orbitals=1)
Calculate the exact ground state energy for comparison
exactenergy = bruteforce_minimize(hamiltonian) ```
Module Structure
The qlass package is organized into several modules:
qlass.compiler: Functions for compiling quantum circuits to photonic processorsqlass.quantum_chemistry: Tools for generating and manipulating Hamiltoniansqlass.vqe: VQE ansatz implementations for photonic quantum computingqlass.utils: Utility functions for executing algorithms and processing results
Documentation
The main functions of the package are commented using the Google style format and can be found here.
Contributing
qlass is developed by the Unitary Foundation, in collaboration with QLASS performers.
You can join the UF Discord server for community support.
For a guide to opening a PR, checkout the contributing guide.
Funding
Funded by the European Union. Views and opinions expressed are however those of the authors only and do not necessarily reflect those of the European Union. Neither the European Union nor the granting authority can be held responsible for them.
Owner
- Name: Unitary Foundation
- Login: unitaryfoundation
- Kind: organization
- Email: info@unitary.foundation
- Website: https://unitary.foundation/
- Twitter: unitaryfdn
- Repositories: 56
- Profile: https://github.com/unitaryfoundation
Unitary Foundation is a non-profit working to create a quantum technology ecosystem that benefits the most people.
JOSS Publication
qlass: A Python Package for Variational Quantum Algorithms on Photonic Devices
Authors
Tags
quantum computing photonics variational quantum eigensolver quantum chemistry linear opticsGitHub Events
Total
- Create event: 38
- Release event: 2
- Issues event: 46
- Watch event: 8
- Delete event: 48
- Member event: 1
- Issue comment event: 73
- Push event: 130
- Pull request review comment event: 9
- Pull request review event: 24
- Pull request event: 94
- Fork event: 10
Last Year
- Create event: 38
- Release event: 2
- Issues event: 46
- Watch event: 8
- Delete event: 48
- Member event: 1
- Issue comment event: 73
- Push event: 130
- Pull request review comment event: 9
- Pull request review event: 24
- Pull request event: 94
- Fork event: 10
Committers
Last synced: 5 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| FarLab | f****h@u****d | 149 |
| Sai Nandan Morapakula | s****2@g****m | 14 |
| dependabot[bot] | 4****]@u****m | 11 |
| Kitsunp | 1****p@u****m | 9 |
| Nathan Shammah | n****h@g****m | 9 |
| Simba | s****a@M****n | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: about 1 month ago
All Time
- Total issues: 26
- Total pull requests: 107
- Average time to close issues: about 1 month
- Average time to close pull requests: 3 days
- Total issue authors: 2
- Total pull request authors: 11
- Average comments per issue: 0.92
- Average comments per pull request: 0.57
- Merged pull requests: 76
- Bot issues: 0
- Bot pull requests: 27
Past Year
- Issues: 26
- Pull requests: 107
- Average time to close issues: about 1 month
- Average time to close pull requests: 3 days
- Issue authors: 2
- Pull request authors: 11
- Average comments per issue: 0.92
- Average comments per pull request: 0.57
- Merged pull requests: 76
- Bot issues: 0
- Bot pull requests: 27
Top Authors
Issue Authors
- nathanshammah (18)
- FarLab (8)
Pull Request Authors
- FarLab (55)
- dependabot[bot] (27)
- saichowdary007 (6)
- Kitsunp (6)
- nathanshammah (4)
- Qubit1718 (3)
- buttercutter (2)
- danielfaus22 (1)
- Roll249 (1)
- Apocalypse96 (1)
- Kolarovszki (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 38 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 6
- Total maintainers: 1
pypi.org: qlass
VQE on linear optical circuits
- Homepage: https://github.com/unitaryfoundation/qlass
- Documentation: https://qlass.readthedocs.io/
- License: apache-2.0
-
Latest release: 0.2.1
published about 2 months ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v4 composite
- actions/setup-python v5 composite
- actions/upload-artifact v4 composite
- actions/checkout v4 composite
- actions/setup-python v5 composite
- numba *
- numpy *
- perceval-quandela ==0.12.1
- pyscf *
- qiskit_aer *
- qiskit_nature *
- sphinx_rtd_theme *
- tqdm *
- pytest ^6.2 develop
- numba *
- numpy *
- perceval-quandela ==0.12.1
- pyscf *
- qiskit_aer *
- qiskit_nature *
- tqdm *
