mpqc::lcao::gaussian::detail Namespace Reference

Classes

class  IntegralProfile
 keeps profile of integral evaluation More...
 

Typedefs

using func_offset_list = std::unordered_map< size_t, std::tuple< size_t, size_t > >
 
using Engine = libint2::Engine
 
template<typename T >
using Vector = Eigen::Matrix< T, Eigen::Dynamic, 1 >
 

Functions

bool equal (const std::array< double, 3 > &arr3, const Eigen::Vector3d &vec3)
 
std::shared_ptr< const Basisshift_basis_origin (const Basis &basis, const Vector3d &shift)
 This shifts the origin of a Basis object. More...
 
std::shared_ptr< const Basismake_sublattice_basis (const Basis &basis, const std::vector< Vector3i > &sublattice, const UnitCell &unitcell, const Vector3d &offset=Vector3d::Zero())
 This makes a union of Basis objects for a subset of unit cells of a lattice. More...
 
std::shared_ptr< const Basismake_supercell_basis (const Basis &basis, const Supercell &supercell, const UnitCell &unitcell, const Vector3d &offset=Vector3d::Zero(), const bool use_top_half=false)
 This creates a Basis for a supercell using the basis for its unit cell. More...
 
std::unordered_map< size_t, size_t > compute_shell_offset (const Basis &basis)
 This computes shell offsets for every cluster in a basis. More...
 
func_offset_list compute_func_offset_list (const ShellVec &cluster, const size_t bf_first)
 This computes cluster & basis function offsets for every shell in a cluster. More...
 
template<typename Tile , typename ComputeTile = Tile>
void set_oper (std::function< Tile(ComputeTile &&)> &op)
 interface template function More...
 
template<>
void set_oper (std::function< TA::TensorD(TA::TensorD &&)> &op)
 specialization when Tile=TA::TensorD More...
 
double l2_norm (Eigen::Map< const RowMatrixXd > const &map)
 
double inf_norm (Eigen::Map< const RowMatrixXd > const &map)
 
const std::vector< Engine::compute2_ptr_type > & libint2_compute2_ptrs (const Engine &engine)
 
void compute_screening_statistics (bool onoff)
 
bool compute_screening_statistics ()
 
void set_eng_precision (Engine &eng)
 
template<typename... Shells>
std::enable_if_t<(std::is_same_v< std::decay_t< Shells >, Shell > &&...), void > shell_set (Engine &e, Shells &&...shells)
 
template<typename... Shells>
std::enable_if_t<(std::is_same_v< std::decay_t< Shells >, Shell > &&...), void > shell_set (Engine &e, const libint2::ShellPair *, Shells &&...shells)
 
template<typename... Shells>
std::enable_if_t<(std::is_same_v< std::decay_t< Shells >, Shell > &&...), void > shell_set (Engine &e, const libint2::ShellPair *sp0, const libint2::ShellPair *sp1, Shells &&...shells)
 
template<typename Tile >
Tile integral_kernel (Engine &eng, typename Tile::range_type &&rng, std::array< ShellVec const *, 2 > shell_ptrs, Screener const &screen, const math::PetiteList &plist, const shellpair_data_accessor_t &bra_shellpair_accessor, const shellpair_data_accessor_t &ket_shellpair_accessor)
 
template<typename Tile >
Tile integral_kernel (Engine &eng, typename Tile::range_type &&rng, std::array< ShellVec const *, 3 > shell_ptrs, Screener const &screen, const math::PetiteList &plist, const shellpair_data_accessor_t &bra_shellpair_accessor, const shellpair_data_accessor_t &ket_shellpair_accessor)
 
template<typename Tile >
Tile integral_kernel (Engine &eng, typename Tile::range_type &&rng, std::array< ShellVec const *, 4 > shell_ptrs, Screener const &screen, const math::PetiteList &plist, const shellpair_data_accessor_t &bra_shellpair_accessor, const shellpair_data_accessor_t &ket_shellpair_accessor)
 
