Created
February 2, 2016 11:26
-
-
Save Lucacalderaro/4bf51c7ca2b0603174b4 to your computer and use it in GitHub Desktop.
Find the ground state of the harmonic potential using GPELab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Setting the method and geometry | |
Computation = 'Ground'; | |
Ncomponents = 1; | |
Type = 'BESP'; | |
Deltat = 1e-4; | |
Stop_time = []; | |
Stop_crit = {'MaxNorm',1e-4}; | |
Max_iter = 40000; | |
Method = Method_Var2d(Computation,Ncomponents, Type, Deltat, Stop_time , Stop_crit, Max_iter); | |
xmin = -7.07; | |
xmax = 7.07; | |
ymin = -7.07; | |
ymax = 7.07; | |
Nx = 2^8+1; | |
Ny = 2^8+1; | |
Geometry2D = Geometry2D_Var2d(xmin,xmax, ymin,ymax, Nx, Ny); | |
%% Setting the Hamiltonian | |
Delta = 0.5; | |
Beta = 0; | |
Omega = 0; | |
Physics2D = Physics2D_Var2d(Method,Delta,Beta); | |
Physics2D = Dispersion_Var2d(Method, Physics2D, @(fftx,ffty) Delta*(fftx.^2+ffty.^2)); | |
Physics2D = Potential_Var2d(Method, Physics2D, @(x,y) (1/2)*(x.^2+y.^2)); | |
Physics2D = Nonlinearity_Var2d(Method, Physics2D, @(phi,x,y) abs(phi).^2 ); | |
Physics2D = Gradientx_Var2d(Method, Physics2D,@(x,y) 1i*Omega*y); | |
Physics2D = Gradienty_Var2d(Method, Physics2D,@(x,y) -1i*Omega*x); | |
%% Setting the initial state | |
InitialData_choice = 1; | |
Phi_0 = InitialData_Var2d(Method, Geometry2D, Physics2D,InitialData_choice,0,0,3,3); | |
%% Set output structure | |
Evo = 1000; | |
Outputs = OutputsINI_Var2d(Method,Evo); | |
Printing = 1; | |
Draw = 0; | |
Print = Print_Var2d(Printing,Evo,Draw); | |
%% Launch evolution | |
[Phi,Outputs]= GPELab2d(Phi_0,Method,Geometry2D,Physics2D,Outputs,[],Print); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment