Time evolution in the transverse field Ising model
#include <hydra/all.h>
intmain(){usingnamespacehydra;usingnamespacearma;intN=16;doubleJ=1.0;doubleH=1.0;doubleprecision=1e-12;// Create the transverse field ising HamiltonianBondListbonds;for(inti=0;i<N-1;++i){bonds<<Bond("ISING",J,{i,(i+1)%N});}cx_matsx(mat({{0.,0.5},{0.5,0.}}),mat({{0.,0.},{0.,0.}}));for(inti=0;i<N;++i){bonds<<Bond(sx,H,i);}// Create Hilbertspace without particle number conservationautoblock=Spinhalf(N);// Create all-up staring stateautov=zero_state(block);v.vector()(block.size()-1)=1.0;// Create magnetization operatorBondListmag;for(inti=0;i<N;++i){mag<<Bond("SZ",i);}// Do the time evolution with a step size taudoubletau=0.1;for(inti=0;i<100;++i){v=time_evolve(bonds,v,tau,precision);complexm=inner(mag,v);HydraPrint(m);}returnEXIT_SUCCESS;}