template<typename Tile , libint2::Operator libint2_oper>
std::array< Tile, libint2::operator_traits< libint2_oper >::nopers > integral_kernel (Engine &eng, typename Tile::range_type &&rng, std::array< ShellVec const *, 2 > shell_ptrs, Screener const &screen, const math::PetiteList &plist, const shellpair_data_accessor_t &bra_shellpair_accessor, const shellpair_data_accessor_t &ket_shellpair_accessor)
 This computes an std::array of integrals for operators that have nopers components, e.g. multipole moments, geometrical derivatives, etc. Note that only one tile is computed for each component, and all nopers tiles share the same index and range. More...
 
std::shared_ptr< const Basiscreate_unit_basis ()
 create a unit basis that only has a unit shell More...
 
template<typename Tile , typename Policy , typename array_type = TA::DistArray<Tile, Policy>>
array_type take_row_from_2D_array (const TA::DistArray< Tile, Policy > &matrix, int64_t row_idx)
 take row from a 2-d array and form a 1-d array More...
 
template<typename Tile , typename Policy , typename TArray = TA::DistArray<Tile, Policy>>
TArray take_col_from_2D_array (const TA::DistArray< Tile, Policy > &matrix, int64_t col_idx)
 take col from a 2-d array and form a 1-d array More...
 

Variables

double integral_engine_precision = 0.0
 
std::shared_ptr< IntegralProfiletotal_ints_profile
 profile of all integrals for which compute was considered before screening More...
 
std::shared_ptr< IntegralProfilecomputed_ints_profile
 profile of all integrals for which compute was invoked More...
 
std::shared_ptr< IntegralProfilenonzero_ints_profile
 profile of all integrals for which compute returned nonzero More...
 
std::shared_ptr< IntegralProfileunderscreened_ints_profile
 profile of integrals below the screening threshold that were evaluated More...
 

Typedef Documentation

◆ Engine

using mpqc::lcao::gaussian::detail::Engine = typedef libint2::Engine

◆ func_offset_list

using mpqc::lcao::gaussian::detail::func_offset_list = typedef std::unordered_map<size_t, std::tuple<size_t, size_t> >

◆ Vector

template<typename T >
using mpqc::lcao::gaussian::detail::Vector = typedef Eigen::Matrix<T, Eigen::Dynamic, 1>

Function Documentation

◆ compute_func_offset_list()

func_offset_list mpqc::lcao::gaussian::detail::compute_func_offset_list ( const ShellVec cluster,
const size_t  bf_first 
)

This computes cluster & basis function offsets for every shell in a cluster.

Parameters
clustera cluster (a.k.a. std::vector<Shell>)
bf_firstbasis function index of the first function in this cluster
Returns
a list of <key, mapped value> pairs with key: shell index mapped value: {cluster function offset, basis function offset} tuple

◆ compute_screening_statistics() [1/2]

bool mpqc::lcao::gaussian::detail::compute_screening_statistics ( )

◆ compute_screening_statistics() [2/2]

void mpqc::lcao::gaussian::detail::compute_screening_statistics ( bool  onoff)

◆ compute_shell_offset()

std::unordered_map< size_t, size_t > mpqc::lcao::gaussian::detail::compute_shell_offset ( const Basis basis)

This computes shell offsets for every cluster in a basis.

Parameters
basis
Returns
a list of <key, mapped value> pairs with key: cluster index mapped value: index of first shell in a cluster

◆ create_unit_basis()

std::shared_ptr< const Basis > mpqc::lcao::gaussian::detail::create_unit_basis ( )

create a unit basis that only has a unit shell

◆ equal()

bool mpqc::lcao::gaussian::detail::equal ( const std::array< double, 3 > &  arr3,
const Eigen::Vector3d &  vec3 
)

◆ inf_norm()

double mpqc::lcao::gaussian::detail::inf_norm ( Eigen::Map< const RowMatrixXd > const &  map)
inline

