This repository contains code to reproduce the anticoncentration results in the paper Park, Casares, Arrazola, and Huh: "The hardness of quantum spin dynamics." The paper presents the anticoncentration property for the dynamics generated by the XX and the Ising Hamiltonians. This repository provides the C++ and Python codes used to obtain those results.
The repository contains C++ and Python code, with proper Python binding for some C++ functions. We recommend using a Python virtual environment to run our code. After cloning the repository, one can use the following commands to install the Python binding.
$ python3 -m venv env # create virtual env
$ source ./env/bin/activate # activate virtual env
$ pip install . # install Python binding
For building C++ code, the following commands should work. We note that Eigen and OpenBLAS are required to compile to code. A compiler with proper C++20 support (e.g., GCC >= 10) is also required to compile the code correctly.
$ mkdir Build && cd Build
$ cmake ..
$ make
See also Kokkos compile guide for supported backends.
For src/xx_time_evol_exact.cpp
and python_src/xx_time_evol_exact.py
are used.
The C++ code src/xx_time_evol_exact.cpp
diagonalizes the constructed Hamiltonian using Eigen, whereas Python code python_src/xx_time_evol_exact.py
utilizes JAX. Thus, our Python code is GPU enabled, which is significantly faster for larger
For src/xx_time_evol_trotter.cpp
. Our code is based on PennyLane-Lightning-Kokkos. We ran our code using NVidia A100, compiled with the CUDA backend of Kokkos.
For computing the output probability at times multiples of log of src/xx_at_log_time_trotter.cpp
is used.
For the Ising model, the dynamics can be simulated solely by the IsingXX gates. C++ source code src/ising_time_evol.cpp
and src/ising_at_log_time.cpp
are used for the time evolution and for recording the output distribution at specific times, respectively.