MADNESS 0.10.1
Classes | Enumerations | Functions | Variables
dirac-hatom.cc File Reference

solve the hydrogen atom using the 4-component Dirac equation More...

#include <iostream>
#include <madchem.h>
Include dependency graph for dirac-hatom.cc:

Classes

struct  Ansatz0
 
struct  AnsatzBase
 
class  DiracParameters
 
struct  ExactSpinor
 
struct  LProjector
 
class  MatrixOperator
 class defining an operator in matrix form, fixed to size (4,4) More...
 
class  Metric
 
class  MyDerivativeOperator< T, NDIM >
 
struct  ncf
 
struct  ncf_cusp
 
struct  ncf_singularity
 
struct  Omega
 
struct  sgl_guess
 
struct  Sigma_ncf_cusp
 
struct  SphericalHarmonics
 returns the complex value of a given spherical harmonic More...
 
class  Spinor
 defines a 4-spinor More...
 
struct  spinorallocator
 
struct  stepfunction
 
struct  Xi
 following Dyall: p 104f More...
 

Enumerations

enum  Uplo { upper , lower }
 

Functions

template<typename ansatzT >
Spinor apply_bsh (ansatzT &ansatz, const MatrixOperator &Hd, const MatrixOperator &Hv, const MatrixOperator &metric, const Spinor &spinor, const double energy)
 
void apply_mask (std::vector< Spinor > &v)
 
double compute_electronic_energy (const double energy)
 
double compute_gamma (const double nuclear_charge)
 
Spinor copy (const Spinor &other)
 
std::vector< Spinorcopy (const std::vector< Spinor > &other)
 
template<typename ansatzT >
void eigenvector_test (World &world, const ansatzT ansatz, ExactSpinor es)
 
double generalized_laguerre (const double alpha, const long n, const double r)
 
Tensor< double_complexget_fock_transformation (World &world, const std::vector< Spinor > &spinors, const Tensor< double_complex > &overlap, const Tensor< double_complex > &fock)
 
double_complex inner (const std::vector< Spinor > &bra, const std::vector< Spinor > ket)
 
template<typename AnsatzT >
std::vector< Spinoriterate (const std::vector< Spinor > &input, const std::vector< double > energy, const AnsatzT &ansatz, const int maxiter)
 
int main (int argc, char *argv[])
 
MatrixOperator make_alpha_p (World &world)
 
MatrixOperator make_Hd (World &world, const std::pair< double_complex, std::string > &ll, const std::pair< double_complex, std::string > &ss)
 this is c sigma p + beta m c^2
 
MatrixOperator make_Hdiag (World &world, const LocalPotentialOperator< double_complex, 3 > &V1)
 
MatrixOperator make_Hv (World &world, const double nuclear_charge)
 this is the nuclear potential on the diagonal
 
MatrixOperator make_sp (World &world)
 returns a (2,2) matrix
 
double mask1d (double x)
 
double mask3d (const Vector< double, 3 > &ruser)
 
Tensor< double_complexmatrix_inner (const std::vector< Spinor > &bra, const std::vector< Spinor > ket)
 
MatrixOperator moments (World &world, int axis, int order)
 
template<typename T >
Spinor operator* (const Spinor &arg, const T fac)
 
template<typename T >
std::vector< Spinoroperator* (const std::vector< Spinor > &arg, const T fac)
 
template<typename T >
Spinor operator* (const T fac, const Spinor &arg)
 
std::vector< Spinoroperator+= (std::vector< Spinor > &left, const std::vector< Spinor > &right)
 
std::vector< Spinoroperator- (const std::vector< Spinor > &left, const std::vector< Spinor > &right)
 
std::vector< Spinoroperator-= (std::vector< Spinor > &left, const std::vector< Spinor > &right)
 
template<typename AnsatzT >
void orthonormalize (std::vector< Spinor > &arg, const AnsatzT ansatz)
 
std::vector< Spinororthonormalize_fock (const std::vector< Spinor > &arg, const std::vector< Spinor > &bra, Tensor< double_complex > &fock)
 
double potn (double r)
 
template<typename ansatzT >
void run (World &world, ansatzT ansatz, const int nuclear_charge, const commandlineparser &parser, const int nstates)
 
template<typename ansatzT >
std::vector< Spinorschrodinger2dirac (const std::vector< complex_function_3d > wf, const ansatzT &ansatz, const double nuclear_charge)
 
void show_norms (const Spinor &bra, const Spinor &ket, const std::string &name)
 
std::vector< Spinortransform (World &world, const std::vector< Spinor > &v, const Tensor< double_complex > &c)
 Transforms a vector of functions according to new[i] = sum[j] old[j]*c[j,i].
 
std::vector< Spinortruncate (std::vector< Spinor > arg)
 

Variables

static double alpha1 =constants::fine_structure_constant
 
static double clight =1.0/alpha1
 
static bool debug =false
 
static double epsilon =1.e-12
 
static double lo =1.e-7
 
real_function_3d mask
 
static double nucexpt =3.0/nucrad
 
static double nucrad =1e-8
 
static double shift =0.0
 
static bool use_ble =false
 
static bool use_bsp =false
 

Detailed Description

solve the hydrogen atom using the 4-component Dirac equation

example usage: dirac-hatom –thresh=1.e-5 –k=7 –dirac="charge=100"

Enumeration Type Documentation

◆ Uplo

enum Uplo
Enumerator
upper 
lower 

Function Documentation

◆ apply_bsh()

template<typename ansatzT >
Spinor apply_bsh ( ansatzT &  ansatz,
const MatrixOperator Hd,
const MatrixOperator Hv,
const MatrixOperator metric,
const Spinor spinor,
const double  energy 
)

◆ apply_mask()

void apply_mask ( std::vector< Spinor > &  v)

References madness::f, mask, and v.

Referenced by iterate(), and run().

◆ compute_electronic_energy()

double compute_electronic_energy ( const double  energy)

References alpha1, c, energy, and shift.

Referenced by iterate().

◆ compute_gamma()

double compute_gamma ( const double  nuclear_charge)

◆ copy() [1/2]

Spinor copy ( const Spinor other)

◆ copy() [2/2]

std::vector< Spinor > copy ( const std::vector< Spinor > &  other)

References copy().

◆ eigenvector_test()

template<typename ansatzT >
void eigenvector_test ( World world,
const ansatzT  ansatz,
ExactSpinor  es 
)

◆ generalized_laguerre()

double generalized_laguerre ( const double  alpha,
const long  n,
const double  r 
)

◆ get_fock_transformation()

Tensor< double_complex > get_fock_transformation ( World world,
const std::vector< Spinor > &  spinors,
const Tensor< double_complex > &  overlap,
const Tensor< double_complex > &  fock 
)

◆ inner()

double_complex inner ( const std::vector< Spinor > &  bra,
const std::vector< Spinor ket 
)

References madness::inner().

◆ iterate()

template<typename AnsatzT >
std::vector< Spinor > iterate ( const std::vector< Spinor > &  input,
const std::vector< double >  energy,
const AnsatzT &  ansatz,
const int  maxiter 
)

◆ main()

int main ( int  argc,
char *  argv[] 
)

◆ make_alpha_p()

MatrixOperator make_alpha_p ( World world)

◆ make_Hd()

MatrixOperator make_Hd ( World world,
const std::pair< double_complex, std::string > &  ll,
const std::pair< double_complex, std::string > &  ss 
)

this is c sigma p + beta m c^2

Parameters
[in]llscalar on the LL (1,1) block
[in]ssscalar on the SS (2,2) block

References MatrixOperator::add_operator(), make_alpha_p(), V(), V1, and V2.

◆ make_Hdiag()

MatrixOperator make_Hdiag ( World world,
const LocalPotentialOperator< double_complex, 3 > &  V1 
)

◆ make_Hv()

MatrixOperator make_Hv ( World world,
const double  nuclear_charge 
)

this is the nuclear potential on the diagonal

References make_Hdiag(), madness::Vector< T, N >::normf(), potn(), V(), and V1.

◆ make_sp()

MatrixOperator make_sp ( World world)

◆ mask1d()

double mask1d ( double  x)

Referenced by mask3d().

◆ mask3d()

double mask3d ( const Vector< double, 3 > &  ruser)

References lo, mask1d(), and madness::user_to_sim().

Referenced by run().

◆ matrix_inner()

Tensor< double_complex > matrix_inner ( const std::vector< Spinor > &  bra,
const std::vector< Spinor ket 
)

◆ moments()

MatrixOperator moments ( World world,
int  axis,
int  order 
)

◆ operator*() [1/3]

template<typename T >
Spinor operator* ( const Spinor arg,
const T  fac 
)

References madness::arg().

◆ operator*() [2/3]

template<typename T >
std::vector< Spinor > operator* ( const std::vector< Spinor > &  arg,
const T  fac 
)

