CODE STILL IN DEVELOPMENT
Solver of the density-locked extend Gross-Pitaevskii (GP) equation in three-dimensions (3D)
The code time steps using the Split-Step Fourier Method (SSFM), with both imaginary and real time. It relies on several libraries and packages:
FFTW3- A standard FFT libraryOpenMP- Shared memory parallelisation libraryHDF5- Data format, used for outputting data herejson-fortran- A JSON API for Fortran, used for input files for each simulation here
The code is structured as follows:
The gp_lck program is the main program script of the code which loads in input data (see config.json) and calls other functions and subroutines for setting up grid, time-stepping, etc.
The FFTW module is simply to load FFTW into the code.
The grid module contains three functions for setting up the grids and differential operators:
space_grid(Nr,dr)- The spatial 1D grid arrays (Nr- the number of grid points,dr- the spatial step size)mom_grid(Nr,dr)- The momentum space 1D grid arraysexp_lap(kx,ky,kz,dt)-The Laplacian different operator written in the formexp(-0.5*dt*(kx^2 + ky^2 + kz^2)), as this is the form that is called within the SSFM time-stepping, so by defining this operator initially, there is a slight reduction in operations (kx,kyandkzare the three momentum space arrays,dtthe time-step)
The init module (currently) contains one function for initialising the imaginary time-stepping (there is an aim to extend this to read in a .h5 file as the initial wavefunction for real time):
init_wav(x,y,z,init_type,gauss_sig)- The initial wavefunction form (x,yandzare the three real space arrays,init_typeallows for the selection of: a Gaussian initial density profile (init_type = 1); or a Super_Gaussian initial density profile (init_type = 2))readin_wav(x,y,z)- The initial wavefunction form loaded via an .h5, this can be loaded for both real and imaginary time
The time module contains two subroutines and one function for time-stepping the right-hand-side of the GP equation:
ssfm(psi,dk2,t_steps,t_save,dt,dx,dy,dz,Nlck,mu,im_real)- The SSFM is employed here and can be used for both imaginary and real time (though the time-stepdtmust be defined to be real or imaginary before being passed to this subroutine). The main structure of this method is:
- Half potential step in real space
- Transform to Fourier space and compute the kinetic energy term
- Transform back to real space and compute the other half potential step
- Finally, additional calculations include chemical potential and renormalisation if in imaginary time
This subroutine is also responsible for the in-time data outputting (to
.h5format), and for creating the FFTW plans (psiis the wavefunction,dk2is the Laplacian operator in exponential form,t_stepsnumber of time-steps,t_savenumber of steps between writing data,Nlckis the effective atom number for the density-locked system,muis the chemical potential, andim_realdenotes imaginary (im_real = 0) or real (im_real = 1) time)
renorm(psi,dx,dy,dz,Nlck)- This subroutine renormalises the wavefunction (computed at each time-step in imaginary time)chem_pot(psi,psi_k,dk2,plan_back,Nx,Ny,Nz,dt)- The chemical potential is calculated at each imaginary time-step, to aid in imaginary time convergence (psi_kis the Fourier transform of the wavefunction, andplan_backis the Inverse Fourier Transform plan)
The rhs module contains two subroutines:
V_rhs(psi,mu,dt,Nx,Ny,Nz)- The potential half-step.T_rhs(psi_k,dk2,Nx,Ny,Nz)- The kinetic energy step in momentum space.
Once the requisite libraries are loaded and located on the system, the next step is to setup up the config.json (the naming convention the code expects) file from the default.config.json file.
With the codes ready, the paths to the necessary libraries should be added to the associated Makefile (makefile_pc for local machines and makefile_hpc for remote clusters). Then copy the desired Makefile to makefile and run make to compile. If running locally then the code can be ran with the ./gplck command, whilst for running on a cluster, an example SLURM job script is given in either drop_lck.sh or h5_lck.sh:
drop_lck.sh- this create a separate directory for the simulation data to be storedh5_lck.sh- as above but sets up the reading in of thepsi_init.h5initial wavefunction file
Extension work will be undertaken on this code to include:
- Processing scripts
- Experimental to theoretical scripts to setup the
config.jsoninput file from experimental parameters