Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Log inSign up
Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Blog
Job Board
Q3AS

© 2026 Aqora Quantum S.A.S.

TermsPrivacyLegal Notice

Trade-offs in Gauss's law error correction for lattice gauge theory quantum simulations

Bálint Pató, Natalie Klco

Published Feb 25, 2026• 0 citations
Publisher

Abstract

Gauss' Law in Lattice Gauge Theory Simulations Setup Unzip the downloaded Zenodo package to a folder named gauss_law_qec and run cd gauss_law_qec to switch the current directory to the package directory. Please use Python version 3.10, 3.11, 3.12, or 3.13 (Pymatching has wheels up to 3.13). We provide instructions for Unix systems (Linux/MacOSX), which are fully supported, and Windows systems, which are partially supported. Because CairoSVG is only reliably available on Unix systems, Windows installations will not generate Figure 5, but other figures will work. The data generated behind Figure 5, however, is still valid on Windows as well. Unix: python3 -m venv .venv source .venv/bin/activate pip3 install -r requirements.txt Windows (use cmd.exe, not Powershell): python -m venv .venv .venv/Scripts/activate.bat pip install -r requirements.txt Setup the PYTHONPATH variable to point to the current directory. Unix: export PYTHONPATH="." Windows (cmd.exe): set PYTHONPATH=. Note that on MacOSX, you will need to also install cairo, we recommend using Homebrew, and copy the libcairo.2.dylib to the source folder. cp `brew list cairo | grep libcairo.2.dylib` . Generate figures To generate all figures, run python gauss_law/plot/generate_all_figures.py Figure 3. Logical error rates in single round memory experiment python gauss_law/plot/single_round_memory_experiment_analytical.py Figure is in figures/classical_prob_analytical.pdf. Figure 4. UQEC vs GLQEC ratio in single round memory experiment python gauss_law/plot/glqec_vs_uqec_ratio.py Figure 5. Combined memory & simulation plots To create the combined figure based on the existing cached data in the data folder: python gauss_law/plot/combined_memory_and_simulation_plot.py The figure will be in figures/combined_memory_simulation_n8_p8.0e-02.png. Remove and regenerate data WARNING - next steps will remove cached data. Only do this if you want to test regenerating data. To remove cached data, run: rm data/multi_round_* To regenerate the data for both simulation and memory density matrix experiments, run: python gauss_law/plot/multi_round_dm_evolutions.py --simulate --all_theories python gauss_law/plot/multi_round_dm_evolutions.py Figure 6. Monte carlo multi-round samples for memory channel python gauss_law/plot/multi_round_memory_sampling.py Figure 7. Trace distance upper bound plot python gauss_law/plot/memory_slem_upper_bound_plot.py Note that this utility uses the same data that was generated for Figure 5. Figure 8. Lambda2 plot and table of lambda2 values at p=0.08 Using MWPM decoding: python gauss_law/plot/glqec_lambda2_plot.py Figure saved to: figures/glqec_lambda2_plot.pdf Using extended RRW decoding: python gauss_law/plot/glqec_lambda2_plot.py --lookup_table Figure saved to: figures/glqec_lambda2_plot_LUT.pdf Remove and regenerate data for Fig 8. WARNING - next steps will remove cached data. Only do this if you want to test regenerating data. !!! Running the eigenvalue computation is only slightly optimized, on a 10 Apple M4 core Mac mini runs for 2 hours at least for each commands. !!! The commands above use the /cache in the data folder, and you can remove them by running these commands: rm data/glqec_lambd* rm data/glqec_sympy* rm data/lambda2_cache* Then, running the above commands will regenerate the data. Figure 9. Lambda2 based estimators for electric energy python gauss_law/plot/multi_round_memory_sampling.py --num_physical_sites 50 --num_trials 100 --show_upper_bounds --glqec_lambda2 0.924416 Verifying the state counting for the d=3 gauge cause To test up to n=1000, run python gauss_law/state_counting/truncated_u1_counting.py To go higher, pass in the number of sites: python gauss_law/state_counting/truncated_u1_counting.py 2000 Development and running unit tests Install the dev tools by running: pip install -r dev-requirements.txt Then to execute the unit tests, run pytest gauss_law To check coverage, run: pytest --cov=gauss_law gauss_law --cov-config=.coveragerc --cov-report term Should return: =============================================================================================== tests coverage ================================================================================================= _______________________________________________________________________________ coverage: platform darwin, python 3.13.7-final-0 ________________________________________________________________________________ Name Stmts Miss Cover ----------------------------------------------------------------------- gauss_law/channel/core.py 173 17 90% gauss_law/code/rrw.py 49 3 94% gauss_law/code/run_of_ones.py 25 0 100% gauss_law/lattice/array_lattice_operators.py 126 15 88% gauss_law/lattice/protocols.py 23 2 91% gauss_law/lattice/qutip_lattice_operators.py 141 12 91% gauss_law/lattice/staggered_fermion_lattice.py 79 7 91% gauss_law/mixing/lambda2.py 54 40 26% gauss_law/mixing/markov.py 189 38 80% gauss_law/state_counting/truncated_u1_counting.py 84 19 77% ----------------------------------------------------------------------- TOTAL 943 153 84% ============================================================================================= 8172 passed in 46.04s =============================================================================================

