MADNESS 0.10.1
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
madness::Diamagnetic_potential_factor Class Reference

to be put in a separate file More...

#include <diamagneticpotentialfactor.h>

Collaboration diagram for madness::Diamagnetic_potential_factor:
Collaboration graph
[legend]

Public Member Functions

 Diamagnetic_potential_factor (World &world, const Nemo_complex_Parameters &param, const std::vector< coord_3d > &coords)
 constructor takes a world and the parameters for the calculation
 
std::vector< complex_function_3dapply_potential (const std::vector< complex_function_3d > &rhs) const
 apply the diamagnetic potential on rhs
 
real_function_3d bare_diamagnetic_potential () const
 compute the bare potential without confinement or factors
 
complex_function_3d compute_lz_commutator () const
 compute the commutator of the orbital-zeeman term with the diamagnetic factor
 
std::vector< real_function_3dcompute_nabla_R_div_R () const
 returns $R^{-1} \vec\nabla R$
 
real_function_3d compute_R_times_T_commutator_scalar_term_numerically () const
 
real_function_3d compute_U2 () const
 
real_function_3d custom_factor (const coord_3d &B, const std::vector< coord_3d > &vv, const double extra_exponent=1.0) const
 return a custom factor for a given magnetic field
 
double estimate_wavefunction_radius (const double eps=1.e-8) const
 
real_function_3d factor () const
 return the diamagnetic factor
 
real_function_3d factor_square () const
 return the square of the diamagnetic factor
 
complex_function_3d factor_with_phase (const coord_3d &B, const std::vector< coord_3d > &vv) const
 return a custom factor for a given magnetic field
 
std::vector< coord_3dget_coords () const
 
coord_3d get_explicit_B () const
 
coord_3d get_physical_B () const
 
double get_potential_radius () const
 compute the radius for the diamagnetic potential
 
std::vector< coord_3dget_v () const
 
std::vector< complex_function_3dmake_fake_orbitals (const int n, const coord_3d &offset={0.0, 0.0, 0.0}) const
 make a set orbitals for testing (not orthonormalized!)
 
void print_info () const
 
void recompute_factors_and_potentials ()
 recompute the factor and the potentials for given physical and explicit magnetic fields
 
void reset_explicit_B_and_v (const coord_3d &eB)
 
bool test_me (const int level) const
 run the tests
 

Static Public Member Functions

static bool B_along_z (const coord_3d &B)
 make sure the magnetic field is oriented along the z axis
 
static std::vector< coord_3dcompute_v_vector (const coord_3d &B, const std::vector< coord_3d > &coords, bool use_v_vector)
 

Private Member Functions

bool test_factor () const
 compute a factor for comparison in coordinate space
 
bool test_harmonic_potential () const
 test the harmonic potential
 
bool test_lz_commutator () const
 
bool test_scalar_potentials () const
 test analytical vs numerical computation of the potentials
 
bool test_vector_potentials () const
 test analytical vs numerical computation of the potentials
 

Private Attributes

std::vector< coord_3dcoords
 the position of the nuclei in the coordinate space:
 
real_function_3d diamagnetic_factor_
 the diamagnetic factor to cancel the diamagnetic potential
 
real_function_3d diamagnetic_factor_square
 
std::vector< real_function_3ddiamagnetic_U1
 
real_function_3d diamagnetic_U2
 the boxed diamagnetic potential (for a given B)
 
coord_3d explicit_B ={0,0,0}
 the magnetic field strength encoded in the diamagnetic factor
 
coord_3d physical_B ={0,0,0}
 the actual magnetic field strength
 
double potential_radius
 radius where the diamagnetic potential flattens out
 
bool use_v_vector =true
 
std::vector< coord_3dv
 the position of the nuclei in the "A" space: v = 1/2 B cross R
 
Worldworld
 the world
 

Detailed Description

to be put in a separate file

Constructor & Destructor Documentation

◆ Diamagnetic_potential_factor()

madness::Diamagnetic_potential_factor::Diamagnetic_potential_factor ( World world,
const Nemo_complex_Parameters param,
const std::vector< coord_3d > &  coords 
)
inline

Member Function Documentation

◆ apply_potential()

std::vector< complex_function_3d > madness::Diamagnetic_potential_factor::apply_potential ( const std::vector< complex_function_3d > &  rhs) const

