1 // 2 // BAGEL - Brilliantly Advanced General Electronic Structure Library 3 // Filename: constant.h 4 // Copyright (C) 2012 Toru Shiozaki 5 // 6 // Author: Shane Parker <shane.parker@u.northwestern.edu> 7 // Maintainer: NU Theory Group 8 // 9 // This file is part of the BAGEL package. 10 // 11 // This program is free software: you can redistribute it and/or modify 12 // it under the terms of the GNU General Public License as published by 13 // the Free Software Foundation, either version 3 of the License, or 14 // (at your option) any later version. 15 // 16 // This program is distributed in the hope that it will be useful, 17 // but WITHOUT ANY WARRANTY; without even the implied warranty of 18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 // GNU General Public License for more details. 20 // 21 // You should have received a copy of the GNU General Public License 22 // along with this program. If not, see <http://www.gnu.org/licenses/>. 23 // 24 25 26 #ifndef __SRC_UTIL_CONSTANTS_H 27 #define __SRC_UTIL_CONSTANTS_H 28 29 #include <cmath> 30 #include <chrono> 31 #include <stddef.h> 32 33 namespace bagel { 34 35 /************************************************************ 36 * Internal constants * 37 ************************************************************/ 38 static constexpr int ANG_HRR_END = 8; 39 static constexpr int ANG_VRR_END = 16; 40 static constexpr int RYS_MAX = 21; 41 static constexpr double PRIM_SCREEN_THRESH = 1.0e-12; 42 43 static constexpr int nucleus_blocksize__ = 500; // maximum number of point charges used in a single batch of nuclear attraction integrals 44 45 /************************************************************ 46 * Fundamental Physical/Mathematical constants * 47 ************************************************************/ 48 static const double pi__ = std::atan(1.0)*4.0; 49 static const double rad2deg__ = 180.0 / pi__; 50 static constexpr double c__ = 137.035999139; // CODATA 2014 inverse fine-structure constant 51 static constexpr double csi__ = 2.99792458e8; // CODATA 2014 speed of light in vacuum 52 static constexpr double au2kilogram__ = 9.10938356e-31; // CODATA 2014 electron rest mass 53 static constexpr double au2coulomb__ = 1.6021766208e-19; // CODATA 2014 elementary charge 54 static constexpr double au2meter__ = 5.2917721067e-11; // CODATA 2014 Bohr radius 55 static constexpr double avogadro__ = 6.022140857e23; // CODATA 2014 Avogadro constant 56 static constexpr double g_elec__ = 2.00231930436182; // Absolute value of CODATA 2014 electron g factor 57 static constexpr double amu2kilogram__ = 1.660539040e-27; // COTDATA 2014 atomic mass unit-kilogram relationship 58 static constexpr double kcal2kj__ = 4.184; // Absolute definition of thermochemical calorie 59 60 /************************************************************ 61 * Derived unit conversions * 62 ************************************************************/ 63 static const double au2second__ = c__ * au2meter__ / csi__; 64 static const double au2angstrom__ = au2meter__ * 1.0e10; 65 static const double au2joule__ = au2kilogram__ * std::pow(au2meter__ / au2second__, 2); 66 static const double au2kjmol__ = au2joule__ * avogadro__ / 1.0e3; 67 static const double au2eV__ = au2kilogram__ * au2meter__ * au2meter__ / au2second__ / au2second__ / au2coulomb__; 68 static const double au2tesla__ = au2kilogram__ / au2coulomb__ / au2second__; 69 static const double au2wavenumber__ = 1.0 / (2.0 * pi__ * c__ * au2meter__ * 100.0); 70 71 /************************************************************ 72 * Numerical constants * 73 ************************************************************/ 74 static constexpr double numerical_zero__ = 1.0e-15; 75 static constexpr unsigned int nbit__ = 64; 76 77 } 78 79 #endif 80 81