DOI
10.5281/zenodo.18704760

Related papers

Trade-offs in Gauss's law error correction for lattice gauge theory quantum simulations

Bálint Pató, Natalie Klco

Gauss' Law in Lattice Gauge Theory Simulations Setup Unzip the downloaded Zenodo package to a folder named gauss_law_qec and run cd gauss_law_qec to switch the current directory to the package directory. Please use Python version 3.10, 3.11, 3.12, or 3.13 (Pymatching has wheels up to 3.13). We provide instructions for Unix systems (Linux/MacOSX), which are fully supported, and Windows systems, which are partially supported. Because CairoSVG is only reliably available on Unix systems, Windows installations will not generate Figure 5, but other figures will work. The data generated behind Figure 5, however, is still valid on Windows as well. Unix: python3 -m venv .venv source .venv/bin/activate pip3 install -r requirements.txt Windows (use cmd.exe, not Powershell): python -m venv .venv .venv/Scripts/activate.bat pip install -r requirements.txt Setup the PYTHONPATH variable to point to the current directory. Unix: export PYTHONPATH="." Windows (cmd.exe): set PYTHONPATH=. Note that on MacOSX, you will need to also install cairo, we recommend using Homebrew, and copy the libcairo.2.dylib to the source folder. cp `brew list cairo | grep libcairo.2.dylib` . Generate figures To generate all figures, run python gauss_law/plot/generate_all_figures.py Figure 3. Logical error rates in single round memory experiment python gauss_law/plot/single_round_memory_experiment_analytical.py Figure is in figures/classical_prob_analytical.pdf. Figure 4. UQEC vs GLQEC ratio in single round memory experiment python gauss_law/plot/glqec_vs_uqec_ratio.py Figure 5. Combined memory & simulation plots To create the combined figure based on the existing cached data in the data folder: python gauss_law/plot/combined_memory_and_simulation_plot.py The figure will be in figures/combined_memory_simulation_n8_p8.0e-02.png. Remove and regenerate data WARNING - next steps will remove cached data. Only do this if you want to test regenerating data. To remove cached data, run: rm data/multi_round_* To regenerate the data for both simulation and memory density matrix experiments, run: python gauss_law/plot/multi_round_dm_evolutions.py --simulate --all_theories python gauss_law/plot/multi_round_dm_evolutions.py Figure 6. Monte carlo multi-round samples for memory channel python gauss_law/plot/multi_round_memory_sampling.py Figure 7. Trace distance upper bound plot python gauss_law/plot/memory_slem_upper_bound_plot.py Note that this utility uses the same data that was generated for Figure 5. Figure 8. Lambda2 plot and table of lambda2 values at p=0.08 Using MWPM decoding: python gauss_law/plot/glqec_lambda2_plot.py Figure saved to: figures/glqec_lambda2_plot.pdf Using extended RRW decoding: python gauss_law/plot/glqec_lambda2_plot.py --lookup_table Figure saved to: figures/glqec_lambda2_plot_LUT.pdf Remove and regenerate data for Fig 8. WARNING - next steps will remove cached data. Only do this if you want to test regenerating data. !!! Running the eigenvalue computation is only slightly optimized, on a 10 Apple M4 core Mac mini runs for 2 hours at least for each commands. !!! The commands above use the /cache in the data folder, and you can remove them by running these commands: rm data/glqec_lambd* rm data/glqec_sympy* rm data/lambda2_cache* Then, running the above commands will regenerate the data. Figure 9. Lambda2 based estimators for electric energy python gauss_law/plot/multi_round_memory_sampling.py --num_physical_sites 50 --num_trials 100 --show_upper_bounds --glqec_lambda2 0.924416 Verifying the state counting for the d=3 gauge cause To test up to n=1000, run python gauss_law/state_counting/truncated_u1_counting.py To go higher, pass in the number of sites: python gauss_law/state_counting/truncated_u1_counting.py 2000 Development and running unit tests Install the dev tools by running: pip install -r dev-requirements.txt Then to execute the unit tests, run pytest gauss_law To check coverage, run: pytest --cov=gauss_law gauss_law --cov-config=.coveragerc --cov-report term Should return: =============================================================================================== tests coverage ================================================================================================= _______________________________________________________________________________ coverage: platform darwin, python 3.13.7-final-0 ________________________________________________________________________________ Name Stmts Miss Cover ----------------------------------------------------------------------- gauss_law/channel/core.py 173 17 90% gauss_law/code/rrw.py 49 3 94% gauss_law/code/run_of_ones.py 25 0 100% gauss_law/lattice/array_lattice_operators.py 126 15 88% gauss_law/lattice/protocols.py 23 2 91% gauss_law/lattice/qutip_lattice_operators.py 141 12 91% gauss_law/lattice/staggered_fermion_lattice.py 79 7 91% gauss_law/mixing/lambda2.py 54 40 26% gauss_law/mixing/markov.py 189 38 80% gauss_law/state_counting/truncated_u1_counting.py 84 19 77% ----------------------------------------------------------------------- TOTAL 943 153 84% ============================================================================================= 8172 passed in 46.04s =============================================================================================

