Dear ITensor team,
Thanks for you reply. I want to follow spin-1 Heisenberg chain(see S.R.White PhysRevB.48.10345 Fig.7(b)) by using ITensor, but I just want to calculate Sz=1 sector physical quantity(such as magnetization). I don't know where I can modified. I have two naive idea to do so:
1) Just keep initial state Sz=1 and they not change under evolving process.
2) auto sites = SpinOne(N,{"ConserveQNs=1",true});?(I don't know it is work?)
Please help me! For convenience, this is my naive code for reference:
int main()
{
ofstream outfile;
outfile.open("sz.dat",ios::app);
//Define a site set object "sites" which lets us
//easily obtain Site indices defining our Hilbert space
//and S=1 single-site operators
int N = 60; //number of sites
auto sites = SpinOne(N,{"ConserveQNs=",true});
//Make initial MPS psi to be in the Neel state
auto state = InitState(sites);
auto ampo = AutoMPO(sites);
for(auto j : range1(N))
{
state.set(j,j%2==1?"Up":"Dn");
}
auto psi = MPS(state);
for(int b = 1; b < N; ++b)
{
ampo += 0.5,"S+",b,"S-",b+1;
ampo += 0.5,"S-",b,"S+",b+1;
ampo += "Sz",b,"Sz",b+1;
}
auto H = MPO(ampo);
auto sweeps = Sweeps(30);
sweeps.maxm() = 100,200,800,800,1000;
sweeps.cutoff() = 1E-10;
sweeps.niter() = 2;
sweeps.noise() = 1E-7,1E-8,1E-9;
println(sweeps);
//
// Begin the DMRG calculation
//
auto energy = dmrg(psi,H,sweeps,"Quiet");
println(energy);
auto psi0=psi;
for(int i = 1; i <= N; ++i)
{
auto Sz=op(sites,"Sz",i);
auto newpsi = Sz*psi(i);
newpsi.noPrime();
psi.set(i,newpsi);
outfile <<i<<" "<<real(innerC(psi0,psi))<< endl;
}
outfile.close();
return 0;
}