Official repository for the paper Riemannian optimization on low-rank tensor train manifolds for the Gross–Pitaevskii equation by Ivan Bioli, Carlo Marcati and Maxim Rakhuba.
- Ivan Bioli1,2 — ivan.bioli@unipv.it
- Carlo Marcati3 — carlo.marcati@univ-lyon1.fr
- Maxim Rakhuba4 — mrakuba@hse.ru
1 Dipartimento di Matematica, Università di Pavia, 27100 Pavia, Italy
2 Dipartimento di Ingegneria Civile e Architettura, Università di Pavia, 27100 Pavia, Italy
3 Université Lyon 1, Centrale Lyon, INSA Lyon, Université Jean Monnet, CNRS, ICJ UMR5208, 69622 Villeurbanne, France
4 HSE University, Faculty of Computer Science, 109028 Moscow, Russian Federation
This work is concerned with the numerical computation of Gross–Pitaevskii ground states using the tensor train (TT) format. We regard the problem as the minimization of the Gross–Pitaevskii energy functional under a unit mass constraint, and propose a first-order Riemannian optimization scheme that preserves both the mass constraint and the low-rank representation throughout the optimization, by operating on the manifold of unit-norm functions of fixed TT-rank. On this manifold, we derive the energy-adaptive Riemannian gradient and show how to compute it efficiently in the TT format. Spatial discretization is performed using a spectral method with numerical integration, which allows the required computations to be carried out efficiently while preserving the low-rank format. The method is shown to substantially reduce computational time compared to full-rank computations, while maintaining accuracy for both single- and multicomponent Gross–Pitaevskii equations.
The code minimizes the discretized Gross–Pitaevskii energy on the manifold of unit-norm functions of fixed TT rank with Riemannian gradient descent (R-GD) and Riemannian nonlinear conjugate gradient (R-NLCG), using the energy-adaptive (a_u) Riemannian gradient with the preconditioners of the paper, and compares it with the same methods on full tensors (a_u and H¹ Sobolev gradients). It is written in JAX (GPU, float64) on top of forks of ttax (TT arithmetic and automatic differentiation on the TT manifold), pymanopt (optimizers) and ttpy (cross approximation of the initial guess); the 1D spectral-element matrices and the high-order energy are assembled with FEniCSx.
This repository contains the code to reproduce every figure and table of the numerical experiments section of the paper (the experiment drivers and the analysis that produces the figures and tables) and the per-iteration logs of the runs reported in the paper.
If you find this work useful, please cite:
@misc{bioli2026riemannian,
title = {Riemannian optimization on low-rank tensor train manifolds for the {G}ross--{P}itaevskii equation},
author = {Bioli, Ivan and Marcati, Carlo and Rakhuba, Maxim},
year = {2026},
eprint = {2609.37103},
archivePrefix = {arXiv},
primaryClass = {math.NA},
doi = {10.48550/arXiv.2609.37103},
url = {https://arxiv.org/abs/2609.37103}
}Citation metadata is also available in CITATION.cff.
Requirements: Linux, an NVIDIA GPU with a CUDA 13 driver, conda, a Fortran compiler (installed by the environment file) and, optionally, a LaTeX installation (for the exact fonts of the figures).
git clone --recursive https://github.com/IvanBioli/TT_for_GPE.git
cd TT_for_GPE
conda env create -f environment.yml
conda activate ttgpe
pip install -e src/external/ttax
pip install -e src/external/pymanopt
pip install --no-build-isolation src/external/ttpy
unzip src/external/EXP_SUM/1_x_rel/Rel1_x_n.zip -d src/external/EXP_SUM/1_x_rel/Rel1_x_nIf you cloned without --recursive, run git submodule update --init --recursive
first. The environment pins the versions used for the paper (Python 3.11.13,
JAX 0.7.2 with CUDA 13, numpy 2.3.0, FEniCSx 0.9.0). Check the installation with
python -c "import jax; print(jax.devices())" # should list a CUDA devicepython -m pytest src/test -q # unit tests (~1 min on a GPU)
python src/run.py --smoke # every configuration, small size, 5 iterations
python src/experiments/analysis/analysis_new.py --smoke # figures and tables of the smoke runs
python src/experiments/analysis/analysis_new.py --source csv # figures and tables from data/arxiv_v1--smoke writes the results to results_smoke/ and the small versions of the
figures and tables to results_smoke/paper_figures/. --source csv produces the
paper's figures and tables in figures/arxiv_v1/ from the logs of the paper's
runs shipped in data/arxiv_v1 (no GPU needed).
src/run.py runs the experiments behind each figure or table; results are
pickled to results/ (or --results_dir, or $TTGPE_RESULTS_DIR) and existing
results are skipped. python src/experiments/analysis/analysis_new.py then
produces the figures and tables in results/paper_figures/ (--results_dir to
read another results directory). In the code, N is the
paper's n − 1 (N=399 is n=400); all runs use k=4 and float64.
| Paper item | Runs | Command | Outputs | Runtime |
|---|---|---|---|---|
Fig. 'R-GD vs R-NLCG' (fig:exp1_CGvsSD): 3D harmonic, N=399, S+V |
10 | python src/run.py --only exp1 |
exp1_CGvsSD_iters.pdf, exp1_CGvsSD_time.pdf |
8.5 h |
Tab. preconditioners (tab:exp2_precond): harmonic, N=399, R-NLCG |
12 (4 shared with exp1) | python src/run.py --only exp2 |
exp2_precond_table.tex |
+2.8 h |
Fig. full vs TT, harmonic (fig:exp3_fullvsTT): N=399, 799 |
8 (5 shared with exp1) | python src/run.py --only exp3 |
exp3_harmonic_N{399,799}_k4_time_shared.pdf |
+0.04 h |
Fig. lattice potential (fig:exp4_lattice): N=399, 799 |
8 | python src/run.py --only exp4 |
exp4_lattice_N{399,799}_k4_time_shared.pdf |
4.1 h |
Fig. Anderson localization (fig:exp5_anderson): 2D, N=1599, 3199, 6399 |
21 | python src/run.py --only exp5 |
exp5_anderson_k4_N{1599,3199,6399}_k4_time_shared.pdf |
11.7 h |
Fig. multicomponent (fig:exp9_multicomponent): 2D, p=3, N=1023, 2047 |
10 | python src/run.py --only exp9 |
exp9_multicomponent_k4_N{1023,2047}_k4_time_shared.pdf |
0.5 h |
Tab. multicomponent R-GD vs R-NLCG (tab:exp9_multicomponent): N=2047 |
10 (5 shared with exp9) | python src/run.py --only tab9 |
exp9_multicomponent_CGvsSD_table.tex |
+0.7 h |
| Reference energy E* of the multicomponent figure: N=4095 | 5 | python src/run.py --only ref9 |
(used by exp9) | 2.4 h |
python src/run.py runs all 70 distinct runs (about 30 h on an RTX 4090);
--dry_run prints the commands. Each run can also be started directly, e.g.
python src/experiments/paper/paperexp_harmonic.py --method tt --N 399 --k 4 --dim 3 --beta 1000 \
--pymanopt_optimizer ConjugateGradient --precond S+V --tt_rank 10 --max_tt_rank_u2 10The runtimes above are approximate wall times on an RTX 4090, including the per-iteration evaluation of the high-order energy used for the plots; two runs stop at the 4 h time limit (R-GD with the full H¹ gradient at N=399, and the full H¹ run at N=6399 for the Anderson potential).
All runs of the paper used a single NVIDIA RTX 4090 (24 GB) in float64. The full-format runs are dominated by the per-iteration evaluation of the high-order energy used only for logging (about 131 s per iteration for the 3D problems at N=399); the plotted times exclude logging.
Peak memory of R-NLCG runs with the S+V preconditioner, measured on an RTX 4090
(XLA_PYTHON_CLIENT_PREALLOCATE=false):
| Problem | Method | Peak GPU memory | Peak host memory |
|---|---|---|---|
| harmonic 3D, N=399 | TT, rank 10 | 0.6 GB | 2.2 GB |
| harmonic 3D, N=399 | full a_u | 9.7 GB | 25.7 GB |
| multicomponent 2D, N=1023 | TT, rank 10 | 0.6 GB | 3.1 GB |
| multicomponent 2D, N=1023 | full a_u | 0.5 GB | 2.5 GB |
The full-format 3D runs need about 26 GB of host memory.
data/arxiv_v1/ contains the logs of the 70 runs of src/run.py reported in the
paper: for each run, a CSV file with the per-iteration log (cost,
gradient_norm, step_size, time, alpha, log_time, lmd, E_exact,
cg_iters where applicable) and a run.json summary (stopping criterion,
iterations, time, optimizer settings), in the folder layout written by the
experiment scripts. src/experiments/analysis/export_logs.py writes the same
format for new results.
src/run.py experiment driver (one item per figure/table)
src/core/ energy functionals, Riemannian gradients, manifolds, TT utilities
src/experiments/experiment_run.py command-line interface of the experiment scripts
src/experiments/experiment_setup.py problem setup, optimizers, logging, result files
src/experiments/paper/ one script per problem (harmonic, lattice, Anderson, multicomponent)
src/experiments/analysis/ figures/tables (analysis_new.py) and CSV export (export_logs.py)
src/test/ unit tests
src/external/ forks of pymanopt, ttpy, ttax and the EXP_SUM tables (submodules)
data/arxiv_v1/ per-iteration logs of the paper's runs
docs/forks.md changes made in the forks and pinned versions
The code uses forks of pymanopt, ttpy and ttax with small changes (logging
hooks, deterministic cross approximation, delta-format gradients); the pinned
commits and every change are documented in docs/forks.md.
The exponential-sum tables of the TT preconditioner come from
EXP_SUM by W. Hackbusch, which is
third-party, not redistributed here and has to be cited separately
(W. Hackbusch, Computation of best L∞ exponential sums for 1/x by Remez'
algorithm, Comput. Vis. Sci. 20 (2019)).
The code in this repository is released under the Apache License 2.0 (see
LICENSE and NOTICE). The submodules keep their own
licenses (pymanopt: BSD 3-Clause; ttpy and ttax: MIT; EXP_SUM: no license).