-
Notifications
You must be signed in to change notification settings - Fork 0
/
BEC_harm_lattice_nokick_new.cpp
executable file
·72 lines (56 loc) · 1.89 KB
/
BEC_harm_lattice_nokick_new.cpp
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include<vector>
#include<iostream>
//#include"bec.h"
#include"headers/split_step.h"
#include<algorithm>
#include<functional>
#include<iterator>
#include<cmath>
#include<complex>
#include"headers/BEC_Groundstate.h"
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/io.hpp>
using namespace std;
int main(){
typedef std::vector<double> Vector;
typedef std::vector<complex<double> > Cvector;
typedef boost::numeric::ublas::matrix<double> Matrix;
typedef complex<double> complex_type;
typedef fftw_complex complex_c_type;
typedef vector<complex<double> >::size_type size_t;
const double pi = 4.*atan(1.);
const double K = 0.8;
const double g = 0.0;
const double L = 15;
int N=1024;
const int period = 10000;
const double deltat = 2.*pi/double(period);
typedef complex<double> complex_type;
typedef fftw_complex complex_c_type;
const complex_type I(0,1);
Vector groundstate(N, 100.);
Cvector data(N);
Hamiltonian<Matrix, Vector, FullDiag> GP(N, L, g, groundstate, 50000, true);
groundstate=GP.find_groundstate();
copy(groundstate.begin(), groundstate.end(), data.begin());
cout<<"System size"<<'\t'<<"Points"<<'\t'<<"Coupling"<<'\t'<<"deltat"<<endl;
cout<<L<<'\t'<<N<<'\t'<<g<<'\t'<<deltat<<endl;
Cvector mom(N);
mom= FourierTransform<fft::forward,fft::Estimate>(data);
for(int i = 0 ; i < mom.size(); ++i)
cout<<norm(mom[i])<<endl;
/*
double t=0;
int stepcounter=0;
for(;t<100; t+=deltat, ++stepcounter){
data=split_step::S3(L, deltat,g, data);
if(!(stepcounter%period)){
for(int i=0; i<data.size(); ++i)
cout<<t<<'\t'<<abs(data[i])<<endl;
cout<<"&"<<endl;
}
}
*/
return 0;
}