mpqc::pbc::ma::MA_CFFLatticeSum< Factory > Class Template Reference

Documentation

template<typename Factory>
class mpqc::pbc::ma::MA_CFFLatticeSum< Factory >

This class computes the contribution to the Coulomb lattice sum from unit cells in Crystal Far Field (CFF) using multipole approximation.

Template Parameters
Factorya periodic AO factory object; only pbc::AOFactory is supported

Classes

struct  LMPair
 
struct  MSet
 container of values for each m for a given L More...
 

Public Types

using TArray = typename Factory::TArray
 
using Tile = typename TArray::value_type
 
using Policy = typename TArray::policy_type
 
using Shell = ::mpqc::lcao::gaussian::Shell
 
using Basis = ::mpqc::lcao::gaussian::Basis
 
using Ord2lmMap = std::vector< LMPair >
 
using UnitCellList = std::vector< std::pair< Vector3i, Vector3d > >
 
using MMType = ma::MultipoleMomentsType
 
template<typename T , unsigned int lmax = LMAX>
using MultipoleMoments = ma::MultipoleMoments< T, MMType::o, lmax >
 
template<typename T , unsigned int lmax = LMAX>
using MultipoleMomentsP = ma::MultipoleMoments< T, MMType::o_plus, lmax >
 
template<typename T , unsigned int lmax = LMAX>
using MultipoleMomentsM = ma::MultipoleMoments< T, MMType::o_minus, lmax >
 
template<typename T , unsigned int lmax = LMAX>
using MultipoleMomentsPM = ma::MultipoleMoments< T, MMType::o_plusminus, lmax >
 
template<typename T >
using eQMoment = std::array< T, 10 >
 
template<typename T , unsigned int lmax = LMAX>
using Shell2KernelMap = std::vector< MultipoleMoments< double, 2 *LMAX > >
 
using shellpair_list_t = std::vector< std::vector< size_t > >
 
using result_type = std::tuple< TArray, std::optional< double > >
 

Public Member Functions

 MA_CFFLatticeSum (Factory &ao_factory, bool df=false)
 This constructs PeriodicMA using a Factory object. More...
 
decltype(sphemm_) const & sphemm () const
 
decltype(sphemm_df_) const & sphemm_df () const
 
decltype(eQ_) const & eQ () const
 
decltype(eQ_df_) const & eQ_df () const
 
const Vector3iCFF_boundary ()
 This returns the boundary of Crystal Far Field. More...
 
template<typename T >
std::tuple< MultipoleMoments< T >, std::vector< AtomBasedClusterable >, std::vector< T > > compute_L (const MultipoleMoments< T > &O_ref, const eQMoment< T > &eQ_ref, double target_precision)
 This methods compute Coulomb interaction for the reference cell contributed from all cells in CFF using multipole approximation. Note that multipole moments will be separated into dipoles and higher-order moments for systems with large dipole moments. More...
 
result_type compute_J (const MultipoleMoments< double > &L, const std::vector< AtomBasedClusterable > &Q_cnf, const MultipoleMoments< TArray > &O_elec)
 This methods compute (obs|obs) Coulomb matrix contribution from CFF. More...
 
result_type compute_J_df (const MultipoleMoments< double > &L, const std::vector< AtomBasedClusterable > &Q_cnf, const MultipoleMoments< TArray > &O_elec)
 This methods compute (dfbs|1) Coulomb matrix contribution from CFF + surface CNF charges. More...
 
auto compute_elec_multipole_moments (const TArray &D) const
 compute electronic multipole moments for the reference unit cell More...
 
auto compute_elec_multipole_moments_df (const TArray &rho) const
 compute electronic multipole moments for the reference unit cell More...
 
bool CFF_reached () const
 This determines whether Crystal Far Field has been reached for user-specified rjmax. More...
 
bool CFF_reached (int dim) const
 This determines whether Crystal Far Field has been reached for user-specified rjmax for a given direction. More...
 
template<unsigned int lmax>
std::pair< double, MultipoleMoments< double, lmax > > solve_multipole_approx (const MultipoleMoments< double, lmax > &Oref, const MultipoleMoments< double, lmax > &Osrc)
 This computes Coulomb interaction for the reference cell contributed from all cells in CFF. Energy contribution is computed per spherical shell from the CFF boundary to the user-given rjmax unless it is converged. More...
 
CFF lattice sums evaluators

These compute contribution to the Coulomb potential generated by the CFF cells (including compensating charges on CNF surfaces) in the reference cell + the energy of its interaction with the nuclei. Up to (cartesian) quadrupole moments are compensated.

result_type compute_multipole_approx (const TArray &D, double target_precision)
 Computes CFF lattice sum for the given density matrix D (and nuclear charges). More...
 
result_type compute_multipole_approx_df (const TArray &rho, double target_precision)
 Computes CFF lattice sum for the given (fitted) density rho (and nuclear charges) More...
 
result_type compute_multipole_approx_dfrev (const TArray &D, double target_precision)
 Computes CFF lattice sum for the given (exact) density D (and nuclear charges) More...
 

Static Public Member Functions

static constexpr unsigned int number_of_multipoles (unsigned int lmax)
 
template<typename T >
static eQMoment< T > plus (const eQMoment< T > &eQ1, const eQMoment< T > &eQ2)
 

Static Public Attributes

static constexpr const libint2::Operator Oper
 
static constexpr const unsigned int LMAX = MULTIPOLE_MAX_ORDER
 
static constexpr const unsigned int NUMBER_OF_MULTIPOLES
 

Member Typedef Documentation

◆ Basis

template<typename Factory >
using mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::Basis = ::mpqc::lcao::gaussian::Basis

◆ eQMoment

template<typename Factory >
template<typename T >
using mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::eQMoment = std::array<T, 10>

◆ MMType

template<typename Factory >
using mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::MMType = ma::MultipoleMomentsType

◆ MultipoleMoments

template<typename Factory >
template<typename T , unsigned int lmax = LMAX>
using mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::MultipoleMoments = ma::MultipoleMoments<T, MMType::o, lmax>

◆ MultipoleMomentsM

template<typename Factory >
template<typename T , unsigned int lmax = LMAX>
using mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::MultipoleMomentsM = ma::MultipoleMoments<T, MMType::o_minus, lmax>

◆ MultipoleMomentsP

template<typename Factory >
template<typename T , unsigned int lmax = LMAX>
using mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::MultipoleMomentsP = ma::MultipoleMoments<T, MMType::o_plus, lmax>

◆ MultipoleMomentsPM

template<typename Factory >
template<typename T , unsigned int lmax = LMAX>
using mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::MultipoleMomentsPM = ma::MultipoleMoments<T, MMType::o_plusminus, lmax>

◆ Ord2lmMap

template<typename Factory >
using mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::Ord2lmMap = std::vector<LMPair>

◆ Policy

template<typename Factory >
using mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::Policy = typename TArray::policy_type

◆ result_type

template<typename Factory >
using mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::result_type = std::tuple<TArray, std::optional<double> >

◆ Shell

template<typename Factory >
using mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::Shell = ::mpqc::lcao::gaussian::Shell

◆ Shell2KernelMap

template<typename Factory >
template<typename T , unsigned int lmax = LMAX>
using mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::Shell2KernelMap = std::vector<MultipoleMoments<double, 2 * LMAX> >

◆ shellpair_list_t

template<typename Factory >
using mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::shellpair_list_t = std::vector<std::vector<size_t> >

◆ TArray

template<typename Factory >
using mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::TArray = typename Factory::TArray

◆ Tile

template<typename Factory >
using mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::Tile = typename TArray::value_type

◆ UnitCellList

template<typename Factory >
using mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::UnitCellList = std::vector<std::pair<Vector3i, Vector3d> >

Constructor & Destructor Documentation

◆ MA_CFFLatticeSum()

template<typename Factory >
mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::MA_CFFLatticeSum ( Factory &  ao_factory,
bool  df = false 
)
inline

This constructs PeriodicMA using a Factory object.

Parameters
ao_factorya Factory object
e_threshthreshold of multipole expansion error
wswell-separateness criterion

Member Function Documentation

◆ CFF_boundary()

template<typename Factory >
const Vector3i& mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::CFF_boundary ( )
inline

This returns the boundary of Crystal Far Field.

◆ CFF_reached() [1/2]

template<typename Factory >
bool mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::CFF_reached ( ) const
inline

This determines whether Crystal Far Field has been reached for user-specified rjmax.

Returns
true if CFF has been reached in any direction, false otherwise

◆ CFF_reached() [2/2]

template<typename Factory >
bool mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::CFF_reached ( int  dim) const
inline

This determines whether Crystal Far Field has been reached for user-specified rjmax for a given direction.

Parameters
dim0 for x direction, 1 for y direction, 2 for z direction
Returns
true if CFF has been reached in direction dim, false otherwise

◆ compute_elec_multipole_moments()

template<typename Factory >
auto mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::compute_elec_multipole_moments ( const TArray D) const
inline

compute electronic multipole moments for the reference unit cell

◆ compute_elec_multipole_moments_df()

template<typename Factory >
auto mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::compute_elec_multipole_moments_df ( const TArray rho) const
inline

compute electronic multipole moments for the reference unit cell

◆ compute_J()

template<typename Factory >
result_type mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::compute_J ( const MultipoleMoments< double > &  L,
const std::vector< AtomBasedClusterable > &  Q_cnf,
const MultipoleMoments< TArray > &  O_elec 
)
inline

This methods compute (obs|obs) Coulomb matrix contribution from CFF.

  • surface CNF charges.
    Returns

◆ compute_J_df()

template<typename Factory >
result_type mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::compute_J_df ( const MultipoleMoments< double > &  L,
const std::vector< AtomBasedClusterable > &  Q_cnf,
const MultipoleMoments< TArray > &  O_elec 
)
inline

This methods compute (dfbs|1) Coulomb matrix contribution from CFF + surface CNF charges.

Returns

◆ compute_L()

template<typename Factory >
template<typename T >
std::tuple<MultipoleMoments<T>, std::vector<AtomBasedClusterable>, std::vector<T> > mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::compute_L ( const MultipoleMoments< T > &  O_ref,
const eQMoment< T > &  eQ_ref,
double  target_precision 
)
inline

This methods compute Coulomb interaction for the reference cell contributed from all cells in CFF using multipole approximation. Note that multipole moments will be separated into dipoles and higher-order moments for systems with large dipole moments.

Returns
{L, R_cnf, Q_cnf}, with L the CFF contribution to the multipole expansion of the coulomb potential in the reference cell, R_cnf and Q_cnf the Cartesian coordinates and charges of the CNF surface compensating charges

◆ compute_multipole_approx()

template<typename Factory >
result_type mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::compute_multipole_approx ( const TArray D,
double  target_precision 
)
inline

Computes CFF lattice sum for the given density matrix D (and nuclear charges).

Parameters
Dthe 1-RDM
target_precisionthe target precision
Returns
{Coulomb potential matrix, energy of its interaction with the nuclei}

◆ compute_multipole_approx_df()

template<typename Factory >
result_type mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::compute_multipole_approx_df ( const TArray rho,
double  target_precision 
)
inline

Computes CFF lattice sum for the given (fitted) density rho (and nuclear charges)

Parameters
rhothe (fitted) charge density
target_precisionthe target precision
Returns
{Coulomb potential matrix, energy of its interaction with the nuclei}

◆ compute_multipole_approx_dfrev()

template<typename Factory >
result_type mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::compute_multipole_approx_dfrev ( const TArray D,
double  target_precision 
)
inline

Computes CFF lattice sum for the given (exact) density D (and nuclear charges)

Parameters
Dthe (exact) charge density
target_precisionthe target precision
Returns
{Coulomb potential matrix in DF basis, energy of its interaction with the nuclei}

◆ eQ()

template<typename Factory >
decltype(eQ_) const& mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::eQ ( ) const
inline

◆ eQ_df()

template<typename Factory >
decltype(eQ_df_) const& mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::eQ_df ( ) const
inline

◆ number_of_multipoles()

template<typename Factory >
static constexpr unsigned int mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::number_of_multipoles ( unsigned int  lmax)
inlinestaticconstexpr

◆ plus()

template<typename Factory >
template<typename T >
static eQMoment<T> mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::plus ( const eQMoment< T > &  eQ1,
const eQMoment< T > &  eQ2 
)
inlinestatic

◆ solve_multipole_approx()

template<typename Factory >
template<unsigned int lmax>
std::pair<double, MultipoleMoments<double, lmax> > mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::solve_multipole_approx ( const MultipoleMoments< double, lmax > &  Oref,
const MultipoleMoments< double, lmax > &  Osrc 
)
inline

This computes Coulomb interaction for the reference cell contributed from all cells in CFF. Energy contribution is computed per spherical shell from the CFF boundary to the user-given rjmax unless it is converged.

Template Parameters
lmax
nopers
nopers_doubled_lmax
Parameters
Orefmultipole moments of the reference cell
Osrcmultipole moments of the cells generating the Coulomb potential
Returns
std::tuple containing the interaction energy of CFF with Oref and the inner multipoles of the potential in the reference cell
Note
this is not collective, should be executed on 1 rank and broadcast
Warning
this is not bitwise reproducibile (due to task decomposition),

◆ sphemm()

template<typename Factory >
decltype(sphemm_) const& mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::sphemm ( ) const
inline

◆ sphemm_df()

template<typename Factory >
decltype(sphemm_df_) const& mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::sphemm_df ( ) const
inline

Member Data Documentation

◆ LMAX

template<typename Factory >
constexpr const unsigned int mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::LMAX = MULTIPOLE_MAX_ORDER
staticconstexpr

◆ NUMBER_OF_MULTIPOLES

template<typename Factory >
constexpr const unsigned int mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::NUMBER_OF_MULTIPOLES
staticconstexpr
Initial value:

◆ Oper

template<typename Factory >
constexpr const libint2::Operator mpqc::pbc::ma::MA_CFFLatticeSum< Factory >::Oper
staticconstexpr
Initial value:
=
libint2::Operator::sphemultipole

The documentation for this class was generated from the following files:
  • mpqc/chemistry/qc/lcao/scf/fwd.h
  • mpqc/chemistry/qc/lcao/scf/pbc/ma.h
static constexpr const unsigned int LMAX
Definition: ma.h:440
static constexpr unsigned int number_of_multipoles(unsigned int lmax)
Definition: ma.h:441