Skip to content

Commit 8d378c6

Browse files
Update WindowMPS example (#350)
* Update_example_windowmps * Runic_fix
1 parent 335ff0b commit 8d378c6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

examples/windowmps.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ using MPSKit, MPSKitModels, TensorKit, Plots
22

33
let
44
#defining the hamiltonian
5-
th = nonsym_ising_ham(; lambda = 0.3)
6-
sx, sy, sz = nonsym_spintensors(1 // 2)
5+
th = transverse_field_ising(; g = 0.3)
6+
sx, sy, sz = σˣ(ComplexF64), σʸ(ComplexF64), σᶻ(ComplexF64)
77

88
#initilizing a random mps
99
ts = InfiniteMPS([ℂ^2], [ℂ^12])
@@ -23,11 +23,12 @@ let
2323

2424
envs = environments(mpco, th)
2525

26-
szdat = [expectation_value(mpco, sz)]
26+
szdat = [expectation_value(mpco, i => sz) for i in 1:length(mpco)]
27+
szdat = [szdat]
2728

2829
for i in 1:(totaltime / deltat)
29-
mpco, envs = timestep(mpco, th, deltat, TDVP2(; trscheme = truncrank(20)), envs)
30-
push!(szdat, expectation_value(mpco, sz))
30+
mpco, envs = timestep(mpco, th, 0, deltat, TDVP2(; trscheme = truncbelow(10^(-8)) & truncdim(25)), envs)
31+
push!(szdat, [expectation_value(mpco, i => sz) for i in 1:length(mpco)])
3132
end
3233

3334
display(heatmap(real.(reduce((a, b) -> [a b], szdat))))

0 commit comments

Comments
 (0)