Simulate the evolution of a wave packet in 2 + 1 domensions.
More...
#include <WaveSimulation.hpp>
|
| | 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.
|
| |
| | 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 | step () |
| | Evolve a step forward in time.
|
| |
| 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.
|
| |
| 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.
|
| |
| 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 | 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 | initialize_V (double thickness, double pos_x, double aperture_separation, double aperture, uint32_t slits) |
| | Initialize the V matrix.
|
| |
|
void | initialize_V () |
| | Initialize the V matrix with no wall.
|
| |
|
void | initialize_A () |
| | Initialize the A matrix according to the Crank-Nicolson method.
|
| |
|
void | initialize_B () |
| | Initialize the B matrix according to the Crank-Nicolson method.
|
| |
| void | write_U (std::ofstream &ofile) |
| | Write the U matrix in a single line to the file buffer given.
|
| |
|
| int32_t | M |
| | The size.
|
| |
| int32_t | N |
| | The size of the inner part.
|
| |
| arma::cx_mat | V |
| | The potential matrix.
|
| |
| arma::cx_mat | U |
| | The particle wave matrix.
|
| |
| arma::sp_cx_mat | B |
| | The B matrix.
|
| |
| arma::sp_cx_mat | A |
| | The A matrix.
|
| |
| double | h |
| | The step size in both x and y direction.
|
| |
| double | dt |
| | The step size int the time direction.
|
| |
| double | T |
| | The end time.
|
| |
Simulate the evolution of a wave packet in 2 + 1 domensions.
Definition at line 22 of file WaveSimulation.hpp.
◆ WaveSimulation() [1/2]
| WaveSimulation::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.
- Parameters
-
| h | The step size in the x and y direction. |
| dt | The step size in the temporal dimension. |
| T | The total time to simulate. |
| x_c | The center of the packet in the x direction. |
| y_c | The center of the packet in the y direction. |
| sigma_x | The The initial width in the x direction. |
| sigma_y | The The initial width in the y direction. |
| p_x | The wave packet momentum in the x direction. |
| p_y | The wave packet momentum in the y direction. |
| thickness | The thickness of the wall in the x direction. |
| pos_x | The center of the wall in the x direction. |
| ap_sep | The separation between each aperture. |
| ap | The aperture width. |
| slits | The number of slits. |
◆ WaveSimulation() [2/2]
| WaveSimulation::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.
- Parameters
-
| h | The step size in the x and y direction. |
| dt | The step size in the temporal dimension. |
| T | The total time to simulate. |
| x_c | The center of the packet in the x direction. |
| y_c | The center of the packet in the y direction. |
| sigma_x | The The initial width in the x direction. |
| sigma_y | The The initial width in the y direction. |
| p_x | The wave packet momentum in the x direction. |
| p_y | The wave packet momentum in the y direction. |
◆ initialize_U()
| void WaveSimulation::initialize_U |
( |
double |
x_c, |
|
|
double |
y_c, |
|
|
double |
sigma_x, |
|
|
double |
sigma_y, |
|
|
double |
p_x, |
|
|
double |
p_y |
|
) |
| |
|
private |
Initialize the U matrix using an unormalized Gaussian wave packet.
- Parameters
-
| x_c | The center of the packet in the x direction. |
| y_c | The center of the packet in the y direction. |
| sigma_x | The The initial width in the x direction. |
| sigma_y | The The initial width in the y direction. |
| p_x | The wave packet momentum in the x direction. |
| p_y | The wave packet momentum in the y direction. |
◆ initialize_V()
| void WaveSimulation::initialize_V |
( |
double |
thickness, |
|
|
double |
pos_x, |
|
|
double |
aperture_separation, |
|
|
double |
aperture, |
|
|
uint32_t |
slits |
|
) |
| |
|
private |
Initialize the V matrix.
- Parameters
-
| thickness | The thickness of the wall in the x direction. |
| pos_x | The center of the wall in the x direction. |
| ap_sep | The separation between each aperture. |
| ap | The aperture width. |
| slits | The number of slits. |
◆ probability_deviation()
| void WaveSimulation::probability_deviation |
( |
std::string |
outfile, |
|
|
bool |
write_each_step = false |
|
) |
| |
Write the deviation of the sum of the probability of U from 1.
- Parameters
-
| outfile | The name of the file to write to to file |
◆ simulate() [1/2]
| void WaveSimulation::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.
- Parameters
-
| outfile | The name of the file to write to |
| write_each_step | Boolean for deciding to write each step to file or just the last step |
◆ simulate() [2/2]
| void WaveSimulation::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.
- Parameters
-
| outfile | The name of the file to write to |
| steps | What time steps to write U to file. |
◆ write_U()
| void WaveSimulation::write_U |
( |
std::ofstream & |
ofile | ) |
|
|
private |
Write the U matrix in a single line to the file buffer given.
- Parameters
-
| ofile | The file buffer to write to |
| arma::sp_cx_mat WaveSimulation::A |
|
private |
| arma::sp_cx_mat WaveSimulation::B |
|
private |
◆ dt
| double WaveSimulation::dt |
|
private |
| int32_t WaveSimulation::M |
|
private |
| int32_t WaveSimulation::N |
|
private |
| arma::cx_mat WaveSimulation::U |
|
private |
| arma::cx_mat WaveSimulation::V |
|
private |
The documentation for this class was generated from the following file: