|
Quantum 3xplorer (Q3)
An AI-native quantum simulation engine
|
#include <pair.hpp>
Public Member Functions | |
| FFTGrid & | fft_rho () |
| const FFTGrid & | fft_rho () const |
| FFTGrid & | fft_wave () |
| const FFTGrid & | fft_wave () const |
| const SerialFFTGrid & | fft_wave_serial () const |
| void | initialize (const FFTGridFactory &fft_grid_factory, const Crystal &crystal_structure, Real energy_cutoff_charge_density, Real energy_cutoff_wavefunction, bool use_measured_fft_planning=true, bool use_exact_wavefunction_grid=false) |
|
inline |
Definition at line 105 of file pair.hpp.
Referenced by q3::PlanewaveBasis::fft_rho(), q3::PlanewaveBasis::fft_rho(), q3::PlanewaveBasis::generate(), q3::PlanewaveBasis::rho_g_to_r(), and q3::PlanewaveBasis::rho_r_to_g().
|
inline |
|
inline |
Definition at line 111 of file pair.hpp.
Referenced by q3::PlanewaveBasis::compute_gk(), q3::PlanewaveBasis::fft_wave(), q3::PlanewaveBasis::fft_wave(), q3::PlanewaveBasis::g_to_r(), q3::PlanewaveBasis::initialize_kpoint_data(), and q3::PlanewaveBasis::r_to_g().
|
inline |
|
inline |
Serial (non-MPI) wave FFT grid for band-distributed parallelism. Identical dimensions to fft_wave() but runs locally on each rank.
Definition at line 121 of file pair.hpp.
Referenced by q3::PlanewaveBasis::fft_wave_serial().
|
inline |
| use_exact_wavefunction_grid | false (default) sizes the wavefunction grid for 2 x ecutwfc; true sizes it exactly, for 4 x ecutwfc, as pw.x does. See InputData::use_exact_wavefunction_grid. |
Rho grid uses FFTW_MEASURE by default (use_measured_fft_planning=true); pass false for bit-reproducible FFTW_ESTIMATE planning (see InputData::use_deterministic_fft_planning).
The smooth (wavefunction) FFT grid carries two products, V(r)ψ(r) and |ψ(r)|². A wavefunction holds plane waves out to G_max = sqrt(ecutwfc), so |ψ|² reaches 2 G_max, and a grid that holds the sphere of radius 2 G_max – a 4 x ecutwfc cutoff – takes both products without aliasing: |ψ|² fits whole, and any component of Vψ that wraps around lands outside the wavefunction sphere, where it is discarded. That is the exact grid, and the one pw.x builds; enlarging it changes nothing.
The default grid holds only √2 G_max (2 x ecutwfc). Parts of |ψ|² and of Vψ wrap onto components that are kept, so it is faster but approximate: harmless where the wavefunctions have little weight near the cutoff, and up to mRy off pw.x on a hard deck at a low cutoff – 9.5 mRy on a Ni/CO slab at 20 Ry. The exact grid costs 1.4x to 2.3x the solver time on the silicon and copper examples, depending on the thread count.
Either is capped at the dense grid, which already holds everything the density can carry.
Serial wave grid for band-distributed parallelism (task groups). Every rank gets a full-sized serial grid so each can do independent FFTs for its assigned bands without MPI collective calls.
Definition at line 23 of file pair.hpp.
References q3::FFTGridSizer::calculate_grid_dimensions(), q3::FFTGridSizer::compute_fft_factors(), q3::FFTGridFactory::create_fft_grid(), q3::Crystal::lattice_vectors(), q3::Crystal::reciprocal_lattice_vectors(), and q3::Crystal::two_pi_over_lattice_parameter_squared().
Referenced by q3::PlanewaveBasis::generate().