# SpinChainMultipleComputeS2

SpinChainMultipleComputeS2 computes the total $S^2$ 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 $k=0$ and total spin projection $S_z=0$ 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 $S_z\leftrightarrow -S_z$) and one spectrum file spin_1_periodicaklt_n_12.dat. If we want to compute all the $S^2$ in the sector $k=0$ $S_z=0$ and $S_{z,{\rm sym}}=-1$, 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 $\pi$ because the eigenstate matrix is real.