References madness::arg(), and copy().

◆ operator*() [3/3]

template<typename T >
Spinor operator* ( const T  fac,
const Spinor arg 
)

References madness::arg().

◆ operator+=()

std::vector< Spinor > operator+= ( std::vector< Spinor > &  left,
const std::vector< Spinor > &  right 
)

◆ operator-()

std::vector< Spinor > operator- ( const std::vector< Spinor > &  left,
const std::vector< Spinor > &  right 
)

References copy().

◆ operator-=()

std::vector< Spinor > operator-= ( std::vector< Spinor > &  left,
const std::vector< Spinor > &  right 
)

◆ orthonormalize()

template<typename AnsatzT >
void orthonormalize ( std::vector< Spinor > &  arg,
const AnsatzT  ansatz 
)

◆ orthonormalize_fock()

std::vector< Spinor > orthonormalize_fock ( const std::vector< Spinor > &  arg,
const std::vector< Spinor > &  bra,
Tensor< double_complex > &  fock 
)

◆ potn()

double potn ( double  r)

◆ run()

template<typename ansatzT >
void run ( World world,
ansatzT  ansatz,
const int  nuclear_charge,
const commandlineparser parser,
const int  nstates 
)

◆ schrodinger2dirac()

template<typename ansatzT >
std::vector< Spinor > schrodinger2dirac ( const std::vector< complex_function_3d wf,
const ansatzT &  ansatz,
const double  nuclear_charge 
)

◆ show_norms()

void show_norms ( const Spinor bra,
const Spinor ket,
const std::string &  name 
)

◆ transform()

std::vector< Spinor > transform ( World world,
const std::vector< Spinor > &  v,
const Tensor< double_complex > &  c 
)

Transforms a vector of functions according to new[i] = sum[j] old[j]*c[j,i].

Uses sparsity in the transformation matrix — set small elements to zero to take advantage of this.

References c, madness::WorldGopInterface::fence(), madness::gaxpy(), madness::World::gop, m, MADNESS_ASSERT, PROFILE_BLOCK, and v.

Referenced by orthonormalize(), and orthonormalize_fock().

◆ truncate()

std::vector< Spinor > truncate ( std::vector< Spinor arg)

References a, and madness::arg().

Variable Documentation

◆ alpha1

double alpha1 =constants::fine_structure_constant
static

◆ clight

double clight =1.0/alpha1
static

Referenced by apply_bsh(), and Spinor::truncate().

◆ debug

bool debug =false
static

◆ epsilon

double epsilon =1.e-12
static

◆ lo

double lo =1.e-7
static

