We present a GPU implementation of the finite-temperature Lanczos method (FTLM) for Heisenberg spin Hamiltonians that targets workstation hardware rather than distributed-memory clusters. The Hamiltonian action is evaluated matrix-free in a row-wise gather formulation. We introduce and compare two state-to-index strategies: a compressed lookup table (CLT), which reduces lookup memory by a factor of 16 relative to a full table while retaining a fixed, branch-light access pattern, and a GPU-adapted combinatorial-ranking scheme that removes the lookup table altogether. Numerical tests against FP64 CPU references show that FP32 GPU arithmetic changes heat capacities and magnetic susceptibilities by amounts several orders of magnitude below the stochastic uncertainty of the FTLM trace estimator at typical sample sizes. Benchmarks show speedups of up to about one order of magnitude over optimized multicore CPU calculations and enable Hilbert-space sectors of dimension ~10^8 on a single workstation GPU. The MATLAB/CUDA implementation, including example input files and benchmark scripts, is openly available at https://github.com/ghasdeke/ftlm-gpu (archived at DOI: 10.5281/zenodo.20378647) under the Apache-2.0 license.
We present a GPU implementation of the finite-temperature Lanczos method (FTLM) for Heisenberg spin Hamiltonians that targets workstation hardware rather than distributed-memory clusters. The Hamiltonian action is evaluated matrix-free in a row-wise gather formulation. We introduce and compare two state-to-index strategies: a compressed lookup table (CLT), which reduces lookup memory by a factor of 16 relative to a full table while retaining a fixed, branch-light access pattern, and a GPU-adapted combinatorial-ranking scheme that removes the lookup table altogether. Numerical tests against FP64 CPU references show that FP32 GPU arithmetic changes heat capacities and magnetic susceptibilities by amounts several orders of magnitude below the stochastic uncertainty of the FTLM trace estimator at typical sample sizes. Benchmarks show speedups of up to about one order of magnitude over optimized multicore CPU calculations and enable Hilbert-space sectors of dimension ~10^8 on a single workstation GPU. The MATLAB/CUDA implementation, including example input files and benchmark scripts, is openly available at https://github.com/ghasdeke/ftlm-gpu (archived at DOI: 10.5281/zenodo.20378647) under the Apache-2.0 license.
We extend a recent GPU implementation of the finite-temperature Lanczos method (FTLM) for Heisenberg spin Hamiltonians, which uses only total-magnetization symmetry, to the full permutation symmetry, including non-Abelian point and space groups. For highly symmetric clusters such as icosahedral polyhedra, the multidimensional irreducible representations (irreps) of the permutation group reduce the block dimensions substantially further than any Abelian subgroup. Here, we provide a matrix-free formalism (avoiding explicit storage of the projected Hamiltonian) for using such symmetries. The implementation applies equally to Abelian groups, retaining the advantages of GPU acceleration. Several cluster topologies are built in; beyond these, symmetry groups can be supplied as site-permutation generators, with irrep matrices computed automatically, so that user-defined clusters run without any code changes. We demonstrate the approach in production runs on a single NVIDIA B200 accelerator for the s=3/2 Heisenberg antiferromagnet on the dodecahedron (Hilbert-space dimension 4^20 ~ 1.1x10^12) and for the s=1/2 square lattice of 5x8 sites (M=0 dimension 1.4x10^11). With R=24 random vectors per symmetry block and 60 Lanczos steps, the dodecahedron campaign (with the largest iterated symmetry block having a dimension of 3.6x10^9) requires about 50 GPU-hours. The code is openly available under the Apache-2.0 license at https://github.com/ghasdeke/ftlm-pg-gpu, archived at DOI: 10.5281/zenodo.21445872.
Magnetic molecules promise progress in a wide variety of fields ranging from high density memory storage to quantum computing as well as magnetic cooling. In order to gain better insight this work aims at the study of theoretical models and evaluation of thermodynamic observables by implementing and testing a new numerical approximation method - the Finite-Temperature Lanczos-Method (FTLM). Magnetic centres of molecules are modelled as spins of fixed quantum number, position and interactions. The model is specified in a spin Hamiltonian consisting of three parts: Heisenberg exchange, single ion anisotropy and Zeeman interaction. Although finite, the dimension of the Hilbert space grows exponentially with the number of spin sites, so full diagonalisation of the Hamiltonian is rendered infeasible: Even for a small number of spins the Hilbert space dimension exceeds several millions, which is beyond exact diagonalisation techniques. In order to calculate observables yet, it is necessary to implement approximation methods. Following previous work, where the Hilbert space could be partitioned into invariant subspaces with respect to magnetic quantum numbers, now systems with anisotropy are studied. These anisotropic terms generally do not commute with total spin operators, therefore partitioning no longer helps reducing the problem size. There are several techniques for approximate solutions to eigenvalue equations, among these adaptations of the original Lanczos method. As a Krylov subspace method, its main advantage is that the most complex operations required are matrix-vector multiplications. When matrix elements are calculated on-the-fly, the most economical version requires storage of only two vectors. The second ingredient for FTLM is a typicality based Monte Carlo approach: Traces are estimated as an average over a tiny set of initial vectors compared to the full Hilbert space. First tests revealed a major flaw due to numerical instability of traces that normally are zero. By partitioning with respect to magnetic quantum numbers, especially exploiting their inversion symmetry, this problem was unknowingly dodged in previous calculations. It was solved while preserving the advantage of minimal computational effort: An arbitrary set of initial vectors would regain this time-reversal symmetry only, if a substantial number of initial vectors where used. Instead, a doubling of the initial vectors by inverting them with respect to magnetic quantum numbers yields the desired effect. Time-consuming evaluations of matrix elements were also avoided by calculating the magnetisation as a difference quotient. Finally FTLM is implemented and tested for several magnetic molecules. Analogues of the hour glass molecules synthesised by Glaser et al. were first model systems, showing good agreement of exact diagonalisation results and approximations. The method can be applied to any Hamiltonian, given that matrix-vector products in the underlying Hilbert space can be calculated. Here limiting factors are memory usage and computing time. As a proof of principle observables in a Hilbert space consisting of d=100,000,000 states were calculated using the parameter set suggested by Mazurenko et al. for the Mn12-acetate molecule. Single crystal as well as powder averaged results are compared to experimental data. So this previously impossible calculation is now executed within hours by use of FTLM.
We introduce a GPU-accelerated multigrid Gaussian-Plane-Wave density fitting (FFTDF) approach for efficient Fock builds and nuclear gradient evaluations within Kohn-Sham density functional theory, as implemented in the GPU4PySCF module of PySCF. Our CUDA kernels employ a grid-based parallelization strategy for contracting Gaussian basis function pairs and achieve up to 80% of the FP64 peak performance on NVIDIA GPUs, with no loss of efficiency for high angular momentum (up to f-shell) functions. Benchmark calculations on molecules and solids with up to 1536 atoms and 20480 basis functions show up to 25x speedup on an H100 GPU relative to the CPU implementation on a 28-core shared memory node. For a 256-water cluster, the ground-state energy and nuclear gradients can be computed in ~30 seconds on a single H100 GPU. This implementation serves as an open-source foundation for many applications, such as ab initio molecular dynamics and high-throughput calculations.
The coupled cluster (CC) ansatz is generally recognized as providing one of the best wave function-based descriptions of electronic correlation in small- and medium-sized molecules. The fact that the CC equations with double excitations (CCD) may be expressed as a handful of dense matrix-matrix multiplications makes it an ideal method to be ported to graphics processing units (GPUs). We present our implementation of the spin-free CCD equations in which the entire iterative procedure is evaluated on the GPU. The GPU-accelerated algorithm readily achieves a factor of 4-5 speedup relative to the multithreaded CPU algorithm on same-generation hardware. The GPU-accelerated algorithm is approximately 8-12 times faster than Molpro, 17-22 times faster than NWChem, and 21-29 times faster than GAMESS for each CC iteration. Single-precision GPU-accelerated computations are also performed, leading to an additional doubling of performance. Single-precision errors in the energy are typically on the order of 10(-6) hartrees and can be improved by about an order of magnitude by performing one additional iteration in double precision.
We release a set of GPU programs for the study of the Quantum (S=1/2) Spin Glass on a square lattice, with binary couplings. The library contains two main codes: MCQSG (that carries out Monte Carlo simulations using both the Metropolis and the Parallel Tempering algorithms, for the problem formulated in the Trotter-Suzuki approximation), and EDQSG (that obtains the extremal eigenvalues of the Transfer Matrix using the Lanczos algorithm). EDQSG has allowed us to diagonalize transfer matrices with size up to 236×236. From its side, MCQSG running on four NVIDIA A100 cards delivers a sub-picosecond time per spin-update, a performance that is competitive with dedicated hardware. We include as well in our library GPU programs for the analysis of the spin configurations generated by MCQSG. Finally, we provide two auxiliary codes: the first generates the lookup tables employed by the random number generator of MCQSG; the second one simplifies the execution of multiple runs using different input data. Program Title: QISG Suite CPC Library link to program files: https://doi.org/10.17632/g97sn2t8z2.1 Licensing provisions: MIT Programming language: CUDA-C Nature of problem: The critical properties of quantum disordered systems are known only in a few, simple, cases whereas there is a growing interest in gaining a better understanding of their behaviour due to the potential application of quantum annealing techniques for solving optimization problems. In this context, we provide a suite of codes, that we have recently developed, to the purpose of studying the 2D Quantum Ising Spin Glass. Solution method: We provide a highly tuned multi-GPU code for the Montecarlo simulation of the 2D QISG based on a combination of Metropolis and Parallel Tempering algorithms. Moreover, we provide a code for the evaluation of the eigenvalues of the transfer matrix of the 2D QISG for size up to L=6. The eigenvalues are computed by using the classic Lanczos algorithm that, however, relies on a custom multi-GPU-CPU matrix-vector product that speeds-up dramatically the execution of the algorithm.
The finite temperature Lanczos method (FTLM), which is an exact diagonalization method intensively used in quantum many-body calculations, is formulated in the framework of orthogonal polynomials and Gauss quadrature. The main idea is to reduce finite temperature static and dynamic quantities into weighted summations related to one- and two-dimensional Gauss quadratures. Then lower order Gauss quadrature, which is generated from Lanczos iteration, can be applied to approximate the initial weighted summation. This framework fills the conceptual gap between FTLM and kernel polynomial method, and makes it easy to apply orthogonal polynomial techniques in the FTLM calculation.