GPUE  v1.0
GPU Gross-Pitaevskii Equation numerical solver for Bose-Einstein condensates
kinSpec.m
Go to the documentation of this file.
1 function [EKc,EKi] = kinSpec(wfc_str,dimSize,dx,mass,qSpec,init,incr,fin)
2 %This function is used to process a large number of wavefunctions to examine
3 %the kinetic energy spectra. I'd love to port these to CUDA, but time is a
4 %precious resource that I have little of right now
5 % wfc_str is the string of the wavefunction name. For time-ev this is
6 % usually wfc_ev; wfc_0_const or wfc_0_ramp for ground-states
7 % dimSize is a vector with the dimenion size, so that the wavefunctions
8 % can be appropriately reshaped when loaded
9 % dx is the increment along x. dx==dy
10 % qSpec enables classical (0) or quantum (1) variant of energy spectra
11 % init,incr,fin are the loop values for specifiying the range of the data
12 
13 %Load initial wavefunction to setup grid
14 wfc = reshape(load([wfc_str,'_',int2str(0)]) + 1i*load([wfc_str,'i_',int2str(0)]),dimSize(1),dimSize(2));
15 [~,~,EKc,EKi,k_bin] = quKineticSpec(wfc,mass,dx,qSpec,1,0);
16 for ii=init:incr:fin
17  wfc = reshape(load([wfc_str,'_',int2str(ii)]) + 1i*load([wfc_str,'i_',int2str(ii)]),dimSize(1),dimSize(2));
18  [~,~,ekc,eki,~] = quKineticSpec(wfc,mass,dx,qSpec,1,ii);
19  EKc=vertcat(EKc,ekc);EKi=vertcat(EKi,eki); %Prealloc may improve speed here
20 end
21 save Ek.mat;
tuple dx
Definition: en.py:59
int init(Grid &par)
Initializes data structures.
tic for a
Definition: GPE_2d.m:90
2 dimSize()
% If at least one of the indices is
incr
Definition: en.py:57
tuple mass
Definition: observables.py:72