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)

https://github.com/unitaryfoundation/qlass

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

compiler photonics qpu quantum-computing variational-algorithms

Keywords from Contributors

labels
Last synced: about 1 month ago · JSON representation

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
compiler photonics qpu quantum-computing variational-algorithms
Created over 1 year ago · Last pushed about 1 month ago
Metadata Files
Readme Contributing License

README.md

Repository build European Union Unitary Foundation Documentation Status codecov PyPI version Downloads License Discord Chat

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 processors
  • qlass.quantum_chemistry: Tools for generating and manipulating Hamiltonians
  • qlass.vqe: VQE ansatz implementations for photonic quantum computing
  • qlass.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

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
Published
January 15, 2026
Volume 11, Issue 117, Page 9316
Authors
Farrokh Labib ORCID
Unitary Fund France, Tours, France, Unitary Foundation, San Francisco, USA
Akilan Rajamani ORCID
ICGM, Univ Montpellier, CNRS, ENSCM, Montpellier, France
Bruno Senjean ORCID
ICGM, Univ Montpellier, CNRS, ENSCM, Montpellier, France
Nathan Shammah ORCID
Unitary Fund France, Tours, France, Unitary Foundation, San Francisco, USA
Editor
Daniel S. Katz ORCID
Tags
quantum computing photonics variational quantum eigensolver quantum chemistry linear optics

GitHub 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

All Time
  • Total Commits: 193
  • Total Committers: 6
  • Avg Commits per committer: 32.167
  • Development Distribution Score (DDS): 0.228
Past Year
  • Commits: 193
  • Committers: 6
  • Avg Commits per committer: 32.167
  • Development Distribution Score (DDS): 0.228
Top Committers
Name Email 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
enhancement (6) good first issue (6) documentation (3) vqe (2) help wanted (1) hamiltonians (1) bug (1)
Pull Request Labels
dependencies (27) python (22) github_actions (5)

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

  • Versions: 6
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 38 Last month
Rankings
Dependent packages count: 9.3%
Average: 30.8%
Dependent repos count: 52.4%
Maintainers (1)
Last synced: about 2 months ago

Dependencies

.github/workflows/docs-build.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
  • actions/upload-artifact v4 composite
.github/workflows/tests.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
docs/requirements.txt pypi
  • numba *
  • numpy *
  • perceval-quandela ==0.12.1
  • pyscf *
  • qiskit_aer *
  • qiskit_nature *
  • sphinx_rtd_theme *
  • tqdm *
pyproject.toml pypi
  • pytest ^6.2 develop
  • numba *
  • numpy *
  • perceval-quandela ==0.12.1
  • pyscf *
  • qiskit_aer *
  • qiskit_nature *
  • tqdm *