Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenvd committed Mar 4, 2022
1 parent a360b43 commit 548df37
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions docs/src/tut/anyonic_statmech.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ init = InfiniteMPS([physical],[virtual]);

and then pass it on to "leading_boundary":
```julia
(dominant,_) = leading_boundary(init,mpo,Vumps());
(dominant,_) = leading_boundary(init,mpo,VUMPS());
```

This dominant eigenvector contains a lot of hidden information, for example the following calculates the free energy:
Expand Down Expand Up @@ -55,7 +55,7 @@ envs = environments(dominant,mpo);
#this will take a fairly long time
for Ds in 5:5:50
(dominant,envs) = changebonds(dominant,mpo,OptimalExpand(trscheme = truncdim(5)),envs);
(dominant,envs) = leading_boundary(dominant,mpo,Vumps(maxiter=200));
(dominant,envs) = leading_boundary(dominant,mpo,VUMPS(maxiter=200));
push!(entropies,real(entropy(dominant)[1]));
push!(corlens,correlation_length(dominant));
end
Expand Down
4 changes: 2 additions & 2 deletions docs/src/tut/haldane.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ physical_space = Rep[SU₂](1=>1);
virtual_space = Rep[SU₂](0=>20,1=>20,2=>10,3=>10,4=>5);

initial_state = FiniteMPS(rand,ComplexF64,len,physical_space,virtual_space);
(gs,envs,delta) = find_groundstate(initial_state,ham,Dmrg());
(gs,envs,delta) = find_groundstate(initial_state,ham,DMRG());
```

The typical way to find excited states is to minmize the energy while adding an error term ``lambda | gs > < gs | ``. Here we will instead use the [quasiparticle ansatz](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.111.080401).
Expand Down Expand Up @@ -53,7 +53,7 @@ A much nicer way of obtaining the haldane gap is by working directly in the ther
```julia
virtual_space = Rep[SU₂](1//2=>20,3//2=>20,5//2=>10,7//2=>10,9//2=>5); # this is bond dimension 300!
initial_state = InfiniteMPS([physical_space],[virtual_space]);
(gs,envs,delta) = find_groundstate(initial_state,ham,Vumps());
(gs,envs,delta) = find_groundstate(initial_state,ham,VUMPS());
```

One difference with the finite size case is that we not only can - but also have to - specify a momentum label. We can scan for k = 0 to pi by calling:
Expand Down
2 changes: 1 addition & 1 deletion docs/src/tut/isingcft.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ ham = periodic_boundary_conditions(nonsym_ising_ham(),circumference);

state = FiniteMPS(circumference,ℂ^2,ℂ^50 #=bond dimension=#);

(gs,envs) = find_groundstate(state,ham,Dmrg());
(gs,envs) = find_groundstate(state,ham,DMRG());
```

Excitations on top of the groundstate can be found using the quasiparticle ansatz. This returns quasiparticle states, which you can just convert back to the usual finite mps's.
Expand Down
8 changes: 4 additions & 4 deletions docs/src/tut/timeev.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ init = FiniteMPS(rand,ComplexF64,len,ℂ^2,ℂ^10);

Find the pre-quench groundstate
```julia
(ψ₀,_) = find_groundstate(init,ising_ham(0.5),Dmrg());
(ψ₀,_) = find_groundstate(init,ising_ham(0.5),DMRG());
```

We can define a help function that measures the loschmith echo
Expand All @@ -51,7 +51,7 @@ we will initially use a 2site tdvp scheme to increase the bond dimension while t
ψₜ = deepcopy(ψ₀);
dt = 0.01;

(ψₜ,envs) = timestep(ψₜ,ising_ham(2),dt,Tdvp2(trscheme=truncdim(20)));
(ψₜ,envs) = timestep(ψₜ,ising_ham(2),dt,TDVP2(trscheme=truncdim(20)));
```

"envs" is a kind of cache object that keeps track of all environments in ψ. It is often advantageous to re-use the environment, so that mpskit doesn't need to recalculate everything.
Expand All @@ -60,7 +60,7 @@ Putting it all together, we get
```julia
function finite_sim(len; dt = 0.05, finaltime = 5.0)
ψ₀ = FiniteMPS(rand,ComplexF64,len,ℂ^2,ℂ^10);
(ψ₀,_) = find_groundstate(ψ₀,ising_ham(0.5),Dmrg());
(ψ₀,_) = find_groundstate(ψ₀,ising_ham(0.5),DMRG());

post_quench_ham = ising_ham(2);
ψₜ = deepcopy(ψ₀);
Expand All @@ -70,7 +70,7 @@ function finite_sim(len; dt = 0.05, finaltime = 5.0)
times = collect(0:dt:finaltime);

@showprogress for t = times[2:end]
alg = t > 3*dt ? Tdvp() : Tdvp2(trscheme = truncdim(50))
alg = t > 3*dt ? TDVP() : TDVP2(trscheme = truncdim(50))
(ψₜ,envs) = timestep(ψₜ,post_quench_ham,dt,alg,envs);
push!(echos,echo(ψₜ,ψ₀))
end
Expand Down
8 changes: 4 additions & 4 deletions docs/src/tut/xxz_groundstate.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ state = InfiniteMPS([random_data]);

The groundstate can then be found by calling find_groundstate.
```julia
(groundstate,cache,delta) = find_groundstate(state,ham,Vumps());
(groundstate,cache,delta) = find_groundstate(state,ham,VUMPS());
```

As you can see, vumps strugles to converge. On it's own, that is already quite curious.
Expand Down Expand Up @@ -62,12 +62,12 @@ ham = repeat(ham,2);

Running vumps
```julia
(groundstate,cache,delta) = find_groundstate(state,ham,Vumps(maxiter=100,tol_galerkin=1e-12));
(groundstate,cache,delta) = find_groundstate(state,ham,VUMPS(maxiter=100,tol_galerkin=1e-12));
```
we get convergence, but it takes an enormous amount of iterations. The reason behind this becomes more obvious at higher bond dimensions

```julia
(groundstate,cache,delta) = find_groundstate(state,ham,Idmrg2(trscheme=truncdim(100),maxiter=100,tol_galerkin=1e-12));
(groundstate,cache,delta) = find_groundstate(state,ham,IDMRG2(trscheme=truncdim(100),maxiter=100,tol_galerkin=1e-12));

entanglementplot(groundstate)
```
Expand Down Expand Up @@ -105,5 +105,5 @@ Even though the bond dimension is higher then in the non symmetric example:

Vumps converges much much faster
```julia
(groundstate,cache,delta) = find_groundstate(state,ham,Vumps(maxiter=400,tol_galerkin=1e-12));
(groundstate,cache,delta) = find_groundstate(state,ham,VUMPS(maxiter=400,tol_galerkin=1e-12));
```

2 comments on commit 548df37

@maartenvd
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/55965

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.7.0 -m "<description of version>" 548df375659feb9028577246745ca5fc19a00947
git push origin v0.7.0

Please sign in to comment.