This is a julia package about basic implementation of iPEPS, including optimization of the ground-state and excited-state. We use CTMRG contraction algorithm, and use autodiff to solve the gradient. More details refer to the SciPost Phys. 12, 006 (2022)
To install, type ] in a julia (>=1.5) REPL and then input
pkg> add https://github.com/yitan1/iPEPS.jl.git
First, we need to optimize the ground state:
# example_gs.jl
using iPEPS
# H = [Hh, Hv], Hh = -Sx*Sx - h*Sz, default: h =2
H = ising()
# bond dimension D
D = 2
# physical dimension d matching the Hamiltonian dimension
d = 2 # for spin 1/2
# initial states
A = randn(D,D,D,D,d)
# optim ground state
res = optim_gs(H, A, "config.toml")Run the script, then it will generate file to directory ./similation/***/gs.jld2, where *** is dependent to config.toml as following.
Next we will use the ground state to optimize excited state:
#example_es.jl
using iPEPS
H = ising()
# construct basis
prepare_basis(H, "config.toml")
# construct momentum path
# default: M(pi,0) -> X(pi,pi) -> S(pi/2,pi/2) -> Gamma(0,0) -> M(pi,0) -> S(pi/2,pi/2)
px, py = make_es_path()
for i in eachindex(px)
println(" \n------------ Start simulation : px = $(px[i]), py = $(py[i]) --------\n ")
optim_es(H, px[i], py[i], "config.toml")
println(" \n------------ End simulation : px = $(px[i]), py = $(py[i]) -------- \n ")
endAfter above long computation, we can plot the excitation band:
# example_plot.jl
using iPEPS
using CarioMakie
# number of bands
n = 4
E = plot_band(n, "config.toml")
f = Figure()
ax = Axis(f[1, 1])
for i = 1:n
x = collect(1:size(E,2))
y = E[i,:]
lines!(ax, x, y)
end
f# config.toml
out_prefix = "default"
model = "ising"
D = 2
chi = 30
resume = false
nrmB_cut = 1e-3
min_iter = 4
max_iter = 30
rg_tol = 1e-6-
iPEPS.jl: main file
-
Basis file:
- printing.jl: custom output
- io.jl: create dir and file
- tcon.jl: wrap the contraction function
- model.jl: construct Hamiltonian
- svd_ad.jl: svd for zygote extend
- basis.jl:
-
Struct file:
- emptyT.jl: convenient struct for contraction
- nested_tensor.jl: tensor with [T, T_B, T_Bd, T_Bd]
- ctm_tensor.jl: Struct of Corner transfer matrix
-
Optimization file:
- ctmrg.jl: update ctm_tensor
- optim_gs.jl: optimize the ground state
- optim_es.jl: optimize the excited state
- expectation.jl: compute the expectation
-
Others:
- plot.jl