•Feb 26, 2026•0 citations

Trade-offs in Gauss's law error correction for lattice gauge theory quantum simulations

Balint Pato, Natalie Klco

Gauss's law-based quantum error correction (GLQEC) offers a promising approach to reducing qubit overhead in lattice gauge theory simulations by leveraging built-in symmetries. For applications of GLQEC to 1+1D lattice quantum electrodynamics (QED), we identify two significant trade-offs. First, we prove via dimension-counting arguments that GLQEC requires periodic electric fields, thereby constraining the design space for lattice QED simulations. Second, we numerically compare GLQEC with a universal quantum error correction (UQEC) code, specifically the $d=3$ bitflip repetition code, and find that while GLQEC can achieve lower logical error rates in single-round error correction, it exhibits faster decoherence to the steady-state mixed ensemble under multiple rounds. The mixing speed penalty is manifest in observables of interest for both memory experiments and Hamiltonian evolution. We identify a mixing speed threshold, $p_{th}=0.277(2)$, above which using GLQEC exhibits even faster decoherence than without error correction. Our results highlight fundamental limitations of symmetry-based error correction schemes and inform corresponding constraints on formulations of lattice gauge theories compatible with error-robust quantum simulation techniques.

quant-pharXiv:2602.22121•Feb 26, 2026•0 citations

Towards near-term quantum simulation of materials

Laura Clinton, Toby S. Cubitt, Brian Flynn +6 more

Overview of data provided in support of Towards near-term quantum simulation of materials Contents of this folder: `analyse_materials_results.py`: script used to generate the summary tables and figures presented in the manuscript. `towards_quantum_simulation_data`: raw data used and produced when studying various 3D materials. `towards_quantum_simulation_analysis`: tables (in `.tex` format) and figures (as PDFs) presented in the manuscript. The contents of `towards_quantum_simulation_analysis` were generated by `analyse_materials_results.py`, i.e. the user need not run the script to produce the output files. Users can generate these analyses directly by running ```python analyse_materials_results.py```, though note the following packages will first need to be installed: `pandas >= 1.2.3` `numpy >= 1.23` `seaborn >= 0.11.1` `lfig >= 0.1.3` `matplotlib > 3.7.0` Included data Within `towards_quantum_simulation_data`, there are subfolders for each of the materials described in the manuscript, i.e. `SrVO3`, `GaAs`, `H3S`, `Si`, `Li2CuO2`. Within each material's folder are further subfolders for the `hamiltonian` and `encoding` used to represent the material, as well as subfolders for each of the `algorithms` studied. `hamiltonian`: files which specify the Hamiltonian for the material under study. There are a number of files `interactions.json` Hamiltonian terms in terms of Majorana monomials. `map_majorana_to_mode.json` keys are Majorana indices; values are the mode index to which they are associated. `map_mode_to_group.json` keys are mode indices; values are the group (or site) index to which they are associated. `map_group_to_position.json` keys are group indices; values are the corresponding 3D Cartesian coordinates of the lattice used to represent the material. `stage_data.json` contains key/value pairs of any other fields of interest. `encoding` files which specify the fermionic encoding which is customised for the material under study. `encoding.json` which details the edges of the hybrid compact encoding described in Section VI of the supplementary material. `precompiler.json` contains all the information which permits the encoding construction, including the Hamiltonian terms (`_interactions`) which match those in `hamiltonian/interactions.json`. The same mappings as present in the Hamiltonian data(a.g. `map_group_to_position`). `stage_data.json` contains key/value pairs of any other fields of interest. `algorithms` contains subfolders for each of the algorithms desribed in the manuscript Those explored for circuits depths: `TDSSplitTermsPriorityCircuitDepth` (TDS in the manuscript) `TDSSplitTermsPriorityCircuitDepthNoSwapNetwork` (TDS\*) `VQESplitTerms` (VQE) `VQESplitTermsNoSwapNetwork` (VQE*) each of which contain the files, inside the `circuitry` folder: `circuit_terms.csv`, which lists each individual term, together with their Pauli string and rotation angle, required to construct the corresponding quantum circuit `circuit_layers_to_implement.csv` groups the same terms into layers to achieve parallelism in the circuit. `stage_data.json` contains key/value pairs of any other fields of interest. and those used to compose measurement layers, as outlined in Section VII D of the supplementary material: `MeasurementCommutativity` `MeasurementNaiveQubitwise` `MeasurementNonCrossing` each of which contain the files, inside the `compilation` folder: `layers.csv` lists the terms which may be measured simultaneously to achieve the measurement strategies shown in Table S14. `stage_data.json` contains key/value pairs of any other fields of interest. CSV files In `towards_quantum_simulation_data`, there are unified CSV files containing the results of applying the procedures described in the manuscript to the target materials. `circuit_costs.csv`: results of running the circuit compiler described in the manuscript. `measurements.csv`: results of running the measurement compiler described in the manuscript. These CSVs are used in the analysis script `analyse_materials_results.py` to produce the figures and tables presented in the manuscript.

