Physics-Informed Neural Networks (PINNs) for estimating the quantum time-evolution
unitary operators
📄 Paper: Interpolation of unitaries with time-dependent Hamiltonians via Deep Learning, Machine Learning: Science and Technology (IOP Publishing). (DOI / link to be added upon publication.)
This project uses deep learning models informed by physical principles to approximate
the unitary operators
Two modeling strategies are used depending on system size:
-
2–6 qubits: the network predicts the unitary operator
$U(t)$ directly, for a fully non-zero Pauli Hamiltonian (the most general$N$ -qubit Hamiltonian). -
7–8 qubits: the network predicts the coefficients of an effective
time-dependent Hamiltonian
$H_\text{eff}(t)$ , from which$U(t)$ is reconstructed via the second-order Magnus expansion or Trotterization. This keeps the number of trainable parameters tractable at larger system sizes, where the Hamiltonian is restricted to nearest-neighbor Ising or$XYZ$ Heisenberg models.
Physical constraints (such as unitarity) are incorporated directly into the loss function.
git clone https://github.com/guerra-antonio/PINN_dynamics_estimation.git
cd PINN_dynamics_estimation
pip install -r requirements.txtThe code is implemented in Python with PyTorch. See requirements.txt for the exact
Python and library versions used.
The core pipeline (general Pauli Hamiltonian, 2–8 qubits) runs the scripts in the following order:
-
gen_unitaries.py— precompute the target unitaries$U(t)$ at the known times. -
gen_data.py— build the training datasets from those unitaries. -
training_models.py— train the PINN models for all system sizes and time steps. -
testing_models.py— evaluate the trained models and compute gate fidelities.
The notebooks (see below) reproduce the figures of the paper from the generated data.
| File | Description |
|---|---|
gen_unitaries.py |
Precomputes and saves the target unitary matrices dataframe/. |
gen_data.py |
Generates the training datasets. Applies the precomputed unitaries to random initial density matrices |
training_models.py |
Main training pipeline. Trains a UnitaryModel for each system size (2–8) and each |
testing_models.py |
Loads the trained models, predicts dataframe/fidelity_test.csv. |
| File | Description |
|---|---|
statistic_test.py |
Runs the statistical analysis over many independent Hamiltonian realizations (Ising / general Pauli), reporting mean fidelity and variability. Saves results as a .pkl file in dataframe/. |
statistic_test_unitary.py |
Ablation study of the unitarity loss term: compares models trained with and without the unitarity penalty across several time grids ( |
run_statistic_xyz.py |
Statistical analysis for the nearest-neighbor |
run_singlecase_XYZ.py |
Single-realization |
| Notebook | Reproduces |
|---|---|
gen_plots.ipynb |
Fidelity figures for all system sizes. |
benchmark_timing.ipynb |
Inference-time benchmark for 2–6 qubits (PINN vs. geodesic interpolation). |
benchmark_timing_large.ipynb |
Inference-time benchmark for 7–8 qubits (Magnus / Trotter variants). |
plots_trace_distance.ipynb |
Trace-distance statistics between predicted and exact state evolution. |
plots_XYZ.ipynb |
Fidelity figures for the |
plots_ablation_unitarity.ipynb |
Figures for the unitarity-term ablation study. |
state_dynamics.ipynb |
Population dynamics |
| Folder | Contents |
|---|---|
req_prog/ |
Core modules: model architectures, training routines, Magnus/Trotter propagators, and helper functions imported by the main scripts. |
req_prog_statistic/ |
Modules supporting the statistical analyses (Ising and |
dataframe/ |
Generated data: precomputed unitaries, training datasets, and results (.npy, .npz, .csv, .pkl). |
models/ |
Saved model weights (.pth). |
figures/ |
Output figures. |
| File | Description |
|---|---|
requirements.txt |
Required Python version and library dependencies. |
LICENSE.txt |
BSD 3-Clause license. |
banner.jpg |
Repository banner. |
The model takes a scalar time
If you use this code, please cite:
@misc{guerra2026interpolationunitariestimedependenthamiltonians,
title={Interpolation of unitaries with time-dependent Hamiltonians via Deep Learning},
author={Antonio Guerra and Daniel Uzcategui-Contreras and Aldo Delgado and Esteban S. Gómez},
year={2026},
eprint={2601.12619},
archivePrefix={arXiv},
primaryClass={quant-ph},
url={https://arxiv.org/abs/2601.12619},
}This project is licensed under the BSD 3-Clause License. See LICENSE for details.
For questions or collaborations, reach out via GitHub (@guerra-antonio) or email.
