This repository contains symbolic and numerical tools to study concentration and anti-concentration phenomena for passive linear optics, together with notebooks that reproduce the main computations and figures.
It corresponds to the numerical framework used for the article "Representation theory framework for analysing passive linear optics beyond the dilute regime", by Hela Mhiri, Hugo Thomas, Léo Monbroussou, Zoë Holmes, and Elham Kashefi.
- Python 3.10+ (tested with Python 3.11)
- Jupyter Notebook or JupyterLab
- Python packages:
numpyscipysympymatplotlibtqdmipykernel(recommended for notebook kernels)
From the repository root:
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install numpy scipy sympy matplotlib tqdm jupyterlab ipykernelThen launch notebooks:
jupyter labOpen and run notebooks from the repository root (important so src.* imports resolve):
Anti-Concentration.ipynb
Generated figures are saved under plots/.
Representation_Theory_Framework-Passive_Linear_Optics/
├── src/
│ ├── Purity_analysis.py
│ ├── Observable_toolbox.py
│ ├── states_toolbox.py
│ └── anti_concentration_toolbox.py
├── plots/
│ ├── Inverse_P2_per_n_cube.pkl
│ ├── Inverse_P2_per_n_3_2.pkl
│ ├── Concentration_with_bounds.pdf
│ ├── Inverse_P2_per_n_per_coeff_linear.pkl
│ ├── Inverse_P2_per_n_square.pkl
├── Anti-Concentration.ipynb
├── plots/
└── LICENSE
Purity_analysis.py:- Core purity computations, irrep dimensions, combinatorial helpers, and state-projection related quantities.
Observable_toolbox.py:- Observable-related formulas and norms (single-irrep observables, photon-number products, optimized purity computations).
states_toolbox.py:- Fock-state construction and permutation-invariant state utilities.
anti_concentration_toolbox.py:- Anti-concentration formulas, including
P2_calculus(n, m)and its helper functions.
- Anti-concentration formulas, including
- The notebooks are the main entry points for reproducing results and plots.