arXiv:2205.15256•May 30, 2022•8 citations

From Ising to Potts: Physics-inspired Potts machines of coupled oscillators for low-energy sampling and combinatorial optimization

Yi Cheng, Zongli Lin

Repository containing the code to reproduce the experiments in the paper "From Ising to Potts: physics-inspired Potts machines in coupled oscillators for low-energy sampling and combinatorial optimization". It contains four standalone Python scripts: Max_2_cut.py — OPM solver for Max-2-Cut Max_3_cut.py — OPM solver for Max-3-Cut Max_4_cut.py — OPM solver for Max-4-Cut Max_5_cut.py — OPM solver for Max-5-Cut The benchmark graph instances G1–G5 are included as text files (G1.txt–G5.txt) in the same folder. Requirements Python 3.9+ and the packages listed in requirements.txt (notably: numpy, scipy, matplotlib, torch, torchsde). How to run (Jupyter / terminal) After installing dependencies: In a Jupyter notebook: %run Max_2_cut.py %run Max_3_cut.py %run Max_4_cut.py %run Max_5_cut.py Or in a terminal: python Max_2_cut.py (and similarly for Max-3/4/5) The scripts generate the output figures in the working directory (e.g., box plots summarizing solution quality across instances). GPU recommendation For best performance, we recommend running the code on a GPU. The runtime numbers reported below were measured on NVIDIA GeForce RTX 2080 Ti (CUDA 12.8; driver 570.124.06). Actual wall-clock time may vary with hardware and system load. Reproducibility and runtime For a faster sanity check, start with seed_num = 1 (typical wall-clock times to finish all instances G1–G5: Max-3-Cut ~12 min, Max-4-Cut ~16 min, Max-5-Cut ~24 min).To reproduce the results reported in the paper, use seed_num = 20.

arXiv:2507.18379•Jul 23, 2025•0 citations

Code and datasets for "Shortcuts to adiabaticity with a quantum control field"

Emma C. King, Giovanna Morigi, Raphaël Menu

Shortcuts to adiabaticity with a quantum control field — Code & data========================================================== This repository contains a Jupyter notebook and supporting data files (csv) to reproduce the numerical results and figures in our manuscript (arXiv 2508.06304), which investigates adiabatic shortcuts mediated by a quantum control field.The code implements a Landau–Zener two-level system coupled to a spectator qubit, time evolution of the full system (LZ qubit + spectator) via QuTiP, parameter sweeps (parallelized with joblib), and plotting utilities for the manuscript figures. Related publication----------------------------This code is complementary to the preprint: https://arxiv.org/abs/2508.06304. Requirements---------------------The simulations were developed for and tested on Python 3.9+. Recommended packages and minimum versions: - Python >= 3.9- numpy >= 1.22- scipy >= 1.8- matplotlib >= 3.5- qutip >= 4.6 (install a recent stable qutip; some installations require `pip install qutip` or `conda` channels)- joblib >= 1.2- tqdm >= 4.60- pandas (optional, for CSV handling)- jupyterlab / notebook (for interactive use) Running the notebook (interactive) Open the notebook with JupyterLab or Jupyter Notebook. Execute cells sequentially in the order indicated by the notebook outline.The sections “Definitions” and “Figure imports and setup” must be executed before generating any data or figures, as they define all operators, and helper functions. The notebook is organized into separate sections for each figure of the manuscript, allowing you to re-run only the figure(s) of interest. Note: Figure 4 (Density plot) is configured to load precomputed data files to reduce computational cost. To reproduce Figure 4 without recomputing the full dataset, ensure the required .csv files are downloaded and located in the same directory as the notebook. To explore different parameter regimes: Modify the relevant parameter definitions (e.g., anneal_window, g, epsilon, omega_c, x0, x0_vals, q_vals). To include dissipation of the spectator (ancilla) qubit, set the parameter kappa> 0. For questions about reproducing the figures or about parameter choices used in the paper, contact the corresponding authors listed in the preprint. If you reuse this data/code, please cite the associated preprint and this code archive.

•Feb 22, 2026•0 citations

Graph Entanglement Extraction

Konrad Szymański, Lina Vandré, Otfried Gühne

Prerequisites This software was written in Mathematica and in Python 3 using Jupiter notbook. The following python packages are required: numpy, networkx, functools, graphstates, weightedgraphstates, utils, matplotlib, tqdm, math, operator, itertools, pickle, qutip, random, os, time, IPython Installation Download the repository snapshot attached as a .zip file, unpack it and install the needed Python packages. Since updating files on Zenodo is not supported, possible changes will be published on https://gitlab.com/kjsz/graph-entanglement-extraction. Usage The Mathematica code simulates performance of noisy measurements. The calculation_example.nb (rendered to the .pdf file) showcases symbolic calculations involving graph states (and, more importantly, noisy ensembles of them) --- measurement, postselection, and entanglement properties of reduced post-measurement states. Figures of the paper can be reproduced using the files figure_*. The Python code implements (optionally weighted) graph state creation and manipulation in full Hilbert space description. Most of the code is based on qutip routines, and graphs are specified as networkx objects; the resulting states (and ensembles) are encapsulated into GraphState / GraphStateEnsemble (graphstates.py) and WeightedGraphState/WeightedGraphStateEnsemble (weightedgraphstates.py) classes for easier manipulation, as qutip does not natively support ensembles (only density operators, which are too inefficient in this simulations). The above code is used in the .ipynb notebooks reproducing the figures of the paper.

•Feb 19, 2025•0 citations
Gauss' Law in Lattice Gauge Theory Simulations Setup Unzip the downloaded Zenodo package to a folder named gauss_law_qec and run cd gauss_law_qec to switch the current directory to the package directory. Please use Python version 3.10, 3.11, 3.12, or 3.13 (Pymatching has wheels up to 3.13). We provide instructions for Unix systems (Linux/MacOSX), which are fully supported, and Windows systems, which are partially supported. Because CairoSVG is only reliably available on Unix systems, Windows installations will not generate Figure 5, but other figures will work. The data generated behind Figure 5, however, is still valid on Windows as well. Unix: python3 -m venv .venv source .venv/bin/activate pip3 install -r requirements.txt Windows (use cmd.exe, not Powershell): python -m venv .venv .venv/Scripts/activate.bat pip install -r requirements.txt Setup the PYTHONPATH variable to point to the current directory. Unix: export PYTHONPATH="." Windows (cmd.exe): set PYTHONPATH=. Note that on MacOSX, you will need to also install cairo, we recommend using Homebrew, and copy the libcairo.2.dylib to the source folder. cp brew list cairo | grep libcairo.2.dylib . Generate figures To generate all figures, run python gauss_law/plot/generate_all_figures.py Figure 3. Logical error rates in single round memory experiment python gauss_law/plot/single_round_memory_experiment_analytical.py Figure is in figures/classical_prob_analytical.pdf. Figure 4. UQEC vs GLQEC ratio in single round memory experiment python gauss_law/plot/glqec_vs_uqec_ratio.py Figure 5. Combined memory & simulation plots To create the combined figure based on the existing cached data in the data folder: python gauss_law/plot/combined_memory_and_simulation_plot.py The figure will be in figures/combined_memory_simulation_n8_p8.0e-02.png. Remove and regenerate data WARNING - next steps will remove cached data. Only do this if you want to test regenerating data. To remove cached data, run: rm data/multi_round_* To regenerate the data for both simulation and memory density matrix experiments, run: python gauss_law/plot/multi_round_dm_evolutions.py --simulate --all_theories python gauss_law/plot/multi_round_dm_evolutions.py Figure 6. Monte carlo multi-round samples for memory channel python gauss_law/plot/multi_round_memory_sampling.py Figure 7. Trace distance upper bound plot python gauss_law/plot/memory_slem_upper_bound_plot.py Note that this utility uses the same data that was generated for Figure 5. Figure 8. Lambda2 plot and table of lambda2 values at p=0.08 Using MWPM decoding: python gauss_law/plot/glqec_lambda2_plot.py Figure saved to: figures/glqec_lambda2_plot.pdf Using extended RRW decoding: python gauss_law/plot/glqec_lambda2_plot.py --lookup_table Figure saved to: figures/glqec_lambda2_plot_LUT.pdf Remove and regenerate data for Fig 8. WARNING - next steps will remove cached data. Only do this if you want to test regenerating data. !!! Running the eigenvalue computation is only slightly optimized, on a 10 Apple M4 core Mac mini runs for 2 hours at least for each commands. !!! The commands above use the /cache in the data folder, and you can remove them by running these commands: rm data/glqec_lambd* rm data/glqec_sympy* rm data/lambda2_cache* Then, running the above commands will regenerate the data. Figure 9. Lambda2 based estimators for electric energy python gauss_law/plot/multi_round_memory_sampling.py --num_physical_sites 50 --num_trials 100 --show_upper_bounds --glqec_lambda2 0.924416 Verifying the state counting for the d=3 gauge cause To test up to n=1000, run python gauss_law/state_counting/truncated_u1_counting.py To go higher, pass in the number of sites: python gauss_law/state_counting/truncated_u1_counting.py 2000 Development and running unit tests Install the dev tools by running: pip install -r dev-requirements.txt Then to execute the unit tests, run pytest gauss_law To check coverage, run: pytest --cov=gauss_law gauss_law --cov-config=.coveragerc --cov-report term Should return: =============================================================================================== tests coverage ================================================================================================= _______________________________________________________________________________ coverage: platform darwin, python 3.13.7-final-0 ________________________________________________________________________________ Name Stmts Miss Cover ----------------------------------------------------------------------- gauss_law/channel/core.py 173 17 90% gauss_law/code/rrw.py 49 3 94% gauss_law/code/run_of_ones.py 25 0 100% gauss_law/lattice/array_lattice_operators.py 126 15 88% gauss_law/lattice/protocols.py 23 2 91% gauss_law/lattice/qutip_lattice_operators.py 141 12 91% gauss_law/lattice/staggered_fermion_lattice.py 79 7 91% gauss_law/mixing/lambda2.py 54 40 26% gauss_law/mixing/markov.py 189 38 80% gauss_law/state_counting/truncated_u1_counting.py 84 19 77% ----------------------------------------------------------------------- TOTAL 943 153 84% ============================================================================================= 8172 passed in 46.04s =============================================================================================
Gauss' Law in Lattice Gauge Theory Simulations Setup Unzip the downloaded Zenodo package to a folder named gauss_law_qec and run cd gauss_law_qec to switch the current directory to the package directory. Please use Python version 3.10, 3.11, 3.12, or 3.13 (Pymatching has wheels up to 3.13). We provide instructions for Unix systems (Linux/MacOSX), which are fully supported, and Windows systems, which are partially supported. Because CairoSVG is only reliably available on Unix systems, Windows installations will not generate Figure 5, but other figures will work. The data generated behind Figure 5, however, is still valid on Windows as well. Unix: python3 -m venv .venv source .venv/bin/activate pip3 install -r requirements.txt Windows (use cmd.exe, not Powershell): python -m venv .venv .venv/Scripts/activate.bat pip install -r requirements.txt Setup the PYTHONPATH variable to point to the current directory. Unix: export PYTHONPATH="." Windows (cmd.exe): set PYTHONPATH=. Note that on MacOSX, you will need to also install cairo, we recommend using Homebrew, and copy the libcairo.2.dylib to the source folder. cp `brew list cairo | grep libcairo.2.dylib` . Generate figures To generate all figures, run python gauss_law/plot/generate_all_figures.py Figure 3. Logical error rates in single round memory experiment python gauss_law/plot/single_round_memory_experiment_analytical.py Figure is in figures/classical_prob_analytical.pdf. Figure 4. UQEC vs GLQEC ratio in single round memory experiment python gauss_law/plot/glqec_vs_uqec_ratio.py Figure 5. Combined memory & simulation plots To create the combined figure based on the existing cached data in the data folder: python gauss_law/plot/combined_memory_and_simulation_plot.py The figure will be in figures/combined_memory_simulation_n8_p8.0e-02.png. Remove and regenerate data WARNING - next steps will remove cached data. Only do this if you want to test regenerating data. To remove cached data, run: rm data/multi_round_* To regenerate the data for both simulation and memory density matrix experiments, run: python gauss_law/plot/multi_round_dm_evolutions.py --simulate --all_theories python gauss_law/plot/multi_round_dm_evolutions.py Figure 6. Monte carlo multi-round samples for memory channel python gauss_law/plot/multi_round_memory_sampling.py Figure 7. Trace distance upper bound plot python gauss_law/plot/memory_slem_upper_bound_plot.py Note that this utility uses the same data that was generated for Figure 5. Figure 8. Lambda2 plot and table of lambda2 values at p=0.08 Using MWPM decoding: python gauss_law/plot/glqec_lambda2_plot.py Figure saved to: figures/glqec_lambda2_plot.pdf Using extended RRW decoding: python gauss_law/plot/glqec_lambda2_plot.py --lookup_table Figure saved to: figures/glqec_lambda2_plot_LUT.pdf Remove and regenerate data for Fig 8. WARNING - next steps will remove cached data. Only do this if you want to test regenerating data. !!! Running the eigenvalue computation is only slightly optimized, on a 10 Apple M4 core Mac mini runs for 2 hours at least for each commands. !!! The commands above use the /cache in the data folder, and you can remove them by running these commands: rm data/glqec_lambd* rm data/glqec_sympy* rm data/lambda2_cache* Then, running the above commands will regenerate the data. Figure 9. Lambda2 based estimators for electric energy python gauss_law/plot/multi_round_memory_sampling.py --num_physical_sites 50 --num_trials 100 --show_upper_bounds --glqec_lambda2 0.924416 Verifying the state counting for the d=3 gauge cause To test up to n=1000, run python gauss_law/state_counting/truncated_u1_counting.py To go higher, pass in the number of sites: python gauss_law/state_counting/truncated_u1_counting.py 2000 Development and running unit tests Install the dev tools by running: pip install -r dev-requirements.txt Then to execute the unit tests, run pytest gauss_law To check coverage, run: pytest --cov=gauss_law gauss_law --cov-config=.coveragerc --cov-report term Should return: =============================================================================================== tests coverage ================================================================================================= _______________________________________________________________________________ coverage: platform darwin, python 3.13.7-final-0 ________________________________________________________________________________ Name Stmts Miss Cover ----------------------------------------------------------------------- gauss_law/channel/core.py 173 17 90% gauss_law/code/rrw.py 49 3 94% gauss_law/code/run_of_ones.py 25 0 100% gauss_law/lattice/array_lattice_operators.py 126 15 88% gauss_law/lattice/protocols.py 23 2 91% gauss_law/lattice/qutip_lattice_operators.py 141 12 91% gauss_law/lattice/staggered_fermion_lattice.py 79 7 91% gauss_law/mixing/lambda2.py 54 40 26% gauss_law/mixing/markov.py 189 38 80% gauss_law/state_counting/truncated_u1_counting.py 84 19 77% ----------------------------------------------------------------------- TOTAL 943 153 84% ============================================================================================= 8172 passed in 46.04s =============================================================================================
Gauss's law-based quantum error correction (GLQEC) offers a promising approach to reducing qubit overhead in lattice gauge theory simulations by leveraging built-in symmetries. For applications of GLQEC to 1+1D lattice quantum electrodynamics (QED), we identify two significant trade-offs. First, we prove via dimension-counting arguments that GLQEC requires periodic electric fields, thereby constraining the design space for lattice QED simulations. Second, we numerically compare GLQEC with a universal quantum error correction (UQEC) code, specifically the d=3d=3d=3 bitflip repetition code, and find that while GLQEC can achieve lower logical error rates in single-round error correction, it exhibits faster decoherence to the steady-state mixed ensemble under multiple rounds. The mixing speed penalty is manifest in observables of interest for both memory experiments and Hamiltonian evolution. We identify a mixing speed threshold, pth=0.277(2)p_{th}=0.277(2)pth​=0.277(2), above which using GLQEC exhibits even faster decoherence than without error correction. Our results highlight fundamental limitations of symmetry-based error correction schemes and inform corresponding constraints on formulations of lattice gauge theories compatible with error-robust quantum simulation techniques.
Overview of data provided in support of Towards near-term quantum simulation of materials Contents of this folder: `analyse_materials_results.py`: script used to generate the summary tables and figures presented in the manuscript. `towards_quantum_simulation_data`: raw data used and produced when studying various 3D materials. `towards_quantum_simulation_analysis`: tables (in `.tex` format) and figures (as PDFs) presented in the manuscript. The contents of `towards_quantum_simulation_analysis` were generated by `analyse_materials_results.py`, i.e. the user need not run the script to produce the output files. Users can generate these analyses directly by running ```python analyse_materials_results.py```, though note the following packages will first need to be installed: `pandas >= 1.2.3` `numpy >= 1.23` `seaborn >= 0.11.1` `lfig >= 0.1.3` `matplotlib > 3.7.0` Included data Within `towards_quantum_simulation_data`, there are subfolders for each of the materials described in the manuscript, i.e. `SrVO3`, `GaAs`, `H3S`, `Si`, `Li2CuO2`. Within each material's folder are further subfolders for the `hamiltonian` and `encoding` used to represent the material, as well as subfolders for each of the `algorithms` studied. `hamiltonian`: files which specify the Hamiltonian for the material under study. There are a number of files `interactions.json` Hamiltonian terms in terms of Majorana monomials. `map_majorana_to_mode.json` keys are Majorana indices; values are the mode index to which they are associated. `map_mode_to_group.json` keys are mode indices; values are the group (or site) index to which they are associated. `map_group_to_position.json` keys are group indices; values are the corresponding 3D Cartesian coordinates of the lattice used to represent the material. `stage_data.json` contains key/value pairs of any other fields of interest. `encoding` files which specify the fermionic encoding which is customised for the material under study. `encoding.json` which details the edges of the hybrid compact encoding described in Section VI of the supplementary material. `precompiler.json` contains all the information which permits the encoding construction, including the Hamiltonian terms (`_interactions`) which match those in `hamiltonian/interactions.json`. The same mappings as present in the Hamiltonian data(a.g. `map_group_to_position`). `stage_data.json` contains key/value pairs of any other fields of interest. `algorithms` contains subfolders for each of the algorithms desribed in the manuscript Those explored for circuits depths: `TDSSplitTermsPriorityCircuitDepth` (TDS in the manuscript) `TDSSplitTermsPriorityCircuitDepthNoSwapNetwork` (TDS\*) `VQESplitTerms` (VQE) `VQESplitTermsNoSwapNetwork` (VQE*) each of which contain the files, inside the `circuitry` folder: `circuit_terms.csv`, which lists each individual term, together with their Pauli string and rotation angle, required to construct the corresponding quantum circuit `circuit_layers_to_implement.csv` groups the same terms into layers to achieve parallelism in the circuit. `stage_data.json` contains key/value pairs of any other fields of interest. and those used to compose measurement layers, as outlined in Section VII D of the supplementary material: `MeasurementCommutativity` `MeasurementNaiveQubitwise` `MeasurementNonCrossing` each of which contain the files, inside the `compilation` folder: `layers.csv` lists the terms which may be measured simultaneously to achieve the measurement strategies shown in Table S14. `stage_data.json` contains key/value pairs of any other fields of interest. CSV files In `towards_quantum_simulation_data`, there are unified CSV files containing the results of applying the procedures described in the manuscript to the target materials. `circuit_costs.csv`: results of running the circuit compiler described in the manuscript. `measurements.csv`: results of running the measurement compiler described in the manuscript. These CSVs are used in the analysis script `analyse_materials_results.py` to produce the figures and tables presented in the manuscript.
Repository containing the code to reproduce the experiments in the paper "From Ising to Potts: physics-inspired Potts machines in coupled oscillators for low-energy sampling and combinatorial optimization". It contains four standalone Python scripts: Max_2_cut.py — OPM solver for Max-2-Cut Max_3_cut.py — OPM solver for Max-3-Cut Max_4_cut.py — OPM solver for Max-4-Cut Max_5_cut.py — OPM solver for Max-5-Cut The benchmark graph instances G1–G5 are included as text files (G1.txt–G5.txt) in the same folder. Requirements Python 3.9+ and the packages listed in requirements.txt (notably: numpy, scipy, matplotlib, torch, torchsde). How to run (Jupyter / terminal) After installing dependencies: In a Jupyter notebook: %run Max_2_cut.py %run Max_3_cut.py %run Max_4_cut.py %run Max_5_cut.py Or in a terminal: python Max_2_cut.py (and similarly for Max-3/4/5) The scripts generate the output figures in the working directory (e.g., box plots summarizing solution quality across instances). GPU recommendation For best performance, we recommend running the code on a GPU. The runtime numbers reported below were measured on NVIDIA GeForce RTX 2080 Ti (CUDA 12.8; driver 570.124.06). Actual wall-clock time may vary with hardware and system load. Reproducibility and runtime For a faster sanity check, start with seed_num = 1 (typical wall-clock times to finish all instances G1–G5: Max-3-Cut ~12 min, Max-4-Cut ~16 min, Max-5-Cut ~24 min).To reproduce the results reported in the paper, use seed_num = 20.
Shortcuts to adiabaticity with a quantum control field — Code & data========================================================== This repository contains a Jupyter notebook and supporting data files (csv) to reproduce the numerical results and figures in our manuscript (arXiv 2508.06304), which investigates adiabatic shortcuts mediated by a quantum control field.The code implements a Landau–Zener two-level system coupled to a spectator qubit, time evolution of the full system (LZ qubit + spectator) via QuTiP, parameter sweeps (parallelized with joblib), and plotting utilities for the manuscript figures. Related publication----------------------------This code is complementary to the preprint: https://arxiv.org/abs/2508.06304. Requirements---------------------The simulations were developed for and tested on Python 3.9+. Recommended packages and minimum versions: - Python >= 3.9- numpy >= 1.22- scipy >= 1.8- matplotlib >= 3.5- qutip >= 4.6 (install a recent stable qutip; some installations require `pip install qutip` or `conda` channels)- joblib >= 1.2- tqdm >= 4.60- pandas (optional, for CSV handling)- jupyterlab / notebook (for interactive use) Running the notebook (interactive) Open the notebook with JupyterLab or Jupyter Notebook. Execute cells sequentially in the order indicated by the notebook outline.The sections “Definitions” and “Figure imports and setup” must be executed before generating any data or figures, as they define all operators, and helper functions. The notebook is organized into separate sections for each figure of the manuscript, allowing you to re-run only the figure(s) of interest. Note: Figure 4 (Density plot) is configured to load precomputed data files to reduce computational cost. To reproduce Figure 4 without recomputing the full dataset, ensure the required .csv files are downloaded and located in the same directory as the notebook. To explore different parameter regimes: Modify the relevant parameter definitions (e.g., anneal_window, g, epsilon, omega_c, x0, x0_vals, q_vals). To include dissipation of the spectator (ancilla) qubit, set the parameter kappa> 0. For questions about reproducing the figures or about parameter choices used in the paper, contact the corresponding authors listed in the preprint. If you reuse this data/code, please cite the associated preprint and this code archive.
Prerequisites This software was written in Mathematica and in Python 3 using Jupiter notbook. The following python packages are required: numpy, networkx, functools, graphstates, weightedgraphstates, utils, matplotlib, tqdm, math, operator, itertools, pickle, qutip, random, os, time, IPython Installation Download the repository snapshot attached as a .zip file, unpack it and install the needed Python packages. Since updating files on Zenodo is not supported, possible changes will be published on https://gitlab.com/kjsz/graph-entanglement-extraction. Usage The Mathematica code simulates performance of noisy measurements. The calculation_example.nb (rendered to the .pdf file) showcases symbolic calculations involving graph states (and, more importantly, noisy ensembles of them) --- measurement, postselection, and entanglement properties of reduced post-measurement states. Figures of the paper can be reproduced using the files figure_*. The Python code implements (optionally weighted) graph state creation and manipulation in full Hilbert space description. Most of the code is based on qutip routines, and graphs are specified as networkx objects; the resulting states (and ensembles) are encapsulated into GraphState / GraphStateEnsemble (graphstates.py) and WeightedGraphState/WeightedGraphStateEnsemble (weightedgraphstates.py) classes for easier manipulation, as qutip does not natively support ensembles (only density operators, which are too inefficient in this simulations). The above code is used in the .ipynb notebooks reproducing the figures of the paper.