apply the diamagnetic potential on rhs

compute the diamagnetic local potential (B is in z direction -> dia = x^2 + y^2

References madness::apply(), diamagnetic_U1, diamagnetic_U2, explicit_B, madness::Vector< T, N >::normf(), physical_B, madness::World::size(), madness::truncate(), and world.

◆ B_along_z()

static bool madness::Diamagnetic_potential_factor::B_along_z ( const coord_3d B)
inlinestatic

make sure the magnetic field is oriented along the z axis

Referenced by bare_diamagnetic_potential(), compute_nabla_R_div_R(), compute_R_times_T_commutator_scalar_term_numerically(), and compute_U2().

◆ bare_diamagnetic_potential()

real_function_3d madness::Diamagnetic_potential_factor::bare_diamagnetic_potential ( ) const
inline

compute the bare potential without confinement or factors

References B_along_z(), madness::inner(), MADNESS_ASSERT, physical_B, and world.

◆ compute_lz_commutator()

complex_function_3d madness::Diamagnetic_potential_factor::compute_lz_commutator ( ) const

compute the commutator of the orbital-zeeman term with the diamagnetic factor

Returns
a local potential: iB \sum_i \vec r \cdot \vec v_i

References diamagnetic_U1, madness::dot(), explicit_B, madness::scale(), and world.

Referenced by test_lz_commutator().

◆ compute_nabla_R_div_R()

std::vector< real_function_3d > madness::Diamagnetic_potential_factor::compute_nabla_R_div_R ( ) const

◆ compute_R_times_T_commutator_scalar_term_numerically()

real_function_3d madness::Diamagnetic_potential_factor::compute_R_times_T_commutator_scalar_term_numerically ( ) const

◆ compute_U2()

real_function_3d madness::Diamagnetic_potential_factor::compute_U2 ( ) const

◆ compute_v_vector()

static std::vector< coord_3d > madness::Diamagnetic_potential_factor::compute_v_vector ( const coord_3d B,
const std::vector< coord_3d > &  coords,
bool  use_v_vector 
)
inlinestatic

◆ custom_factor()

real_function_3d madness::Diamagnetic_potential_factor::custom_factor ( const coord_3d B,
const std::vector< coord_3d > &  vv,
const double  extra_exponent = 1.0 
) const
inline

return a custom factor for a given magnetic field

References madness::arg(), madness::cross(), madness::inner(), v, and world.

Referenced by recompute_factors_and_potentials(), and test_factor().

◆ estimate_wavefunction_radius()

double madness::Diamagnetic_potential_factor::estimate_wavefunction_radius ( const double  eps = 1.e-8) const
inline

given the explicit and the physical B, estimate the radius of the wave function

References get_explicit_B(), and get_physical_B().

◆ factor()

real_function_3d madness::Diamagnetic_potential_factor::factor ( ) const
inline

◆ factor_square()

real_function_3d madness::Diamagnetic_potential_factor::factor_square ( ) const
inline

return the square of the diamagnetic factor

References diamagnetic_factor_square.

Referenced by test_factor(), and test_scalar_potentials().

◆ factor_with_phase()

complex_function_3d madness::Diamagnetic_potential_factor::factor_with_phase ( const coord_3d B,
const std::vector< coord_3d > &  vv 
) const
inline

return a custom factor for a given magnetic field

References madness::arg(), madness::cross(), madness::inner(), madness::Vector< T, N >::normf(), madness::phase(), v, and world.

◆ get_coords()

std::vector< coord_3d > madness::Diamagnetic_potential_factor::get_coords ( ) const
inline

References coords.

◆ get_explicit_B()

coord_3d madness::Diamagnetic_potential_factor::get_explicit_B ( ) const
inline

References explicit_B.

Referenced by estimate_wavefunction_radius().

◆ get_physical_B()

coord_3d madness::Diamagnetic_potential_factor::get_physical_B ( ) const
inline

References physical_B.

Referenced by estimate_wavefunction_radius().

◆ get_potential_radius()

double madness::Diamagnetic_potential_factor::get_potential_radius ( ) const
inline

compute the radius for the diamagnetic potential

References potential_radius.

Referenced by compute_R_times_T_commutator_scalar_term_numerically(), and compute_U2().

◆ get_v()

std::vector< coord_3d > madness::Diamagnetic_potential_factor::get_v ( ) const
inline

References v.

◆ make_fake_orbitals()

std::vector< complex_function_3d > madness::Diamagnetic_potential_factor::make_fake_orbitals ( const int  n,
const coord_3d offset = {0.0,0.0,0.0} 
) const

make a set orbitals for testing (not orthonormalized!)

References madness::arg(), offset, madness::phase(), and world.

Referenced by test_scalar_potentials().

◆ print_info()

void madness::Diamagnetic_potential_factor::print_info ( ) const

◆ recompute_factors_and_potentials()

void madness::Diamagnetic_potential_factor::recompute_factors_and_potentials ( )

recompute the factor and the potentials for given physical and explicit magnetic fields

References compute_nabla_R_div_R(), compute_U2(), custom_factor(), diamagnetic_factor_, diamagnetic_factor_square, diamagnetic_U1, diamagnetic_U2, explicit_B, and v.

Referenced by Diamagnetic_potential_factor().

◆ reset_explicit_B_and_v()

void madness::Diamagnetic_potential_factor::reset_explicit_B_and_v ( const coord_3d eB)
inline

◆ test_factor()

bool madness::Diamagnetic_potential_factor::test_factor ( ) const
private

compute a factor for comparison in coordinate space

References c, cc, coords, custom_factor(), madness::test_output::end(), explicit_B, factor(), factor_square(), madness::inner(), madness::test_output::logger, madness::norm2(), v, and world.

Referenced by test_me().

◆ test_harmonic_potential()

bool madness::Diamagnetic_potential_factor::test_harmonic_potential ( ) const
private

◆ test_lz_commutator()

bool madness::Diamagnetic_potential_factor::test_lz_commutator ( ) const
private

◆ test_me()

bool madness::Diamagnetic_potential_factor::test_me ( const int  level) const
inline

run the tests

Parameters
[in]level1: basic tests, .. , 3: all the tests

References madness::print(), test_factor(), test_harmonic_potential(), test_lz_commutator(), test_scalar_potentials(), and test_vector_potentials().

◆ test_scalar_potentials()

bool madness::Diamagnetic_potential_factor::test_scalar_potentials ( ) const
private

◆ test_vector_potentials()

bool madness::Diamagnetic_potential_factor::test_vector_potentials ( ) const
private

Member Data Documentation

◆ coords

std::vector<coord_3d> madness::Diamagnetic_potential_factor::coords
private

the position of the nuclei in the coordinate space:

Referenced by Diamagnetic_potential_factor(), compute_v_vector(), get_coords(), print_info(), reset_explicit_B_and_v(), and test_factor().

◆ diamagnetic_factor_

real_function_3d madness::Diamagnetic_potential_factor::diamagnetic_factor_
private

the diamagnetic factor to cancel the diamagnetic potential

Referenced by Diamagnetic_potential_factor(), factor(), and recompute_factors_and_potentials().

◆ diamagnetic_factor_square

real_function_3d madness::Diamagnetic_potential_factor::diamagnetic_factor_square
private

◆ diamagnetic_U1

std::vector<real_function_3d> madness::Diamagnetic_potential_factor::diamagnetic_U1
private

◆ diamagnetic_U2

real_function_3d madness::Diamagnetic_potential_factor::diamagnetic_U2
private

the boxed diamagnetic potential (for a given B)

Referenced by Diamagnetic_potential_factor(), apply_potential(), and recompute_factors_and_potentials().

◆ explicit_B

coord_3d madness::Diamagnetic_potential_factor::explicit_B ={0,0,0}
private

◆ physical_B

coord_3d madness::Diamagnetic_potential_factor::physical_B ={0,0,0}
private

◆ potential_radius

double madness::Diamagnetic_potential_factor::potential_radius
private

radius where the diamagnetic potential flattens out

Referenced by Diamagnetic_potential_factor(), and get_potential_radius().

◆ use_v_vector

bool madness::Diamagnetic_potential_factor::use_v_vector =true
private

◆ v

std::vector<coord_3d> madness::Diamagnetic_potential_factor::v
private

◆ world

World& madness::Diamagnetic_potential_factor::world
private

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