Code and data from: Quantum algorithms for equational reasoning
Data files
Apr 29, 2026 version files 9.49 GB
-
README.md
5.06 KB
-
scripts_and_data_for_Quantum_Algorithms_For_Equational_Reasoning.zip
1.80 GB
-
tn_simulations_32.zip
887.68 MB
-
tn_simulations_64_0.zip
2.69 GB
-
tn_simulations_64_1.zip
4.11 GB
Abstract
This dataset contains the source code, simulation data, and analysis scripts associated with the study "Quantum Algorithms for Equational Reasoning." The original research introduces quantum normal form reduction, a computational framework designed to address core problems in equational reasoning, such as the word problem (determining semantic equivalence between symbolic expressions), counting equivalent expressions, and analyzing the structural properties of equivalence classes. To facilitate reproducibility, this repository provides a Python-based implementation of a quantum-inspired version of the algorithm. The package transforms a string rewriting system into a 1D local Hamiltonian and simulates the proposed quantum algorithm using the "Quantum Tea Leaves" tensor network emulator. The dataset includes: 1) Source Code: The complete Python package and environment instructions required to reproduce the paper’s results. 2) Simulation Outputs: Raw tensor network files compatible with "Quantum Tea Leaves" and extracted observable expectation values. 3) Visualization: Scripts used to generate the paper's figures, along with the original figure files themselves.
This repository contains the code, data, and figures associated with the manuscript
“Quantum algorithms for equational reasoning.”
All the code required to reproduce the simulations, together with the raw data and figures, is included in the compressed archive scripts_and_data_for_Quantum_Algorithms_For_Equational_Reasoning.zip, whose contents are described in detail below.
The files tn_simulations_*.zip contain the tensor networks generated by the simulations; their usage is described below.
Package structure
The repository is organized as a Python package named quantum_srs.
You can install it locally with:
pip install .
Git repository
This folder is also a Git repository, and the .git/ directory is included.
Experiments
The experiments/ folder contains scripts for generating data. Each subfolder corresponds to a set of simulations:
brute_force/– scripts for counting connected words via graph exploration.energy_gaps/– scripts for estimating the first energy gap of the Laplacian.gap/– interfaces with the GAP software to generate problem instances using the Knuth–Bendix algorithm.tn/– scripts for tensor network simulations of the quantum normal form reduction algorithm.
Each folder also includes the output data and the figures derived from it.
Execution order:
The tensor network simulations (tn/) must be run after completing the simulations in brute_force/ and gap/.
Environment and dependencies
The simulations were run under the following environment:
- OS: Ubuntu 20.04.6 LTS
- Python: 3.13.2
Python packages
The main python dependencies are
| Package | Version |
|---|---|
torch |
2.6.0+cpu |
numpy |
2.1.2 |
qredtea |
0.2.1 (dev) |
qtealeaves |
1.6.12 (dev) |
The versions used for qredtea and qtealeaves are publicly available can be installed via the command
pip install git+https://baltig.infn.it/quantum_red_tea/py_api_quantum_red_tea.git@v0.2.1
pip install git+https://baltig.infn.it/quantum_tea_leaves/py_api_quantum_tea_leaves.git@v1.6.12
* For information about qredtea and qtealeaves visit https://www.quantumtea.it/.
Commits used to produce data
- Simulations (except first energy gap) → quantum_srs (this repository) @ commit
88a4d95288496005d30d5d18b575190360c9d987 - Plots and first energy gap simulations → quantum_srs (this repository) @ commit
66d3c5292913fa8c9123897404ddef6bda5674a4
Other software
We use the GAP software to run the Knuth–Bendix algorithm, both to generate instances for testing and to obtain benchmarks for our method. GAP is invoked by the Python scripts in the experiments/gap/ directory.
- GAP – version 4.14.0
TN simulations
The files tn_simulations_*.zip contain some of the tensor networks generated by the simulation scripts in the experiments/tn/ directory, which are subsequently used by the plotting scripts in the same directory to produce the figures.
Simulation files are organized into input and output folders produced by qtealeaves. The name of each folder specifies the input word, the annealing time, and the tensor-network bond dimension used in the simulation. Input folders contain only a file specifying the hash of the simulation generated by qtealeaves. Output folders contain the collection of result files produced by qtealeaves. The file encoding the final tensor-network state generated by the simulation is TTN_dyn_*.pklmps.
Authors
- Davide Rattacaso davide.rattacaso@unipd.it
- Daniel Jaschke
- Marco Ballarin
- Ilaria Siloi
- Simone Montangero
License
All the files in this repository are free of any license: see
Creative Commons Zero
Funding
The research leading to these results has received funding from the following organizations: European Union via Italian Research Center on HPC, Big Data and Quantum Computing (NextGenerationEU Project No. CN00000013), project EuRyQa (Horizon 2020), project PASQuanS2 (Quantum Technologies Flagship); Italian Ministry of University and Research (MUR) via: Quantum Frontiers (the Departments of Excellence 2023-2027); the World Class Research Infrastructure - Quantum Computing and Simulation Center (QCSC) of Padova University; Istituto Nazionale di Fisica Nucleare (INFN): iniziativa specifica IS-QUANTUM; the German Federal Ministry of Education and Research (BMBF) via the project QRydDemo. We acknowledge computational resources from Cloud Veneto, as well as computation time on Cineca’s Leonardo machine.
