Massively Parallel Trotter-Suzuki Solver  1.6.2
Public Member Functions | Private Member Functions | Private Attributes | List of all members
BesselState Class Reference

This class defines a quantum state with Bessel function of the first kind, along the radial coordinate. More...

#include <trottersuzuki.h>

Inheritance diagram for BesselState:
State

Public Member Functions

 BesselState (Lattice1D *grid, int angular_momentum=0, int zeros=1, double norm=1, double phase=0, double *p_real=0, double *p_imag=0)
 
 BesselState (Lattice2D *grid, int angular_momentum=0, int zeros=1, int n_y=0, double norm=1, double phase=0, double *p_real=0, double *p_imag=0)
 
- Public Member Functions inherited from State
 State (Lattice *grid, int angular_momentum=0, double *p_real=0, double *p_imag=0)
 
 State (const State &obj)
 Copy constructor: copy the state object. More...
 
 ~State ()
 Destructor.
 
void init_state (complex< double >(*ini_state)(double x))
 Write the wave function from a C++ function to p_real and p_imag matrices in 1D. More...
 
void init_state (complex< double >(*ini_state)(double x, double y))
 Write the wave function from a C++ function to p_real and p_imag matrices in 2D. More...
 
void loadtxt (char *file_name)
 Load the wave function from a file to p_real and p_imag matrices.
 
void imprint (complex< double >(*function)(double x))
 Multiply the wave function of the state by the function provided in 1D. More...
 
void imprint (complex< double >(*function)(double x, double y))
 Multiply the wave function of the state by the function provided in 2D. More...
 
double * get_particle_density (double *density=0)
 Return a matrix storing the squared norm of the wave function. More...
 
double * get_phase (double *phase=0)
 Return a matrix storing the phase of the wave function. More...
 
double get_expected_value (string _operator)
 Return the expected value of the operator, given as argument.
 
double get_squared_norm (void)
 Return the squared norm of the quantum state.
 
double get_mean_x (void)
 Return the expected value of the X operator.
 
double get_mean_xx (void)
 Return the expected value of the X^2 operator.
 
double get_mean_y (void)
 Return the expected value of the Y operator.
 
double get_mean_yy (void)
 Return the expected value of the Y^2 operator.
 
double get_mean_px (void)
 Return the expected value of the P_x operator.
 
double get_mean_pxpx (void)
 Return the expected value of the P_x^2 operator.
 
double get_mean_py (void)
 Return the expected value of the P_y operator.
 
double get_mean_pypy (void)
 Return the expected value of the P_y^2 operator.
 
double get_mean_angular_momentum (void)
 Return the expected value of the L_z operator.
 
void write_to_file (string fileprefix)
 Write to a file the wave function. More...
 
void write_particle_density (string fileprefix)
 Write to a file the squared norm of the wave function. More...
 
void write_phase (string fileprefix)
 Write to a file the phase of the wave function. More...
 

Private Member Functions

complex< double > bessel_state1D (double x)
 Bessel function of the first kind.
 
complex< double > bessel_state2D (double x, double y)
 Bessel function of the first kind.
 

Private Attributes

int angular_momentum
 Angular momentum.
 
int zeros
 
int n_y
 First and second quantum number.
 
double zero
 radial coordinate of the last zero.
 
double normalization
 Variable used for the normalization of the state.
 
double norm
 
double phase
 Norm and phase of the state.
 

Additional Inherited Members

- Public Attributes inherited from State
double * p_real
 Real part of the wave function.
 
double * p_imag
 Imaginary part of the wave function.
 
Lattice * grid
 Object that defines the lattice structure.
 
int angular_momentum
 Angular momentum when cylindrical coordinates are used.
 
bool expected_values_updated
 Whether the expected values of the state object are updated with respect to the last evolution.
 
- Protected Member Functions inherited from State
void calculate_expected_values (void)
 Calculate squared norm and expected values.
 
- Protected Attributes inherited from State
bool self_init
 Whether the p_real and p_imag matrices have been initialized from the State constructor or not.
 
double mean_X
 
double mean_XX
 Expected values of the X and X^2 operators.
 
double mean_Y
 
double mean_YY
 Expected values of the Y and Y^2 operators.
 
double mean_Px
 
double mean_PxPx
 Expected values of the P_x and P_x^2 operators.
 
double mean_Py
 
double mean_PyPy
 Expected values of the P_y and P_y^2 operators.
 
double mean_angular_momentum
 Expected value of the L_z operator.
 
double norm2
 Squared norm of the state.
 

Detailed Description

This class defines a quantum state with Bessel function of the first kind, along the radial coordinate.

This class is a child of State class. The wave function, along the y-axis, is sinusoidal.

Constructor & Destructor Documentation

BesselState::BesselState ( Lattice1D grid,
int  angular_momentum = 0,
int  zeros = 1,
double  norm = 1,
double  phase = 0,
double *  p_real = 0,
double *  p_imag = 0 
)

Construct the quantum state with bessel function of the first kind, along the radial coordinate.

Parameters
[in]gridLattice object.
[in]angular_momentumAngular momentum.
[in]zerosNumber of zeros points along the radial axis.
[in]normSquared norm of the quantum state.
[in]phaseRelative phase of the wave function.
[in]p_realPointer to the real part of the wave function.
[in]p_imagPointer to the imaginary part of the wave function.
BesselState::BesselState ( Lattice2D grid,
int  angular_momentum = 0,
int  zeros = 1,
int  n_y = 0,
double  norm = 1,
double  phase = 0,
double *  p_real = 0,
double *  p_imag = 0 
)

Construct the quantum state with bessel function of the first kind, along the radial coordinate.

Parameters
[in]gridLattice object.
[in]angular_momentumAngular momentum.
[in]zerosNumber of zeros points along the radial axis.
[in]n_ySecond quantum number for the sinusoid along the y-axis.
[in]normSquared norm of the quantum state.
[in]phaseRelative phase of the wave function.
[in]p_realPointer to the real part of the wave function.
[in]p_imagPointer to the imaginary part of the wave function.

The documentation for this class was generated from the following files: