8#ifndef SRC_APPS_CHEM_DIAMAGNETICPOTENTIALFACTOR_H_
9#define SRC_APPS_CHEM_DIAMAGNETICPOTENTIALFACTOR_H_
25 const std::vector<coord_3d>&
coords)
53 std::vector<coord_3d>
v;
57 v=std::vector<coord_3d> (1,{0.0,0.0,0.0});
73 const double extra_exponent=1.0)
const {
74 const double absB=
B.normf();
76 const double& ee=extra_exponent;
77 auto diamagnetic_HO = [&absB, &
B, &vv, &ee](
const coord_3d& r) {
84 if (ee!=1.0) result=std::pow(result,ee);
94 const double absB=
B.normf();
96 auto diamagnetic_HO = [&absB, &
B, &vv](
const coord_3d& r) {
103 double theta=acos(r[2]/r.
normf());
104 double phi=atan2(r[1],r[0]);
117 .functor([& b_square](
const coord_3d& r){
return 0.125*b_square*(r[0]*r[0] + r[1]*r[1]);});
122 std::vector<complex_function_3d>
apply_potential(
const std::vector<complex_function_3d>& rhs)
const;
126 return((
B[0]==0.0) && (
B[1]==0.0));
129 std::vector<coord_3d>
get_v()
const {
return v;}
140 return 2.0*sqrt(-log(eps)/remaining_B);
163 std::vector<coord_3d>
v;
187 if ((level<1) or (level>3)) {
188 print(
"testing diamagneticpotentialfactor with an invalid level of ",level);
std::complex< double > double_complex
Definition cfft.h:14
Definition test_ar.cc:118
Definition test_ar.cc:141
to be put in a separate file
Definition diamagneticpotentialfactor.h:19
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
Definition diamagneticpotentialfactor.h:72
static std::vector< coord_3d > compute_v_vector(const coord_3d &B, const std::vector< coord_3d > &coords, bool use_v_vector)
Definition diamagneticpotentialfactor.h:51
static bool B_along_z(const coord_3d &B)
make sure the magnetic field is oriented along the z axis
Definition diamagneticpotentialfactor.h:125
real_function_3d diamagnetic_factor_square
Definition diamagneticpotentialfactor.h:150
real_function_3d diamagnetic_factor_
the diamagnetic factor to cancel the diamagnetic potential
Definition diamagneticpotentialfactor.h:149
double estimate_wavefunction_radius(const double eps=1.e-8) const
Definition diamagneticpotentialfactor.h:138
bool test_me(const int level) const
run the tests
Definition diamagneticpotentialfactor.h:185
std::vector< real_function_3d > compute_nabla_R_div_R() const
returns
Definition diamagneticpotentialfactor.cc:188
complex_function_3d compute_lz_commutator() const
compute the commutator of the orbital-zeeman term with the diamagnetic factor
Definition diamagneticpotentialfactor.cc:135
real_function_3d factor_square() const
return the square of the diamagnetic factor
Definition diamagneticpotentialfactor.h:69
bool test_scalar_potentials() const
test analytical vs numerical computation of the potentials
Definition diamagneticpotentialfactor.cc:306
std::vector< complex_function_3d > 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!)
Definition diamagneticpotentialfactor.cc:369
coord_3d explicit_B
the magnetic field strength encoded in the diamagnetic factor
Definition diamagneticpotentialfactor.h:146
coord_3d get_explicit_B() const
Definition diamagneticpotentialfactor.h:132
std::vector< complex_function_3d > apply_potential(const std::vector< complex_function_3d > &rhs) const
apply the diamagnetic potential on rhs
Definition diamagneticpotentialfactor.cc:216
World & world
the world
Definition diamagneticpotentialfactor.h:144
double get_potential_radius() const
compute the radius for the diamagnetic potential
Definition diamagneticpotentialfactor.h:229
bool test_harmonic_potential() const
test the harmonic potential
Definition diamagneticpotentialfactor.cc:282
bool test_vector_potentials() const
test analytical vs numerical computation of the potentials
Definition diamagneticpotentialfactor.cc:327
real_function_3d compute_U2() const
Definition diamagneticpotentialfactor.cc:151
void print_info() const
Definition diamagneticpotentialfactor.cc:110
std::vector< coord_3d > coords
the position of the nuclei in the coordinate space:
Definition diamagneticpotentialfactor.h:160
std::vector< coord_3d > v
the position of the nuclei in the "A" space: v = 1/2 B cross R
Definition diamagneticpotentialfactor.h:163
real_function_3d bare_diamagnetic_potential() const
compute the bare potential without confinement or factors
Definition diamagneticpotentialfactor.h:113
std::vector< coord_3d > get_v() const
Definition diamagneticpotentialfactor.h:129
Diamagnetic_potential_factor(World &world, const Nemo_complex_Parameters ¶m, const std::vector< coord_3d > &coords)
constructor takes a world and the parameters for the calculation
Definition diamagneticpotentialfactor.h:24
real_function_3d factor() const
return the diamagnetic factor
Definition diamagneticpotentialfactor.h:66
void recompute_factors_and_potentials()
recompute the factor and the potentials for given physical and explicit magnetic fields
Definition diamagneticpotentialfactor.cc:122
std::vector< coord_3d > get_coords() const
Definition diamagneticpotentialfactor.h:130
coord_3d physical_B
the actual magnetic field strength
Definition diamagneticpotentialfactor.h:145
bool test_factor() const
compute a factor for comparison in coordinate space
Definition diamagneticpotentialfactor.cc:239
coord_3d get_physical_B() const
Definition diamagneticpotentialfactor.h:134
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
Definition diamagneticpotentialfactor.h:93
bool test_lz_commutator() const
Definition diamagneticpotentialfactor.cc:349
real_function_3d diamagnetic_U2
the boxed diamagnetic potential (for a given B)
Definition diamagneticpotentialfactor.h:156
bool use_v_vector
Definition diamagneticpotentialfactor.h:165
real_function_3d compute_R_times_T_commutator_scalar_term_numerically() const
Definition diamagneticpotentialfactor.cc:176
double potential_radius
radius where the diamagnetic potential flattens out
Definition diamagneticpotentialfactor.h:153
void reset_explicit_B_and_v(const coord_3d &eB)
Definition diamagneticpotentialfactor.h:46
std::vector< real_function_3d > diamagnetic_U1
Definition diamagneticpotentialfactor.h:157
T normf() const
Calculate the 2-norm of the vector elements.
Definition vector.h:400
A parallel world class.
Definition world.h:132
Tensor< typename Tensor< T >::scalar_type > arg(const Tensor< T > &t)
Return a new tensor holding the argument of each element of t (complex types only)
Definition tensor.h:2502
#define MADNESS_ASSERT(condition)
Assert a condition that should be free of side-effects since in release builds this might be a no-op.
Definition madness_exception.h:134
Main include file for MADNESS and defines Function interface.
Namespace for all elements and tools of MADNESS.
Definition DFParameters.h:10
std::vector< Function< TENSOR_RESULT_TYPE(T, R), NDIM > > cross(const std::vector< Function< T, NDIM > > &f, const std::vector< Function< R, NDIM > > &g, bool do_refine=false, bool fence=true)
shorthand cross operator
Definition vmra.h:2070
FunctionFactory< double, 3 > real_factory_3d
Definition functypedefs.h:93
void print(const T &t, const Ts &... ts)
Print items to std::cout (items separated by spaces) and terminate with a new line.
Definition print.h:225
double inner(response_space &a, response_space &b)
Definition response_functions.h:442
FunctionFactory< double_complex, 3 > complex_factory_3d
Definition functypedefs.h:100
static double phase(long i)
Definition twoscale.cc:85
static const double c
Definition relops.cc:10
InputParameters param
Definition tdse.cc:203
const double offset
Definition testfuns.cc:143