Skip to content

About

This is my master thesis work.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Neural Quantum States for 1D Spin Systems

CI

Research code and exploratory notebooks for neural quantum states, matrix-product states, conditional mutual information (CMI), and one-dimensional quantum spin models.

The main focus is the rotated 1D cluster-state family, with the transverse-field Ising model (TFIM) used as a reference problem. This is the code behind my M.Sc. research at the University of Waterloo and Perimeter Institute; a manuscript is in preparation.

Result: measurement-induced correlations in the cluster state

Measure every qubit of the 1D cluster state in a basis rotated by an angle $\theta$ about the $y$ axis, and ask how much the two ends of a block still share once the $m$ sites between them are known: $I_m = I(X_0 : X_{m+1} \mid X_1, \dots, X_m)$.

log10 of the conditional mutual information versus buffer size m and angle theta

The CMI is exactly zero in the $Z$ basis ($\theta = 0$) and the $X$ basis ($\theta = \pi/2$), where the outcomes are independent uniform bits. In between it decays exponentially in $m$, and the decay slows by about two orders of magnitude as $\theta$ approaches $\pi/2$, where odd and even $m$ also separate. The figure comes from cluster_mps_cmi_length_scan.py, which computes the probabilities exactly from the bond-dimension-2 MPS, with no sampling:

python scripts/cluster_state/cluster_mps_cmi_length_scan.py --max-m 12 --n-theta 31 --fit-max 10

Repository structure

nqs_project/
├── README.md
├── LICENSE
├── requirements.txt
├── CITATION.cff
├── docs/                 # figures used in this README
├── tests/                # pytest checks for the CMI script
├── notebooks/
│   ├── cluster_state/
│   │   ├── mbqc.ipynb
│   │   ├── rcs_mps_dmrg.ipynb
│   │   └── netket_rbm_exploratory.ipynb
│   └── tfim/
│       └── tfim_rnn_vmc.ipynb
└── scripts/
    └── cluster_state/
        ├── cluster_mps_cmi_length_scan.py
        └── hes_mps_cmi_length.py

Contents

Cluster-state notebooks

  • mbqc.ipynb — small PennyLane/NetworkX exploration of cluster states and rotated-basis measurement probabilities.
  • rcs_mps_dmrg.ipynb — MPS/DMRG calculations for the rotated cluster-state Hamiltonian using TeNPy.
  • netket_rbm_exploratory.ipynb — exploratory NetKet RBM/VMC calculations together with exact-diagonalization and CMI diagnostics.

TFIM notebook

  • tfim_rnn_vmc.ipynb — exact diagonalization, measurement distributions, CMI, autoregressive RNN learning, and an RNN-VMC prototype for the 1D TFIM.

Reproducible scripts

  • cluster_mps_cmi_length_scan.py — exact bond-dimension-2 cluster-state MPS calculation of CMI decay versus measurement angle.
  • hes_mps_cmi_length.py — exact MPS calculation of endpoint/local CMI for the entanglement-swapping stabilizer Hamiltonian.

Setup

The two scripts need only NumPy and Matplotlib. The notebooks need the full stack in requirements.txt (NetKet, JAX, PyTorch, TeNPy, PennyLane).

python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install -r requirements.txt   # or: pip install numpy matplotlib pytest

Then start JupyterLab:

jupyter lab

Example script usage

python scripts/cluster_state/cluster_mps_cmi_length_scan.py --max-m 12 --n-theta 21
python scripts/cluster_state/hes_mps_cmi_length.py --mode endpoint --max-m 18 --n-theta 16

Tests

pytest tests

The tests compare the transfer-matrix probabilities and CMI with a brute-force state-vector calculation on an explicit chain (agreement to 1e-12), and check normalization and the vanishing CMI in the $Z$ and $X$ bases. CI runs them and a short version of both scripts on every push.

Generated CSV/PNG outputs are intentionally excluded from Git by .gitignore so that the repository stays code-focused.

Notes

The notebooks are exploratory research records rather than a stable Python package. The standalone scripts are the cleaner entry points for reproducible CMI calculations.

Citation

If this code is useful to you, please cite it using CITATION.cff.

About

This is my master thesis work.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages