Loading...
Searching...
No Matches
q3::constants Namespace Reference

Variables

constexpr Real ANGSTROM_TO_BOHR = 1.0 / BOHR_RADIUS_ANGSTROM
 Ångström → Bohr (ANGSTROM_AU)
 
constexpr Real ATOMIC_MASS_UNIT_RY = ATOMIC_MASS_UNIT_SI / ELECTRON_MASS_SI / 2.0
 AMU → Rydberg atomic units (AMU_RY)
 
constexpr Real ATOMIC_MASS_UNIT_SI = 1.66053906660e-27
 
constexpr Real BOHR_RADIUS_ANGSTROM = BOHR_RADIUS_SI * 1.0e10
 Bohr radius in Ångströms (BOHR_RADIUS_SI * 1e10; BOHR_RADIUS_ANGSTROM)
 
constexpr Real BOHR_RADIUS_SI = 0.529177210903e-10
 
constexpr Real BOLTZMANN_CONSTANT_RY = BOLTZMANN_CONSTANT_SI / RYDBERG_SI
 Boltzmann constant in Rydberg units (K_BOLTZMANN_RY)
 
constexpr Real BOLTZMANN_CONSTANT_SI = 1.380649e-23
 
constexpr Real default_starting_magnetization = 0.2
 
constexpr Real degrees_to_radians = pi / 180.0
 
constexpr Real ELECTRON_CHARGE_SI = 1.602176634e-19
 
constexpr Real electron_charge_squared_rydberg = 2.0
 
constexpr Real ELECTRON_MASS_SI = 9.1093837015e-31
 
constexpr Real ELECTRONVOLT_SI = 1.602176634e-19
 
constexpr Real epsilon_1e_minus_12 = 1.0e-12
 
constexpr Real epsilon_1e_minus_14 = 1.0e-14
 
constexpr Real epsilon_1e_minus_16 = 1.0e-16
 
constexpr Real epsilon_1e_minus_4 = 1.0e-4
 
constexpr Real epsilon_1e_minus_6 = 1.0e-6
 
constexpr Real epsilon_1e_minus_8 = 1.0e-8
 
constexpr Real four_pi = 4.0 * pi
 
constexpr Real HARTREE_SI = 4.3597447222071e-18
 
constexpr Real HARTREE_TO_EV = HARTREE_SI / ELECTRONVOLT_SI
 Hartree → eV (AUTOEV)
 
constexpr Real hubbard_anderson_secant_minimum_denominator = 1e-24
 
constexpr Real hubbard_anderson_theta_limit = 0.9
 
constexpr int hubbard_damping_trigger_iterations = 3
 
constexpr int non_self_consistent_field_maximum_davidson_iterations = 200
 
constexpr int non_self_consistent_field_minimum_davidson_basis_expansion_factor = 4
 
constexpr Real pi = 3.14159265358979323846
 
constexpr Real PLANCK_CONSTANT_SI = 6.62607015e-34
 
constexpr Real RY_TO_EV = HARTREE_TO_EV / 2.0
 
constexpr Real RYDBERG_SI = HARTREE_SI / 2.0
 
constexpr Real RYDBERG_TO_KILOBAR
 Rydberg → kbar (RY_KBAR): 10 * AU_GPA / 2.
 
constexpr Real SPEED_OF_LIGHT_SI = 2.99792458e+8
 
constexpr Real spin_degeneracy = 2.0
 
constexpr Real sqrt2 = 1.41421356237309504880
 
constexpr Real sqrt_pi = 1.77245385090551602729
 
constexpr Real two_pi = 2.0 * pi
 

Variable Documentation

◆ ANGSTROM_TO_BOHR

constexpr Real q3::constants::ANGSTROM_TO_BOHR = 1.0 / BOHR_RADIUS_ANGSTROM
inlineconstexpr

Ångström → Bohr (ANGSTROM_AU)

Definition at line 140 of file constants.hpp.

Referenced by q3::Wannier90Exporter::export_to_directory(), q3::import_wannier90_files(), and q3::CubeVolumetricFieldReader::read().

◆ ATOMIC_MASS_UNIT_RY

constexpr Real q3::constants::ATOMIC_MASS_UNIT_RY = ATOMIC_MASS_UNIT_SI / ELECTRON_MASS_SI / 2.0
inlineconstexpr

AMU → Rydberg atomic units (AMU_RY)

Definition at line 143 of file constants.hpp.

◆ ATOMIC_MASS_UNIT_SI

constexpr Real q3::constants::ATOMIC_MASS_UNIT_SI = 1.66053906660e-27
inlineconstexpr

Definition at line 121 of file constants.hpp.

◆ BOHR_RADIUS_ANGSTROM

constexpr Real q3::constants::BOHR_RADIUS_ANGSTROM = BOHR_RADIUS_SI * 1.0e10
inlineconstexpr

Bohr radius in Ångströms (BOHR_RADIUS_SI * 1e10; BOHR_RADIUS_ANGSTROM)

Definition at line 137 of file constants.hpp.

Referenced by q3::build_material_json(), q3::Wannier90Exporter::export_to_directory(), q3::import_wannier90_files(), q3::YAMLInputParser::parse_material(), and q3::XsfVolumetricFieldWriter::write().

◆ BOHR_RADIUS_SI

constexpr Real q3::constants::BOHR_RADIUS_SI = 0.529177210903e-10
inlineconstexpr

Definition at line 120 of file constants.hpp.

◆ BOLTZMANN_CONSTANT_RY

constexpr Real q3::constants::BOLTZMANN_CONSTANT_RY = BOLTZMANN_CONSTANT_SI / RYDBERG_SI
inlineconstexpr

Boltzmann constant in Rydberg units (K_BOLTZMANN_RY)

Definition at line 150 of file constants.hpp.

◆ BOLTZMANN_CONSTANT_SI

constexpr Real q3::constants::BOLTZMANN_CONSTANT_SI = 1.380649e-23
inlineconstexpr

Definition at line 114 of file constants.hpp.

◆ default_starting_magnetization

constexpr Real q3::constants::default_starting_magnetization = 0.2
inlineconstexpr

Starting magnetization applied to every species when a spin-polarized (LSDA) run gives no starting_magnetization at all: large enough to break spin symmetry so a magnetic ground state can be found, small enough not to bias the SCF toward an artificial high-moment minimum. Explicit user values — including explicit zeros — are always honored instead.

Definition at line 43 of file constants.hpp.

Referenced by q3::PlanewavePseudopotentialKohnShamSCFIterator::effective_species_magnetizations().

◆ degrees_to_radians

constexpr Real q3::constants::degrees_to_radians = pi / 180.0
inlineconstexpr

Definition at line 29 of file constants.hpp.

Referenced by q3::get_lattice_vectors_from_cell_parameters().

◆ ELECTRON_CHARGE_SI

constexpr Real q3::constants::ELECTRON_CHARGE_SI = 1.602176634e-19
inlineconstexpr

Definition at line 115 of file constants.hpp.

◆ electron_charge_squared_rydberg

◆ ELECTRON_MASS_SI

constexpr Real q3::constants::ELECTRON_MASS_SI = 9.1093837015e-31
inlineconstexpr

Definition at line 117 of file constants.hpp.

◆ ELECTRONVOLT_SI

constexpr Real q3::constants::ELECTRONVOLT_SI = 1.602176634e-19
inlineconstexpr

Definition at line 116 of file constants.hpp.

◆ epsilon_1e_minus_12

constexpr Real q3::constants::epsilon_1e_minus_12 = 1.0e-12
inlineconstexpr

Definition at line 156 of file constants.hpp.

◆ epsilon_1e_minus_14

constexpr Real q3::constants::epsilon_1e_minus_14 = 1.0e-14
inlineconstexpr

Definition at line 157 of file constants.hpp.

◆ epsilon_1e_minus_16

constexpr Real q3::constants::epsilon_1e_minus_16 = 1.0e-16
inlineconstexpr

Definition at line 158 of file constants.hpp.

◆ epsilon_1e_minus_4

constexpr Real q3::constants::epsilon_1e_minus_4 = 1.0e-4
inlineconstexpr

Definition at line 153 of file constants.hpp.

◆ epsilon_1e_minus_6

constexpr Real q3::constants::epsilon_1e_minus_6 = 1.0e-6
inlineconstexpr

Definition at line 154 of file constants.hpp.

◆ epsilon_1e_minus_8

constexpr Real q3::constants::epsilon_1e_minus_8 = 1.0e-8
inlineconstexpr

Definition at line 155 of file constants.hpp.

◆ four_pi

◆ HARTREE_SI

constexpr Real q3::constants::HARTREE_SI = 4.3597447222071e-18
inlineconstexpr

Definition at line 118 of file constants.hpp.

◆ HARTREE_TO_EV

constexpr Real q3::constants::HARTREE_TO_EV = HARTREE_SI / ELECTRONVOLT_SI
inlineconstexpr

Hartree → eV (AUTOEV)

─── Derived unit conversion factors ──────────────────────────────────────── Each is a dimensional identity over the SI values above, evaluated in IEEE-754 double at compile time. The names in parentheses are the corresponding Quantum ESPRESSO constants, given only so a reader can cross-check a value against a published number; they are labels, not the source of the definitions.

Definition at line 134 of file constants.hpp.

Referenced by q3::QEInputParser::parse().

◆ hubbard_anderson_secant_minimum_denominator

constexpr Real q3::constants::hubbard_anderson_secant_minimum_denominator = 1e-24
inlineconstexpr

Smallest |r - r_prev|^2 for which an Anderson secant step is trusted.

Two nearly identical residuals make the secant denominator vanish and the extrapolation coefficient explode; below this the step degrades to plain damping, which is slower but never wild. Kept beside the other DFT+U mixing knobs so tuning the occupation mixer means reading one place, not two.

Definition at line 107 of file constants.hpp.

Referenced by q3::HubbardOccupationMixer::blend().

◆ hubbard_anderson_theta_limit

constexpr Real q3::constants::hubbard_anderson_theta_limit = 0.9
inlineconstexpr

Clamp on the Anderson extrapolation coefficient for the DFT+U occupation matrix.

The two-point secant is exact only where the residual map is locally linear. Away from that it can ask for an arbitrarily long step, so the coefficient is bounded: inside the bound Anderson does its work, at the bound the update is still a damped step in the descent direction rather than a leap.

Definition at line 97 of file constants.hpp.

Referenced by q3::HubbardOccupationMixer::blend().

◆ hubbard_damping_trigger_iterations

constexpr int q3::constants::hubbard_damping_trigger_iterations = 3
inlineconstexpr

How many non-monotone iterations of the DFT+U occupation matrix it takes before the SCF starts damping it.

Damping perturbs the converged answer at first order in its own lag, so it is switched on by evidence rather than by default and a monotonically converging run must never trip it. Three tolerates the isolated backward step a well-behaved run can take while the wavefunctions settle, and is reached almost immediately by a genuine oscillation, which alternates every iteration.

Definition at line 56 of file constants.hpp.

Referenced by q3::HubbardOccupationMixer::blend().

◆ non_self_consistent_field_maximum_davidson_iterations

constexpr int q3::constants::non_self_consistent_field_maximum_davidson_iterations = 200
inlineconstexpr

How many Davidson iterations a non-self-consistent pass allows each k-point.

A self-consistent run re-diagonalizes every iteration, so the solver's own short cap only defers work to the next one. A non-self-consistent pass diagonalizes once and keeps whatever a capped solve leaves unconverged: copper's fourteen-band 4x4x4 capture takes 17 of the solver's 20 iterations at a basis four times the band count, and ran into them at twice, with up to seven bands unconverged at 48 of 140 k-point solves. The cap bounds a pathological solve; a converging one exits as soon as every band meets the tolerance, and one that does not is reported.

Definition at line 70 of file constants.hpp.

Referenced by q3::NonSelfConsistentFieldFlavor::run_calculation().

◆ non_self_consistent_field_minimum_davidson_basis_expansion_factor

constexpr int q3::constants::non_self_consistent_field_minimum_davidson_basis_expansion_factor = 4
inlineconstexpr

The smallest Davidson working basis, as a multiple of the band count, that a non-self-consistent pass runs with unless the deck names a factor itself.

The pass seeds each k-point from its neighbour's vectors and keeps what the solver returns. With a basis only twice the band count Davidson can settle on eigenpairs that skip a state the seed lacks, and every residual test still passes: copper's sixteen-band NSCF against direct diagonalization of the same Hamiltonian has band 16 1.18 eV high at one k-point at a factor of 2 – a state skipped – and more than 1 meV off at 15 of 64, against 1.2 meV at one k-point at 4. A self-consistent run re-diagonalizes every iteration and recovers, so the smaller default stays there; a deck that names a smaller factor keeps it for the pass too, and is warned.

Definition at line 86 of file constants.hpp.

Referenced by q3::non_self_consistent_field_davidson_basis_expansion_factor(), and q3::NonSelfConsistentFieldFlavor::run_calculation().

◆ pi

◆ PLANCK_CONSTANT_SI

constexpr Real q3::constants::PLANCK_CONSTANT_SI = 6.62607015e-34
inlineconstexpr

─── Physical constants, SI (NIST 2018 CODATA) ───────────────────────────── Identical to the values Quantum ESPRESSO uses.

Definition at line 113 of file constants.hpp.

◆ RY_TO_EV

constexpr Real q3::constants::RY_TO_EV = HARTREE_TO_EV / 2.0
inlineconstexpr

Definition at line 161 of file constants.hpp.

Referenced by q3::BerkeleyGWExchangeCorrelationFile::write_to_file().

◆ RYDBERG_SI

constexpr Real q3::constants::RYDBERG_SI = HARTREE_SI / 2.0
inlineconstexpr

Definition at line 119 of file constants.hpp.

◆ RYDBERG_TO_KILOBAR

constexpr Real q3::constants::RYDBERG_TO_KILOBAR
inlineconstexpr
Initial value:
=
10.0 * (HARTREE_SI / (BOHR_RADIUS_SI * BOHR_RADIUS_SI * BOHR_RADIUS_SI) / 1.0e9) / 2.0
constexpr Real BOHR_RADIUS_SI
constexpr Real HARTREE_SI

Rydberg → kbar (RY_KBAR): 10 * AU_GPA / 2.

Definition at line 146 of file constants.hpp.

Referenced by q3::assemble_total_stress_and_log().

◆ SPEED_OF_LIGHT_SI

constexpr Real q3::constants::SPEED_OF_LIGHT_SI = 2.99792458e+8
inlineconstexpr

Definition at line 122 of file constants.hpp.

◆ spin_degeneracy

constexpr Real q3::constants::spin_degeneracy = 2.0
inlineconstexpr

Definition at line 33 of file constants.hpp.

◆ sqrt2

constexpr Real q3::constants::sqrt2 = 1.41421356237309504880
inlineconstexpr

Definition at line 28 of file constants.hpp.

◆ sqrt_pi

constexpr Real q3::constants::sqrt_pi = 1.77245385090551602729
inlineconstexpr

Definition at line 27 of file constants.hpp.

◆ two_pi