|
Quantum 3xplorer (Q3)
An AI-native quantum simulation engine
|
#include <martyna_tuckerman.hpp>
Inheritance diagram for q3::MartynaTuckermanCorrectionCalculator:Public Member Functions | |
| IsolatedSystemCorrectionResult | compute (const NormConservingPlanewaveKohnShamSCFState &scf_state) const override |
| std::string | name () const override |
| Scheme name as accepted by the input ("none", "makov-payne", ...). | |
Public Member Functions inherited from q3::IsolatedSystemCorrectionCalculator | |
| virtual | ~IsolatedSystemCorrectionCalculator ()=default |
Definition at line 186 of file martyna_tuckerman.hpp.
|
inlineoverridevirtual |
Evaluate the correction on a converged SCF state. Schemes that have geometric preconditions (Makov-Payne: cubic lattice) throw std::runtime_error before touching any density data when violated.
x0 = valence-charge-weighted ionic center (alat units), same convention as MakovPayneCorrectionCalculator.
Cheap locality-validity radius: half the shortest lattice vector, in Bohr. That is exactly the region the parallelepiped proxy and the true Wigner-Seitz distance share for an ORTHOGONAL cell; for an oblique one it is optimistic (too large) – the guaranteed-exact radius there is half the smallest interplanar spacing – so the warning can stay silent on a density that already reaches points where the proxy is wrong. See the class docstring's "VALIDITY ASSUMPTION" section.
Sweep this rank's part of the dense grid, asking the grid where each local point sits. The local kernel and density arrays are exactly the input layout required by the serial or distributed rho_r_to_g FFT.
Forward-FFT both the kernel-construction array and the (spin-summed) electron density onto the same charge-density G-vector set (PlanewaveBasis::g_vectors()).
Gamma-only half-sphere: each G != 0 represents both G and -G, and |rho(-G)|^2 = |rho(G)|^2 by Hermitian symmetry, so double the contribution – matches compute_ewald()/compute_hartree_potential()'s own convention. G=0 (g_index < first_nonzero_g_index) is never doubled: it has no separate -G partner.
Implements q3::IsolatedSystemCorrectionCalculator.
Definition at line 189 of file martyna_tuckerman.hpp.
References q3::IsolatedSystemCorrectionResult::applied, q3::Crystal::cell_volume(), q3::PlanewaveBasis::charge_density_energy_cutoff(), q3::PlanewaveKohnShamSCFState::charge_density_real, q3::compute_phase_factor(), q3::Crystal::convert_from_crystal_to_cartesian(), q3::PlanewaveKohnShamSCFState::crystal_structure, q3::Vector3D::dot(), q3::constants::electron_charge_squared_rydberg, q3::PlanewaveKohnShamSCFState::execution_policy, q3::PlanewaveBasis::fft_rho(), q3::PlanewaveBasis::first_nonzero_g_index(), q3::GVector::g_cart, q3::PlanewaveBasis::g_vectors(), q3::FFTGrid::global_real_space_index(), q3::FFTGrid::grid_dimension_1(), q3::FFTGrid::grid_dimension_2(), q3::FFTGrid::grid_dimension_3(), q3::Matrix3x3::inverse(), q3::PlanewaveBasis::is_gamma_only(), q3::Crystal::lattice_parameter(), q3::Crystal::lattice_vectors(), q3::FFTGrid::local_grid_points(), q3::GVector::magnitude_squared, q3::IsolatedSystemCorrectionResult::method, name(), q3::Crystal::number_of_atoms(), q3::PlanewaveBasis::number_of_g_vectors(), q3::PlanewaveKohnShamSCFState::planewave_basis, q3::execution::PlanewaveExecutionPolicy::reduce_within_pool_vector(), q3::PlanewaveBasis::rho_r_to_g(), q3::Crystal::species_type_index(), q3::IsolatedSystemCorrectionResult::terms_in_ry, q3::Matrix3x3::transpose(), q3::constants::two_pi, q3::Crystal::two_pi_over_lattice_parameter_squared(), q3::Crystal::valence_charge(), and q3::log::warn().
|
inlineoverridevirtual |
Scheme name as accepted by the input ("none", "makov-payne", ...).
Implements q3::IsolatedSystemCorrectionCalculator.
Definition at line 376 of file martyna_tuckerman.hpp.
Referenced by compute().