◆ integral_kernel() [1/4]

template<typename Tile >
Tile mpqc::lcao::gaussian::detail::integral_kernel ( Engine eng,
typename Tile::range_type &&  rng,
std::array< ShellVec const *, 2 >  shell_ptrs,
Screener const &  screen,
const math::PetiteList &  plist,
const shellpair_data_accessor_t bra_shellpair_accessor,
const shellpair_data_accessor_t ket_shellpair_accessor 
)

◆ integral_kernel() [2/4]

template<typename Tile , libint2::Operator libint2_oper>
std::array<Tile, libint2::operator_traits<libint2_oper>::nopers> mpqc::lcao::gaussian::detail::integral_kernel ( Engine eng,
typename Tile::range_type &&  rng,
std::array< ShellVec const *, 2 >  shell_ptrs,
Screener const &  screen,
const math::PetiteList &  plist,
const shellpair_data_accessor_t bra_shellpair_accessor,
const shellpair_data_accessor_t ket_shellpair_accessor 
)

This computes an std::array of integrals for operators that have nopers components, e.g. multipole moments, geometrical derivatives, etc. Note that only one tile is computed for each component, and all nopers tiles share the same index and range.

Template Parameters
Tilea (contiguous) tensor type to store the result
libint2_operlibint2 operator type
Parameters
englibint2 Engine type
rngrange of the target tile
shell_ptrsarray of shell clusters c1 and c2 as in <c1|O|c2>
screenScreener
plist
Returns

◆ integral_kernel() [3/4]

template<typename Tile >
Tile mpqc::lcao::gaussian::detail::integral_kernel ( Engine eng,
typename Tile::range_type &&  rng,
std::array< ShellVec const *, 3 >  shell_ptrs,
Screener const &  screen,
const math::PetiteList &  plist,
const shellpair_data_accessor_t bra_shellpair_accessor,
const shellpair_data_accessor_t ket_shellpair_accessor 
)

◆ integral_kernel() [4/4]

template<typename Tile >
Tile mpqc::lcao::gaussian::detail::integral_kernel ( Engine eng,
typename Tile::range_type &&  rng,
std::array< ShellVec const *, 4 >  shell_ptrs,
Screener const &  screen,
const math::PetiteList &  plist,
const shellpair_data_accessor_t bra_shellpair_accessor,
const shellpair_data_accessor_t ket_shellpair_accessor 
)

◆ l2_norm()

double mpqc::lcao::gaussian::detail::l2_norm ( Eigen::Map< const RowMatrixXd > const &  map)
inline

◆ libint2_compute2_ptrs()

const std::vector< Engine::compute2_ptr_type > & mpqc::lcao::gaussian::detail::libint2_compute2_ptrs ( const Engine engine)

◆ make_sublattice_basis()

std::shared_ptr<const Basis> mpqc::lcao::gaussian::detail::make_sublattice_basis ( const Basis basis,
const std::vector< Vector3i > &  sublattice,
const UnitCell unitcell,
const Vector3d offset = Vector3d::Zero() 
)

This makes a union of Basis objects for a subset of unit cells of a lattice.

Parameters
basisthe Basis of the unit cell
sublatticea subset of the lattice (given as a vector of lattice indices) to include
unitcellthe unit cell
offsetan offset to add to all vectors lattice vectors
Returns
the shared pointer of the compound Basis object

◆ make_supercell_basis()

std::shared_ptr< const Basis > mpqc::lcao::gaussian::detail::make_supercell_basis ( const Basis basis,
const Supercell supercell,
const UnitCell unitcell,
const Vector3d offset = Vector3d::Zero(),
const bool  use_top_half = false 
)

This creates a Basis for a supercell using the basis for its unit cell.

Parameters
basisthe Basis of the unit cell
supercellthe supercell
unitcellthe unit cell
offsetan offset to add to all vectors lattice vectors
use_top_halftrue if only top half of the supercell is needed
Returns
the shared pointer of the compound Basis object

◆ set_eng_precision()

void mpqc::lcao::gaussian::detail::set_eng_precision ( Engine eng)
inline

◆ set_oper() [1/2]

template<>
void mpqc::lcao::gaussian::detail::set_oper ( std::function< TA::TensorD(TA::TensorD &&)> &  op)
inline

specialization when Tile=TA::TensorD

◆ set_oper() [2/2]

template<typename Tile , typename ComputeTile = Tile>
void mpqc::lcao::gaussian::detail::set_oper ( std::function< Tile(ComputeTile &&)> &  op)
inline

interface template function

◆ shell_set() [1/3]

template<typename... Shells>
std::enable_if_t<(std::is_same_v<std::decay_t<Shells>, Shell> && ...), void> mpqc::lcao::gaussian::detail::shell_set ( Engine e,
const libint2::ShellPair *  ,
Shells &&...  shells 
)
inline

◆ shell_set() [2/3]

template<typename... Shells>
std::enable_if_t<(std::is_same_v<std::decay_t<Shells>, Shell> && ...), void> mpqc::lcao::gaussian::detail::shell_set ( Engine e,
const libint2::ShellPair *  sp0,
const libint2::ShellPair *  sp1,
Shells &&...  shells 
)
inline

this is the implementation of libint2::Engine::compute()

◆ shell_set() [3/3]

template<typename... Shells>
std::enable_if_t<(std::is_same_v<std::decay_t<Shells>, Shell> && ...), void> mpqc::lcao::gaussian::detail::shell_set ( Engine e,
Shells &&...  shells 
)
inline

◆ shift_basis_origin()

std::shared_ptr< const Basis > mpqc::lcao::gaussian::detail::shift_basis_origin ( const Basis basis,
const Vector3d shift 
)

This shifts the origin of a Basis object.

Note
All functions in the basis will be shifted
Parameters
basisthe original Basis object
shiftthe 3D vector of the shift
Returns
the shared pointer of shifted Basis object

◆ take_col_from_2D_array()

template<typename Tile , typename Policy , typename TArray = TA::DistArray<Tile, Policy>>
TArray mpqc::lcao::gaussian::detail::take_col_from_2D_array ( const TA::DistArray< Tile, Policy > &  matrix,
int64_t  col_idx 
)

take col from a 2-d array and form a 1-d array

◆ take_row_from_2D_array()

template<typename Tile , typename Policy , typename array_type = TA::DistArray<Tile, Policy>>
array_type mpqc::lcao::gaussian::detail::take_row_from_2D_array ( const TA::DistArray< Tile, Policy > &  matrix,
int64_t  row_idx 
)

take row from a 2-d array and form a 1-d array

Variable Documentation

◆ computed_ints_profile

std::shared_ptr< IntegralProfile > mpqc::lcao::gaussian::detail::computed_ints_profile
Initial value:
=
std::make_shared<IntegralProfile>()

profile of all integrals for which compute was invoked

◆ integral_engine_precision

double mpqc::lcao::gaussian::detail::integral_engine_precision = 0.0

◆ nonzero_ints_profile

std::shared_ptr< IntegralProfile > mpqc::lcao::gaussian::detail::nonzero_ints_profile
Initial value:
=
std::make_shared<IntegralProfile>()

profile of all integrals for which compute returned nonzero

◆ total_ints_profile

std::shared_ptr< IntegralProfile > mpqc::lcao::gaussian::detail::total_ints_profile
Initial value:
=
std::make_shared<IntegralProfile>()

profile of all integrals for which compute was considered before screening

◆ underscreened_ints_profile

std::shared_ptr< IntegralProfile > mpqc::lcao::gaussian::detail::underscreened_ints_profile
Initial value:
=
std::make_shared<IntegralProfile>()

profile of integrals below the screening threshold that were evaluated