26constexpr double ev_to_ha = 0.03674932217565499;
30 auto add = [&](
const std::string& el,
int l,
double ev) {
31 eps_[{el, l}] = ev * ev_to_ha;
98 return eps_.find({element, l}) !=
eps_.end();
102 for (
const auto& kv :
eps_) {
103 if (kv.first.first == element) {
111 auto it =
eps_.find({element, l});
112 if (it ==
eps_.end()) {
113 throw std::runtime_error(
"No exact EHT parameter for element " + element +
114 " and l=" + std::to_string(l));
120 int l,
int* used_l)
const {
122 auto exact =
eps_.find({element, l});
123 if (exact !=
eps_.end()) {
124 if (used_l !=
nullptr) {
127 return exact->second;
132 throw std::runtime_error(
"No EHT parameters available for element " +
139 if (
Has(element, 2)) {
140 if (used_l !=
nullptr) {
143 return Get(element, 2);
145 if (
Has(element, 1)) {
146 if (used_l !=
nullptr) {
149 return Get(element, 1);
151 if (
Has(element, 0)) {
152 if (used_l !=
nullptr) {
155 return Get(element, 0);
161 if (
Has(element, 0)) {
162 if (used_l !=
nullptr) {
165 return Get(element, 0);
171 for (
int ll = 6; ll >= 0; --ll) {
172 if (
Has(element, ll)) {
173 if (used_l !=
nullptr) {
176 return Get(element, ll);
180 throw std::runtime_error(
"No usable EHT fallback parameter for element " +
181 element +
" and l=" + std::to_string(l));
double Get(const std::string &element, int l) const
std::map< std::pair< std::string, int >, double > eps_
double GetWithFallback(const std::string &element, int l, int *used_l=nullptr) const
bool HasElement(const std::string &element) const
ExtendedHuckelParameters()
bool Has(const std::string &element, int l) const
Charge transport classes.
Provides a means for comparing floating point numbers.