Referenced by madness::cartesian_grid< NDIM >::cartesian_grid(), madness::F12Potentials::F12Potentials(), madness::GFit< T, NDIM >::GFit(), MolecularNuclearPotentialFunctor2::MolecularNuclearPotentialFunctor2(), madness::SystolicMatrixAlgorithm< T >::SystolicMatrixAlgorithm(), madness::NuclearCorrelationFactor::U1X_functor::U1X_functor(), madness::NuclearCorrelationFactor::U1X_functor::U1X_functor(), madness::NuclearCorrelationFactor::U2X_functor::U2X_functor(), madness::adq(), madness::adq1(), APPLY(), madness::APPLY(), madness::SCF::APPLY(), apply_bsh(), madness::TDHF::apply_G(), madness::FunctionImpl< T, NDIM >::autorefine_square_test(), madness::GFit< T, NDIM >::bsh_fit(), madness::GFit< T, NDIM >::bsh_fit_ndim(), madness::GFit< T, NDIM >::BSHFit(), madness::BSHOperator(), madness::BSHOperator3D(), madness::BSHOperatorPtr(), madness::BSHOperatorPtr3D(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::compute_batch_in_asymmetric_matrix(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::compute_diagonal_batch_in_symmetric_matrix(), madness::MP2::compute_gQf(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::MacroTaskExchangeSimple::compute_offdiagonal_batch_in_symmetric_matrix(), madness::GFit< T, NDIM >::CoulombFit(), madness::CoulombOperator(), madness::CoulombOperatorPtr(), cplxfunc0(), cplxfunc1(), cplxfunc2(), cplxvec0(), cplxvec1(), cplxvec2(), madness::do_adq(), Plotter::dolineplot(), Plotter::dolineplot(), draw_line(), madness::GFit< T, NDIM >::f12_fit(), madness::GFit< T, NDIM >::F12Fit(), madness::GFit< T, NDIM >::f12sq_fit(), madness::GFit< T, NDIM >::F12sqFit(), madness::GFit< T, NDIM >::F2GFit(), madness::F2GOperator(), madness::F2GOperatorPtr(), madness::GFit< T, NDIM >::FGFit(), madness::FGOperator(), madness::FGOperatorPtr(), madness::GFit< T, NDIM >::GaussFit(), madness::GaussOperator(), madness::GaussOperatorPtr(), madness::TDHF::TDHFParameters::get_ccc_parameters(), madness::GradBSHOperator(), GradBSHOperator_Joel(), madness::GradCoulombOperator(), madness::GradSlaterOperator(), madness::SCF::group_orbital_sets(), madness::DQueue< T >::grow(), madness::MP2::guess_mp1_3(), madness::TDHF::initialize(), madness::cartesian_grid< NDIM >::initialize(), iterate(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::K_large_memory(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::K_small_memory(), madness::trajectory< NDIM >::line_internal(), madness::trajectory< NDIM >::line_xyz(), madness::Localizer::localize_new(), logplot(), main(), main(), main(), make_bsh_operators(), madness::SeparatedConvolution< Q, NDIM >::make_coeff_for_operator(), make_k(), make_pts(), SurfaceMoleculeInteraction::make_surfcharge(), madness::SeparatedConvolution< Q, NDIM >::make_tt_representation(), mask3(), mask3(), mask3(), madness::mask3(), mask3d(), molresponseExchange(), madness::MP2::multiply_with_0th_order_Hamiltonian(), newK(), refop::operator()(), refop::operator()(), madness::orthonormalize_canonical(), madness::PeriodicBSHOp(), madness::PeriodicBSHOperator3D(), madness::PeriodicBSHOperatorPtr3D(), madness::PeriodicBSHOpPtr(), madness::PeriodicCoulombOp(), madness::PeriodicCoulombOpPtr(), madness::PeriodicHFExchangeOperator(), SurfaceMoleculeInteraction::perturbed_molecular_pot(), madness::XCfunctional::plot(), plot(), madness::plot_line(), madness::plot_line(), madness::plot_line(), madness::plot_line(), madness::plot_line(), madness::plot_line(), Calculation::plot_p(), madness::plot_plane(), madness::plot_plane(), madness::plot_plane(), Calculation::plot_z(), madness::PM_q(), madness::GFit< T, NDIM >::print_accuracy(), madness::GFit< T, NDIM >::prune_small_coefficients(), random_gaussian(), RandomGaussian(), realfunc0(), realfunc1(), realfunc2(), realvec0(), realvec1(), realvec2(), madness::Coulomb< T, NDIM >::reset_poisson_operator_ptr(), madness::SCF::rotate_subspace(), madness::Nemo::rotate_subspace(), madness::SCF::rotate_subspace(), run(), madness::FunctionDefaults< NDIM >::set_cubic_cell(), madness::FunctionDefaults< NDIM >::set_length_scale(), madness::FunctionFunctorInterface< T, NDIM >::set_length_scale(), set_poisson(), madness::Exchange< T, NDIM >::ExchangeImpl< T, NDIM >::set_poisson(), madness::Random::setstate(), madness::GFit< T, NDIM >::slater_fit(), madness::SlaterF12Operator(), madness::SlaterF12OperatorPtr(), madness::SlaterF12sqOperator(), madness::SlaterF12sqOperatorPtr(), madness::GFit< T, NDIM >::SlaterFit(), madness::SlaterOperator(), madness::SlaterOperatorPtr(), madness::SlaterOperatorPtr_ND(), solve(), madness::MP2::solve_coupled_equations(), madness::MP2::solve_residual_equations(), test(), test_apply_push_1d(), test_combined_operators(), test_exchange(), test_gconv(), test_gence2(), test_modified(), test_op(), test_per(), test_recursive_application(), madness::FunctionImpl< T, NDIM >::tnorm(), madness::FunctionImpl< T, NDIM >::tnorm(), and madness::FunctionImpl< T, NDIM >::tnorm().

◆ mask

◆ nucexpt

double nucexpt =3.0/nucrad
static

Referenced by main(), and potn().

◆ nucrad

double nucrad =1e-8
static

Referenced by main().

◆ shift

double shift =0.0
static

◆ use_ble

bool use_ble =false
static

Referenced by main(), and make_sp().

◆ use_bsp

bool use_bsp =false
static

Referenced by main(), and make_sp().