|
ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
Classes | |
| class | DFPT_HamiltShift |
| Production adapter of the shifted Sternheimer operator (C7). More... | |
| class | DFPT_KQ_Basis |
| Plane-wave basis at the perturbation wavevector k+q. More... | |
| class | DFPT_Metal |
| class | DFPT_NSCF |
| Block-Davidson eigensolver for the full k+q Hamiltonian. More... | |
| class | DFPT_Pert |
| class | DFPT_Phon |
| Dynamical matrix of DFPT (C5). More... | |
| struct | DFPT_PW_InitContext |
| class | DFPT_PW |
| Density-functional perturbation theory driver (plane waves). More... | |
| class | DFPT_PW_Data |
| class | DFPT_Q0 |
| q -> 0 response: dielectric tensor, Born charges, LO-TO (C6). More... | |
| class | XC_First_Order |
| First-order exchange-correlation kernel contract (C6). More... | |
| class | DFPT_Rho |
| First-order density response (C3). More... | |
| class | DFPT_Stern |
| Projected conjugate-gradient solver of the Sternheimer equation (C2). More... | |
| struct | KQPair |
| One (k, k+q) response pair representative with its orbit weight. More... | |
Functions | |
| double | ewald_alpha_search (double charge, double ggecut, double tpiba2) |
| void | symmetrize_tensor3 (const std::vector< ModuleBase::Matrix3 > &rot_carts, ModuleBase::matrix &tensor) |
| void | symmetrize_born (const std::vector< ModuleBase::Matrix3 > &rot_carts, const std::vector< std::vector< int > > &atom_images, std::vector< ModuleBase::matrix > &born) |
| void | validate_q_ordering (const ModuleCell::QList &qlist, bool compute_q0) |
| bool | dfpt_band_occupied (const ModuleBase::matrix &wg, int ik, int ib) |
| std::vector< int > | little_group_of_q (const ModuleBase::Matrix3 &latvec, const ModuleBase::Matrix3 *gmatrix, int nops, const ModuleBase::Vector3< double > &q_cart) |
| Little group of a wave vector including time reversal (B1). | |
| std::vector< KQPair > | kq_pair_reps (const ModuleBase::Matrix3 &latvec, const ModuleBase::Matrix3 *gmatrix, int nops, const ModuleBase::Vector3< double > &q_frac, const std::vector< ModuleBase::Vector3< double > > &mesh_frac) |
| Representatives of the (k, k+q) response pairs over a full mesh (B1). | |
| void | DFPT_Write_Dyn (const UnitCell &ucell, const DFPT_PW_Data &data, int nq, const std::string &out_dir, int my_rank, std::ostream *running_log) |
|
inline |
Occupied-band classifier shared by the projector build, the Sternheimer driver, the response-density accumulation and the 2n+1 assembly. A band counts as occupied iff its weight exceeds half of the per-k full reference (band 0 is always the deepest, fully occupied band). A fixed absolute threshold makes the Sternheimer projector jump between k samplings: a smeared Fermi-tail band with weight ~1e-6 lands on either side of 1e-8 depending on where the sampling's Fermi level sits, which opens or closes its empty-state channel in (H-eps)^-1 and changes the converged response at the percent level. The majority criterion keeps that channel open for tail bands (their occupied-type contribution is f-weighted and negligible), reproducing the insulator limit that finite-difference references follow.
| void ModuleDFPT::DFPT_Write_Dyn | ( | const UnitCell & | ucell, |
| const DFPT_PW_Data & | data, | ||
| int | nq, | ||
| const std::string & | out_dir, | ||
| int | my_rank, | ||
| std::ostream * | running_log ) |
Write the raw (pre-ASR, pre-LO-TO) dynamical matrices in the QE dyn file format, one file per q point into out_dir/dyn.q. See the .cpp header comment for the exact layout and conventions.
running_log (nullable): the running log stream for the created-file confirmations (AGENTS rule 16); when null the confirmation goes to stdout only.
< empirical parameter: fractional-q Gamma tolerance (dfpt_phon.cpp value)
| double ModuleDFPT::ewald_alpha_search | ( | double | charge, |
| double | ggecut, | ||
| double | tpiba2 ) |
Ewald screening-alpha search (multiplicative shrinkage with a tail bound; exposed for the serial analytic tests, see EwaldAlphaSearchLowCutoffContinuesBelowDecade)
screening alpha of the Ewald split, searched so that the G-sum tail is bounded inside the rho grid. Multiplicative shrinkage (the historical schedule) can continue below 0.1, where the fixed-decrement variant crosses zero and aborts even though a solution exists: for total charge 8 and ggecut*tpiba2 = 8, alpha = 0.08 satisfies the 1e-9 tail while alpha = 0.10 misses it.
< empirical parameter: initial Ewald screening-alpha guess
< empirical parameter: per-iteration alpha shrink factor
< empirical parameter: alpha floor of the search
< empirical parameter: accepted G-sum tail bound
| std::vector< KQPair > ModuleDFPT::kq_pair_reps | ( | const ModuleBase::Matrix3 & | latvec, |
| const ModuleBase::Matrix3 * | gmatrix, | ||
| int | nops, | ||
| const ModuleBase::Vector3< double > & | q_frac, | ||
| const std::vector< ModuleBase::Vector3< double > > & | mesh_frac ) |
Representatives of the (k, k+q) response pairs over a full mesh (B1).
Reduces the full k mesh to orbit representatives of the UNITARY little co-group of q (the s = +1 branch: QE's nsymq), and returns one pair (k, k + q) per orbit with the orbit size as weight. The plain weighted sum over these representatives is the input the G_q projection of the later symmetrization step closes on (P(A) = F requires the list to be reduced with respect to the same group the projector runs over).
The orbits are generated in cartesian k space through the rotation images R = latvec^-1 G latvec, which makes the orbit PARTITION immune to the forward/backward gmatrix conventions ({R} and {R^T} generate the same orbits because the cartesian images are orthogonal); the Gamma case reproduces the standard k-mesh IBZ reduction as the convention anchor.
Inert infrastructure: nothing consumes it yet.
| std::vector< int > ModuleDFPT::little_group_of_q | ( | const ModuleBase::Matrix3 & | latvec, |
| const ModuleBase::Matrix3 * | gmatrix, | ||
| int | nops, | ||
| const ModuleBase::Vector3< double > & | q_cart ) |
Little group of a wave vector including time reversal (B1).
Returns the indices of the space-group operations whose rotation maps q onto +q or -q modulo a reciprocal-lattice vector: R q = s q + G, s = +-1: the union of the unitary little co-group (s = +1, QE's nsymq) and the antiunitary-eligible set (s = -1, the rotations that preserve q when composed with time reversal; the response at -q is the conjugate response at q). For a time-reversal-invariant q the two branches coincide; for a generic q the antiunitary branch still contributes inversion (theta*i fixes every q), so the result always contains the identity and inversion. Callers needing only the unitary co-group (the symdvscf rotation average) must re-filter on the s = +1 branch.
The reciprocal test is the dot-product integrality (R q - s q) . a_i / 2pi in Z for every direct primitive vector a_i (rows of latvec). This form is immune to the all-same-parity subtlety of non-primitive lattices that a cartesian-integrality check misses: at the fcc L point the cartesian difference (1, 0, -1)*2pi/a is integral but not a reciprocal-lattice vector, which would wrongly admit C2y into the little group.
Membership is convention-immune: an operation and its inverse either both fix q mod G or both do not, so the forward/backward gmatrix conventions give the same index set.
< empirical parameter: integrality roundoff of the double dot products
| void ModuleDFPT::symmetrize_born | ( | const std::vector< ModuleBase::Matrix3 > & | rot_carts, |
| const std::vector< std::vector< int > > & | atom_images, | ||
| std::vector< ModuleBase::matrix > & | born ) |
Project the Born effective charges with the per-operation atom images (QE symtensor parity): Z'iat = (1/n) sum_g R_g Z{image_g(iat)} R_g^T. Summing over the whole group makes the forward/backward image conventions equivalent.
| void ModuleDFPT::symmetrize_tensor3 | ( | const std::vector< ModuleBase::Matrix3 > & | rot_carts, |
| ModuleBase::matrix & | tensor ) |
Project a 3x3 cartesian response tensor onto the crystal point-group invariant form T' = (1/n) sum_g R_g T R_g^T with R_g the cartesian images of the group operations (QE symmatrix parity, PW/src/symme.f90, including the IF (nsym == 1) RETURN guard: an empty or single-element rotation list is a no-op, so under nosym the raw tensor stays visible).
| void ModuleDFPT::validate_q_ordering | ( | const ModuleCell::QList & | qlist, |
| bool | compute_q0 ) |
Validate the q-point ordering for the polar (dfpt_compute_q0) pipeline: when compute_q0 is on, Gamma must be the FIRST q point (the E-field response, dielectric tensor and Born charges are computed at q index 0 and are only defined at Gamma) and no later q may duplicate Gamma (the polar tensors and LO-TO attach to the first Gamma entry only). Quits with an explicit diagnostic naming the offending index otherwise; a no-op when compute_q0 is off, so arbitrary orderings (e.g. an explicit [X, Gamma] file) stay legal for plain phonon runs.
< empirical parameter: fractional-q Gamma tolerance (dfpt_phon.cpp value)