-
Notifications
You must be signed in to change notification settings - Fork 11
/
pdmrg.cc
46 lines (38 loc) · 1 KB
/
pdmrg.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "parallel_dmrg.h"
#include "itensor/all.h"
using namespace itensor;
int
main(int argc, char* argv[])
{
Environment env(argc,argv);
parallelDebugWait(env);
int N = 100;
SpinOne sites;
MPO H;
MPS psi;
Sweeps sweeps;
if(env.firstNode())
{
sites = SpinOne(N); //make a chain of N spin 1's
auto ampo = AutoMPO(sites);
for(int j = 1; j < N; ++j)
{
ampo += 0.5,"S+",j,"S-",j+1;
ampo += 0.5,"S-",j,"S+",j+1;
ampo += "Sz",j,"Sz",j+1;
}
H = MPO(ampo);
auto state = InitState(sites);
for(auto n : range1(N)) state.set(n,n%2==1?"Up":"Dn");
psi = MPS(state);
psi.normalize();
sweeps = Sweeps(5);
sweeps.maxdim() = 10,20,100,100,200;
sweeps.cutoff() = 1E-10;
sweeps.niter() = 2;
println(sweeps);
}
env.broadcast(sites,H,psi,sweeps);
parallel_dmrg(env,psi,H,sweeps,"Quiet");
return 0;
}