Skip to content

Repository files navigation

CheMPS — Chebyshev Matrix Product State Spectral Functions

Implementation of the Chebyshev MPS (CheMPS) method for computing zero-temperature spectral functions of one-dimensional quantum lattice models, following Holzner et al., Phys. Rev. B 83, 195115 (2011).

Built on top of QuantumLiquids/UltraDMRG (qlten + qlmps libraries).

Method

CheMPS expands spectral functions in Chebyshev polynomials:

$$\mathcal{A}^{BC}(\omega) = \frac{1}{\pi\sqrt{1-\omega'^2}} \left[ g_0 \mu_0 + 2 \sum_{n=1}^{N-1} g_n \mu_n T_n(\omega') \right]$$

where $\mu_n = \langle 0 | \hat{B} | t_n \rangle$ are Chebyshev moments obtained from recursively generated MPS vectors:

$$|t_0\rangle = \hat{C}|0\rangle, \quad |t_1\rangle = \hat{H}'|t_0\rangle, \quad |t_n\rangle = 2\hat{H}'|t_{n-1}\rangle - |t_{n-2}\rangle$$

Each iteration involves:

  1. Variational fitting — compress the target state into a bounded-$D$ MPS via two-site sweeping
  2. Energy truncation — Krylov-based projection to remove high-energy leakage (single-site sweep)
  3. Moment measurement — compute $\mu_n = \langle \text{gs}|A|t_n\rangle$ and append to JSON output

Build

Dependencies: QuantumLiquids/UltraDMRG (qlten + qlmps), Intel MKL, MPI, HPTT.

mkdir -p build && cd build
cmake .. \
  -DCMAKE_CXX_COMPILER=icpx \
  -DCMAKE_PREFIX_PATH="/path/to/TensorToolkit;/path/to/TensorToolkit/include;/path/to/UltraDMRG/include" \
  -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)

MPI Parallel Execution

CheMPS supports MPI parallelization for the fitting and energy truncation phases. The master (rank 0) orchestrates the iteration loop while slaves compute tensor contractions in parallel.

# Run MPI iteration test: L=24 chain, 10 Chebyshev moments, 4 MPI ranks
cd build
mpirun -np 4 ./test_iteration_mpi 24 9

# Run MPI energy truncation test
mpirun -np 2 ./test_etrunc_mpi 6

When to use MPI: MPI parallelization pays off at large bond dimensions (Dmax >= 128) where tensor contractions dominate. For small Dmax (e.g. 32), serial execution is faster due to MPI communication overhead.

Quick Start: Heisenberg Chain Spectral Function

Compute the spin structure factor $S(k, \omega)$ for the spin-1/2 Heisenberg antiferromagnet:

cd build

# Run: L=24, N=100 moments, D=32, k_index=12 (k ~ pi/2)
mpirun -np 1 ./test_spectral 24 100 32 12

# Plot the spectral function
cd ..
python3 -m venv .venv && source .venv/bin/activate
pip install numpy matplotlib
python3 plot_spectral.py build/chemps_moment.json build/chemps_meta.json

Resuming from checkpoint

CheMPS supports resuming iterations from any starting point, which allows changing bond dimension or accumulating more moments incrementally:

# First run: compute 50 moments with D=32
mpirun -np 1 ./test_spectral 24 50 32 12

# Continue: add 50 more moments (n=50..99) with 3 fitting sweeps for speed
mpirun -np 1 ./test_spectral 24 100 32 12 50 3

test_spectral usage

mpirun -np 1 ./test_spectral [L] [N_moments] [Dmax] [k_index] [n_start] [fitting_sweeps]
Argument Default Description
L 20 Chain length
N_moments 50 Total number of Chebyshev moments (n_end = N_moments - 1)
Dmax 32 Maximum MPS bond dimension for fitting
k_index 1 Wave number index: $k = \pi \cdot k_\text{index} / (L+1)$ for OBC
n_start 0 Starting iteration (0 = fresh run with VMPS, >0 = resume)
fitting_sweeps 5 Number of variational fitting sweeps per iteration

Output files

File Description
chemps_moment.json Chebyshev moments $\mu_n$ (appended incrementally)
chemps_meta.json Rescaling parameters ($a$, $W'$, $E_0$, $k$, etc.)
spectral_function.pdf/png Reconstructed spectral function (from plot_spectral.py)

Project Structure

include/chemps/              Core CheMPS library (header-only, serial)
  chemps_iteration.h           Top-level iteration loop + moment measurement
  chemps_compress.h            Variational compression (two-site fitting)
  chemps_energy_truncation.h   Krylov energy truncation (single-site)
  chemps_sweeping_params.h     Parameter structs
  chemps_sweep_io.h            Disk I/O for tensor management
  chemps_utils.h               Utility functions
include/chemps_mpi/          MPI-parallelized CheMPS (header-only)
  chemps_mpi_iteration.h      MPI iteration loop (master) + slave state machine
  chemps_mpi_order.h           MPI order enum and broadcast helpers
  fitting_mpi_executor.h       Master-side fitting sweep orchestration
  fitting_env_update_master.h  Master-side bra≠ket env growth (4 variants)
  fitting_env_update_slave.h   Slave-side bra≠ket env growth
  fitting_target_contraction_slave.h  Slave-side target tensor contraction
  etrunc_mpi_executor.h       Master-side energy truncation sweep
  etrunc_mpi_lanczos_slave.h   Slave-side Lanczos for energy truncation
models/                      Model definitions (Heisenberg, spectral operators)
tests/                       Test executables
  test_spectral.cpp            Full spectral function calculation
  test_iteration.cpp           Integration test (serial)
  test_iteration_mpi.cpp       Integration test (MPI)
  test_etrunc_mpi.cpp          Energy truncation test (MPI)
  test_fitting.cpp             Variational fitting smoke test
plot_spectral.py             Python script for spectral reconstruction + plotting

Key Parameters (Table I of arXiv:1101.5895)

Parameter Recommended Description
$W_*$ $2W_\mathcal{A}$ Effective bandwidth
$\epsilon_t$ 0.025 Safety factor for rescaled half-bandwidth
$d_K$ 30 Krylov subspace dimension
$n_S$ 10 Number of energy truncation sweeps
$\varepsilon_P$ 1.0 Energy truncation threshold
$g_n$ Jackson Damping factors for spectral reconstruction

License

LGPL-3.0-only

About

CheMPS algorithm based on UltraDMRG

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages