Skip to content

BenjaminDecker/TensorTimeSteps.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TensorTimeSteps.jl

A collection of time evolution algorithms for tensor network states

Given a Hamiltonian operator $H$ in MPO form, and an initial state $\psi_0$ in MPS form, calculate

$$ \psi(t_k)=e^{-iHk\Delta t}\psi_0~,~~k=0,1,\dots,N $$


For now, only the 1-site and 2-site TDVP algorithms are supported, and $H$ and $\psi_0$ must be given as ITensor MPS/MPO types.

Usage

Provide some $H$ and $\psi_0$

using ITensors, ITensorMPS, Random

N = 10
J = 1
g = 0.5
sites = siteinds("Qubit", N)

# Random initial product state
psi_0 = MPS(
    sites,
    map(x -> x ? "1" : "0", bitrand(length(sites)))
) 

# tfim Hamiltonian
os = OpSum()
for j=1:N-1
    os .+= -J,"Z",j,"Z",j+1
    os .+= -g*J,"X", j
end
os .+= -g*J, "X", N
H = MPO(os, sites)

Run the TDVP and collect intermediate states at different time steps

using TensorTimeSteps


T = 1
num_steps = 100
sweeps_per_time_step = 100
max_bond_dim = 32
svd_epsilon = 1e-10

results1 = tdvp1(
    H,
    psi_0;
    step_size=T/num_steps,
    num_steps=num_steps,
    sweeps_per_time_step=sweeps_per_time_step,
    max_bond_dim=max_bond_dim
)

results2 = tdvp2(
    H,
    psi_0;
    step_size=T/num_steps,
    num_steps=num_steps,
    sweeps_per_time_step=sweeps_per_time_step,
    max_bond_dim=max_bond_dim,
    svd_epsilon=svd_epsilon
)

About

A collection of time evolution algorithms for tensor network states

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages