21 #ifndef INCLUDE_LIBINT2_CHEMISTRY_STO3GATOMICDENSITY_H_ 22 #define INCLUDE_LIBINT2_CHEMISTRY_STO3GATOMICDENSITY_H_ 39 template <
typename Real>
41 const auto ne_alloc = (ne > 2 * size) ? 2 * size : ne;
44 const double ne_per_orb = (ne_alloc % size == 0)
45 ? static_cast<Real>(ne_alloc / size)
46 : (static_cast<Real>(ne_alloc)) / size;
47 for (
size_t f = 0; f != size; ++f) occvec[f] = ne_per_orb;
73 throw "STO-3G basis is not defined for elements with Z > 53";
83 template <
typename Real =
double>
85 static std::vector<Real> occvec(27, 0.0);
90 auto* occs_ptr = &occvec[0];
91 auto& occs = occs_ptr;
93 size_t num_of_electrons = Z;
97 subshell_occvec(occs, 1, num_of_electrons);
99 subshell_occvec(occs, 1, num_of_electrons);
100 subshell_occvec(occs, 3, num_of_electrons);
103 subshell_occvec(occs, 1, num_of_electrons);
104 subshell_occvec(occs, 3, num_of_electrons);
106 if (18 < Z && Z <= 36) {
108 size_t num_of_4s_electrons = (Z == 19 || Z == 24 || Z == 29) ? 1 : 2;
109 num_of_electrons -= num_of_4s_electrons;
110 subshell_occvec(occs, 1, num_of_4s_electrons);
112 size_t num_of_4p_electrons =
113 std::min(
static_cast<decltype(Z)
>(6), (Z > 30) ? Z - 30 : 0);
114 num_of_electrons -= num_of_4p_electrons;
115 subshell_occvec(occs, 3, num_of_4p_electrons);
117 subshell_occvec(occs, 5, num_of_electrons);
119 if (36 < Z && Z <= 53) {
121 subshell_occvec(occs, 1, num_of_electrons);
122 subshell_occvec(occs, 3, num_of_electrons);
125 size_t num_of_5s_electrons =
126 (Z == 37 || Z == 41 || Z == 42 || Z == 44 || Z == 45 || Z == 47) ? 1
128 num_of_electrons -= num_of_5s_electrons;
129 subshell_occvec(occs, 1, num_of_5s_electrons);
131 size_t num_of_5p_electrons =
132 std::min(
static_cast<decltype(Z)
>(6), (Z > 48) ? Z - 48 : 0);
133 num_of_electrons -= num_of_5p_electrons;
134 subshell_occvec(occs, 3, num_of_5p_electrons);
136 subshell_occvec(occs, 5, num_of_electrons);
137 subshell_occvec(occs, 5, num_of_electrons);
147 #endif // INCLUDE_LIBINT2_CHEMISTRY_STO3GATOMICDENSITY_H_ Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:24
const std::vector< Real > & sto3g_ao_occupation_vector(size_t Z)
computes average orbital occupancies in the ground state of a neutral atoms
Definition: sto3g_atomic_density.h:84
size_t sto3g_num_ao(size_t Z)
Definition: sto3g_atomic_density.h:56
void subshell_occvec(Real *&occvec, size_t size, size_t &ne)
computes orbital occupation numbers for a subshell of size size created by smearing no more than ne e...
Definition: sto3g_atomic_density.h:40