ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
state_ovlp.h
Go to the documentation of this file.
1#ifndef ABACUS_LR_STATE_OVERLAP_H
2#define ABACUS_LR_STATE_OVERLAP_H
4#include <vector>
5
6// Cross-geometry AO/MO overlaps and reference projection, without tracking state.
7// Distributed buffers are local column-major blocks; no matrices are gathered here.
8namespace ModuleBase
9{
10class Matrix3;
11}
12class UnitCell;
14class Parallel_Blkcyclic; // Defined in source/source_base/parallel_blkcyc.h
16namespace LR
17{
18// Construct ordered old-bra/new-ket S(R), then fold at Gamma. Return this rank's
19// column-major AO block; old_positions are Cartesian in cell.lat0 units, cutoffs in Bohr.
20// Uses independent cross-geometry candidates and preserves nonsymmetry.
21std::vector<double> cross_ao_overlap(const UnitCell& cell,
22 const std::vector<ModuleBase::Vector3<double>>& old_positions,
23 const std::vector<double>& cutoff, const TwoCenterIntegrator& integrator,
24 const Parallel_Orbitals& pmat);
25
26// Construct one occupied/virtual O = C_old^dagger S C_current block.
27// first_band is the zero-based column offset into the full AO-by-band pc layout;
28// po describes the selected square block. Coefficient columns are redistributed
29// to origin (1,1) before multiplication; all layouts share grid and block size.
30template <typename T>
31std::vector<T> mo_overlap_dist(const std::vector<T>& old_coefficients,
32 const std::vector<T>& ao, const std::vector<T>& current_coefficients,
33 const Parallel_Blkcyclic& pc, const Parallel_Blkcyclic& ps, const Parallel_Blkcyclic& po, int first_band);
34// A = X^T (virtual rows, occupied columns): return O_vv^dagger A_previous O_oo.
35// pi/pv describe already aligned occupied/virtual overlaps, reused for all roots.
36// This function performs no redistribution or normalization.
37template <typename T>
38std::vector<T> project_reference_dist(const std::vector<T>& previous,
39 const std::vector<T>& occupied_overlap, const std::vector<T>& virtual_overlap,
40 const Parallel_Blkcyclic& pi, const Parallel_Blkcyclic& pv, const Parallel_Blkcyclic& px);
41
42// Integer lattice translations selected by the same cross-geometry cutoff.
43// Retain these indices for HContainer storage and exp(+i k.R) Fourier phases.
44std::vector<ModuleBase::Vector3<int>> cross_image_indices(
45 const ModuleBase::Vector3<double>& displacement,
46 const ModuleBase::Matrix3& lattice, double cutoff);
47
48}
49#endif
3x3 matrix and related mathamatical operations
Definition matrix3.h:15
Parallel block-cyclic matrix distribution.
Definition parallel_blkcyc.h:25
Definition parallel_orbitals.h:16
A class to compute two-center integrals.
Definition two_center_integrator.h:35
Provide the basic information about unitcell.
Definition unitcell.h:16
Definition esolver_lr_lcao_tddft.h:28
std::vector< ModuleBase::Vector3< int > > cross_image_indices(const ModuleBase::Vector3< double > &displacement, const ModuleBase::Matrix3 &lattice, const double cutoff)
Definition state_ovlp.cpp:20
std::vector< T > project_reference_dist(const std::vector< T > &previous, const std::vector< T > &occupied_overlap, const std::vector< T > &virtual_overlap, const Parallel_Blkcyclic &pi, const Parallel_Blkcyclic &pv, const Parallel_Blkcyclic &px)
Definition state_ovlp.cpp:232
std::vector< T > mo_overlap_dist(const std::vector< T > &old_coefficients, const std::vector< T > &ao, const std::vector< T > &current_coefficients, const Parallel_Blkcyclic &pc, const Parallel_Blkcyclic &ps, const Parallel_Blkcyclic &po, const int first_band)
Definition state_ovlp.cpp:159
std::vector< double > cross_ao_overlap(const UnitCell &cell, const std::vector< ModuleBase::Vector3< double > > &old_positions, const std::vector< double > &cutoff, const TwoCenterIntegrator &integrator, const Parallel_Orbitals &pmat)
Definition state_ovlp.cpp:70
Definition clebsch_gordan_coeff.cpp:8
const double pi
Definition test_radial.cpp:22