From diagham
Jump to navigation Jump to search

SpinChainMultipleComputeS2 computes the total <math>S^2</math> of a series of eigenstates stored in a binary matrix. For example, if we generate all the eigenstates of the periodic AKLT spin chain with 12 sites at momentum <math>k=0</math> and total spin projection <math>S_z=0</math> using PeriodicSpinChainAKLT the following way

$PATHTODIAGHAM/build/Spin/src/Programs/PeriodicSpinChainAKLT -p 12 --all-eigenstates --full-diag 10000 --use-lapack --momentum 1 --initial-sz 0 --nbr-sz 1

This will create two binary matrices spin_1_periodicaklt_n_12_sz_0_szsym_-1_k_1.eigenvec.mat and spin_1_periodicaklt_n_12_sz_0_szsym_1_k_1.eigenvec.mat (one for each sector of the symmetry <math>S_z\leftrightarrow -S_z</math>) and one spectrum file spin_1_periodicaklt_n_12.dat. If we want to compute all the <math>S^2</math> in the sector <math>k=0</math> <math>S_z=0</math> and <math>S_{z,{\rm sym}}=-1</math>, we need the command line

$PATHTODIAGHAM/build/Spin/src/Programs/SpinChainMultipleComputeS2 -S --processors 2 --spectrum spin_1_periodicaklt_n_12.dat -c --multiple-states spin_1_periodicaklt_n_12_sz_0_szsym_-1_k_1.eigenvec.mat

Note that we use the -c option since the matrix spin_1_periodicaklt_n_12_sz_0_szsym_-1_k_1.eigenvec.mat is complex. Such an option is not needed when the momentum is 0 or <math>\pi</math> because the eigenstate matrix is real.

SpinChainMultipleComputeS2 can also export the eigenstates sorted by their S value. In that case, we just need to add the --export-eigenstate option

$PATHTODIAGHAM/build/Spin/src/Programs/SpinChainMultipleComputeS2 -S --processors 2 --spectrum spin_1_periodicaklt_n_12.dat -c --export-eigenstate --multiple-states spin_1_periodicaklt_n_12_sz_0_szsym_-1_k_1.eigenvec.mat

This will create a binary file another eigenstate matrix spin_1_periodicaklt_n_12_sz_0_szsym_-1_k_1.eigenvec.s2sorted.mat with eigenstates sorted by their S value.