SunnySuite / Sunny.jl

Spin dynamics and generalization to SU(N) coherent states
Other
79 stars 19 forks source link

Sparse Hamiltonian matrix-vector multiply functions #201

Closed ddahlbom closed 9 months ago

ddahlbom commented 9 months ago

1) The sys in an SU(N) SpinWaveTheory is now transformed directly instead of allocating and storing a bunch of rotated operators in SWTDataSUN. In particular, all interactions are converted into general interactions (tensor decomposition), and the scalar, bilin, biquad fields of a PairCoupling are set to zero. The operators in the tensor decomposition are then transformed into the local reference frames directly in the interactions_union of the sys.

2) The index corresponding to the condensed boson has been shifted from 1 to N. (This simplifies indexing somewhat.)

3) The functions multiply_by_hamiltonian_dipole! and multiply_by_hamiltonian_SUN! have been added. These multiply a given vector by the Hamiltonian without first constructing a dense Hamiltonian matrix. This takes advantage of sparsity. Both functions demonstrate linear scaling with the number of atoms in the magnetic supercell.

4) reshapes are used to take advantage of Julia's indexing facilities (instead of manual index offsets).