Skip to content

Commit 729c174

Browse files
authored
More split op updates (#306)
* modifying julia split_op code with imaginary time evolution. * adding largescale updates to quantum sysmtes and split_op * adding plotting intructions to julia file. * revisions to the bulk text * adding images and fixing typos. * smallscale changes to a large number of things. * updating real time gif. * formatting LaTeX * fixing notation in split_op.
1 parent ef4736e commit 729c174

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

contents/split-operator_method/code/julia/split_op.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ end
3333

3434
mutable struct Operators
3535
V::Vector{Complex{Float64}}
36-
PE::Vector{Complex{Float64}}
37-
KE::Vector{Complex{Float64}}
36+
R::Vector{Complex{Float64}}
37+
K::Vector{Complex{Float64}}
3838
wfc::Vector{Complex{Float64}}
3939

4040
Operators(res) = new(Vector{Complex{Float64}}(res),
@@ -49,11 +49,11 @@ function init(par::Param, voffset::Float64, wfcoffset::Float64)
4949
opr.V = 0.5 * (par.x - voffset).^2
5050
opr.wfc = exp.(-(par.x - wfcoffset).^2/2)
5151
if (par.im_time)
52-
opr. = exp.(-0.5*par.k.^2*par.dt)
53-
opr.PE = exp.(-0.5*opr.V*par.dt)
52+
opr.K = exp.(-0.5*par.k.^2*par.dt)
53+
opr.R = exp.(-0.5*opr.V*par.dt)
5454
else
55-
opr. = exp.(-im*0.5*par.k.^2*par.dt)
56-
opr.PE = exp.(-im*0.5*opr.V*par.dt)
55+
opr.K = exp.(-im*0.5*par.k.^2*par.dt)
56+
opr.R = exp.(-im*0.5*opr.V*par.dt)
5757
end
5858

5959
return opr
@@ -64,19 +64,19 @@ function split_op(par::Param, opr::Operators)
6464

6565
for i = 1:par.timesteps
6666
# Half-step in real space
67-
opr.wfc = opr.wfc .* opr.PE
67+
opr.wfc = opr.wfc .* opr.R
6868

6969
# fft to momentum space
7070
opr.wfc = fft(opr.wfc)
7171

7272
# Full step in momentum space
73-
opr.wfc = opr.wfc .* opr.
73+
opr.wfc = opr.wfc .* opr.K
7474

7575
# ifft back
7676
opr.wfc = ifft(opr.wfc)
7777

7878
# final half-step in real space
79-
opr.wfc = opr.wfc .* opr.PE
79+
opr.wfc = opr.wfc .* opr.R
8080

8181
# density for plotting and potential
8282
density = abs2.(opr.wfc)

contents/split-operator_method/split-operator_method.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Regardless, we first need to set all the initial parameters, including the initi
103103

104104
As a note, when we generate our grid in momentum space `k`, we need to split the grid into two lines, one that is going from `0` to `-kmax` and is then discontinuous and goes from `kmax` to `0`.
105105
This is simply because the FFT will naturally assume that the `0` in our grid is at the left side of the simulation, so we shift k-space to match this expectation.
106-
Also, for this code we will be using the notation from above: `opr.R` will be the real space operators and `opr.M` will be the momentum space operators.
106+
Also, for this code we will be using notation to what we used above: `opr.R` will be the real space operators and `opr.K` will be the momentum space operators.
107107
There is another boolean value here called `im_time`, which is for imaginary time evolution.
108108

109109
Afterwards, we turn them into operators:

0 commit comments

Comments
 (0)