-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfGround_State_Creator.m
More file actions
52 lines (29 loc) · 1.33 KB
/
Copy pathfGround_State_Creator.m
File metadata and controls
52 lines (29 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
function [GroundPSI, Energy] = fGround_State_Creator(PSI,ksquareon2,g,V,...
DeltaT,InitialNatoms, Points, Energy1, DeltaX, k)
Energy = zeros(1,Points);
mkdir ./Data/;
% The 2D third oder Baker Hausdorff with t set to -i*t is called
PSI = Baker_Hausdorff_Oh3_iTime(PSI,ksquareon2,g,V,DeltaT);
% PSI is now renormalized to keep the right number density correct so that
% the whole thing does not decay away entirely.
Natoms = sum(sum(abs(PSI.^2))).*DeltaX.^2;
PSI = (sqrt(InitialNatoms)/sqrt(Natoms)) .* PSI;
Energy(1,1) = GPE_Energy_2D(PSI,k,g,V,DeltaT);
PSI = Baker_Hausdorff_Oh3_iTime(PSI,ksquareon2,g,V,DeltaT);
Natoms = sum(sum(abs(PSI.^2))).*DeltaX.^2;
PSI = (sqrt(InitialNatoms)/sqrt(Natoms)) .* PSI;
Energy(1,2) = GPE_Energy_2D(PSI,k,g,V,DeltaT);
ii = 2;
while Energy(1,ii-1) - Energy(1,ii) > 0.000001;
ii = ii + 1;
% The 2D third oder Baker Hausdorff with t set to -i*t is called
PSI = Baker_Hausdorff_Oh3_iTime(PSI,ksquareon2,g,V,DeltaT);
% PSI is now renormalized to keep the right number density correct so that
% the whole thing does not decay away entirely.
Natoms = sum(sum(abs(PSI.^2))).*DeltaX.^2;
PSI = (sqrt(InitialNatoms)/sqrt(Natoms)) .* PSI;
Energy(1,ii) = GPE_Energy_2D(PSI,k,g,V,DeltaT);
end
%save(['./Data/Ground_state_grid_' num2str(Points) '.mat'],'PSI')
GroundPSI = PSI;
end