12#ifndef __WAVE_SIMULATION__
13#define __WAVE_SIMULATION__
44 void initialize_U(
double x_c,
double y_c,
double sigma_x,
double sigma_y,
45 double p_x,
double p_y);
56 double aperture_separation,
double aperture,
95 double sigma_x,
double sigma_y,
double p_x,
double p_y,
96 double thickness,
double pos_x,
double ap_sep,
double ap,
112 double sigma_x,
double sigma_y,
double p_x,
double p_y);
125 void simulate(std::string outfile,
bool write_each_step =
false);
133 void simulate(std::string outfile, std::vector<double> &steps);
140 bool write_each_step =
false);
Simulate the evolution of a wave packet in 2 + 1 domensions.
arma::cx_mat U
The particle wave matrix.
double dt
The step size int the time direction.
arma::sp_cx_mat A
The A matrix.
void initialize_B()
Initialize the B matrix according to the Crank-Nicolson method.
int32_t N
The size of the inner part.
arma::sp_cx_mat B
The B matrix.
void initialize_V(double thickness, double pos_x, double aperture_separation, double aperture, uint32_t slits)
Initialize the V matrix.
double h
The step size in both x and y direction.
void initialize_A()
Initialize the A matrix according to the Crank-Nicolson method.
void simulate(std::string outfile, bool write_each_step=false)
Evolve the wave packet until the time T has been reached and write U to file.
WaveSimulation(double h, double dt, double T, double x_c, double y_c, double sigma_x, double sigma_y, double p_x, double p_y)
Constructor for the WaveSimulation class with no wall.
void initialize_V()
Initialize the V matrix with no wall.
void simulate(std::string outfile, std::vector< double > &steps)
Evolve the wave packet and write U to fileto file at each time step in the vector given.
arma::cx_mat V
The potential matrix.
void write_U(std::ofstream &ofile)
Write the U matrix in a single line to the file buffer given.
WaveSimulation(double h, double dt, double T, double x_c, double y_c, double sigma_x, double sigma_y, double p_x, double p_y, double thickness, double pos_x, double ap_sep, double ap, uint32_t slits)
Constructor for the WaveSimulation class.
void initialize_U(double x_c, double y_c, double sigma_x, double sigma_y, double p_x, double p_y)
Initialize the U matrix using an unormalized Gaussian wave packet.
void probability_deviation(std::string outfile, bool write_each_step=false)
Write the deviation of the sum of the probability of U from 1.
void step()
Evolve a step forward in time.