ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
Loading...
Searching...
No Matches
ModuleSymmetry::Symmetry_rotation Class Reference

#include <symm_rotation.h>

Inheritance diagram for ModuleSymmetry::Symmetry_rotation:
Collaboration diagram for ModuleSymmetry::Symmetry_rotation:

Public Member Functions

 Symmetry_rotation ()
 ~Symmetry_rotation ()
void set_Cs_rotation (const std::vector< std::vector< int > > &abfs_l_nchi)
template<typename Tdata>
std::map< int, std::map< std::pair< int, TC >, RI::Tensor< Tdata > > > restore_HR (const Symmetry &symm, const Atom *atoms, const std::vector< int > &iat2it, const char mode, const std::map< int, std::map< std::pair< int, TC >, RI::Tensor< Tdata > > > &HR_irreduceble) const
template<typename TR>
void restore_HR (const Symmetry &symm, const Atom *atoms, const std::vector< int > &iat2it, const std::vector< int > &iat2ia, const char mode, const hamilt::HContainer< TR > &HR_irreduceble, hamilt::HContainer< TR > &HR_rotated) const
template<typename Tdata>
std::array< std::map< int, std::map< std::pair< int, TC >, RI::Tensor< Tdata > > >, 4 > restore_HR_nspin4 (const Symmetry &symm, const Atom *atoms, const std::vector< int > &iat2it, const char mode, const std::array< std::map< int, std::map< std::pair< int, TC >, RI::Tensor< Tdata > > >, 4 > &HR_irreducible_soc) const
template<typename Tdata>
void print_HR (const std::map< int, std::map< std::pair< int, TC >, RI::Tensor< Tdata > > > &HR, const std::string name, const double &threshold=0.0)
Public Member Functions inherited from ModuleSymmetry::Symmetry_rotation_k
 Symmetry_rotation_k ()
virtual ~Symmetry_rotation_k ()
void reset_symmetry ()
 Discard geometry-dependent caches before rebuilding symmetry for a new cell.
const std::map< Tap, std::set< TC > > & get_irred_sector () const
TCdouble get_return_lattice (const Symmetry &symm, const ModuleBase::Matrix3 &gmatd, const TCdouble gtransd, const TCdouble &posd_a1, const TCdouble &posd_a2) const
TCdouble get_return_lattice (const int iat, const int isym) const
void find_irred_sector (const Symmetry &symm, const Atom *atoms, const int nat, const int ntype, const std::vector< int > &iat2it, const std::vector< int > &iat2ia, const std::vector< TC > &Rs, const TC &period, const Lattice &lat, const std::string &output_dir="")
void set_abfs_Lmax (const int l)
void cal_Ms (const K_Vectors &kv, const Symmetry &symm, const Atom *atoms, const ModuleBase::Matrix3 &latvec, const int lmax, const int nat, const std::vector< int > &iat2it, const std::vector< int > &iat2ia, const Parallel_Blkcyclic &pv, const int nspin)
 functions to contruct rotation matrix in AO-representation
std::vector< std::vector< std::complex< double > > > restore_dm (const K_Vectors &kv, const std::vector< std::vector< std::complex< double > > > &dm_k_ibz, const Parallel_Blkcyclic &pv) const
std::vector< std::vector< double > > restore_dm (const K_Vectors &kv, const std::vector< std::vector< double > > &dm_k_ibz, const Parallel_Blkcyclic &pv) const
std::vector< std::complex< double > > rot_matrix_ao (const std::vector< std::complex< double > > &DMkibz, const int ik_ibz, const int kstar_size, const int isym, const Parallel_Blkcyclic &pv, const bool TRS_conj=false) const
std::vector< std::complex< double > > set_sigma_y_2d (const Parallel_Blkcyclic &pv) const
 (nspin=4) build the 2*nao spin operator Sigma_y = I_nao (x) sigma_y in 2d-block layout.
std::vector< std::complex< double > > trs_spin_rotate (const std::vector< std::complex< double > > &X, const std::vector< std::complex< double > > &sigma_y, const Parallel_Blkcyclic &pv, const double scale) const
double wigner_d (const double beta, const int l, const int m1, const int m2) const
 calculate Wigner D matrix
std::complex< double > wigner_D (const TCdouble &euler_angle, const int l, const int m1, const int m2, const bool inv) const
std::complex< double > ovlp_Ylm_Slm (const int l, const int m1, const int m2) const
 c^l_{m1, m2}=<Y_l^m1|S_l^m2>
TCdouble get_euler_angle (const ModuleBase::Matrix3 &gmatc) const
 calculate euler angle from rotation matrix
void cal_rotmat_Slm (const ModuleBase::Matrix3 *gmatc, const int lmax, const int nop)
 T_mm' = [c^\dagger D c]_mm'.
void set_block_to_mat2d (const int starti, const int startj, const ModuleBase::ComplexMatrix &block, std::vector< std::complex< double > > &obj_mat, const Parallel_Blkcyclic &pv, const bool trans=false) const
void set_block_to_mat2d (const int starti, const int startj, const ModuleBase::ComplexMatrix &block, std::vector< double > &obj_mat, const Parallel_Blkcyclic &pv, const bool trans=false) const
std::vector< std::complex< double > > contruct_2d_rot_mat_ao (const Symmetry &symm, const Atom *atoms, const int nat, const std::vector< int > &iat2it, const std::vector< int > &iat2ia, const TCdouble &kvec_d_ibz, int isym, const Parallel_Blkcyclic &pv, const SpinRotation::Su2 &spin_U) const
std::vector< std::vector< ModuleBase::ComplexMatrix > > & get_rotmat_Slm ()
void set_density_rotations_for_testing (const std::vector< std::map< int, std::vector< std::complex< double > > > > &Ms, const std::vector< std::vector< int > > &little_groups, const int nsym, const int nspin)

Private Member Functions

template<typename Tdata>
RI::Tensor< Tdata > rotate_atompair_serial (const RI::Tensor< Tdata > &A, const int isym, const Atom &a1, const Atom &a2, const char mode, bool output=false) const
template<typename Tdata>
void rotate_atompair_serial (Tdata *TAT, const Tdata *A, const int &nw1, const int &nw2, const int isym, const Atom &a1, const Atom &a2, const char mode) const
template<typename TR>
void rotate_atompair_parallel (const TR *Alocal_in, const int isym, const Atom *atoms, const std::vector< int > &iat2it, const std::vector< int > &iat2ia, const Tap &ap_in, const Tap &ap_out, const char mode, const Parallel_Orbitals &pv, TR *Alocal_out, const bool output=false) const
template<typename Tdata>
RI::Tensor< Tdata > rotate_singleC_serial (const RI::Tensor< Tdata > &C, const int isym, const Atom &a1, const Atom &a2, const int &type1, bool output=false) const
 rotate a 3-dim C tensor in RI technique
template<typename Tdata>
RI::Tensor< Tdata > set_rotation_matrix (const Atom &a, const int &isym) const
template<typename Tdata>
RI::Tensor< Tdata > set_rotation_matrix_abf (const int &type, const int &isym) const
const RI::Tensor< std::complex< double > > & get_rotmat_Slm_tensor (const int isym, const int l) const

Private Attributes

std::vector< std::vector< RI::Tensor< std::complex< double > > > > rotmat_Slm_tensor_
int rotmat_Slm_tensor_version_ = -1
bool reduce_Cs_ = false
std::vector< std::vector< int > > abfs_l_nchi_
 number of abfs for each angular momentum

Additional Inherited Members

Static Public Member Functions inherited from ModuleSymmetry::Symmetry_rotation_k
static std::vector< TC > get_bvk_cells (const TC &period)
Public Attributes inherited from ModuleSymmetry::Symmetry_rotation_k
const std::vector< std::vector< ModuleBase::ComplexMatrix > > & rotmat_Slm = this->rotmat_Slm_
 the rotation matrix under the basis of S_l^m. size: [nsym][lmax][nm*nm]
const int & abfs_Lmax = this->abfs_Lmax_
Protected Attributes inherited from ModuleSymmetry::Symmetry_rotation_k
int nspin_ = 1
int nsym_ = 1
int nanti_ = 0
bool magnetic_nspin4_ = false
double eps_ = 1e-6
int abfs_Lmax_ = 0
std::vector< std::vector< ModuleBase::ComplexMatrix > > rotmat_Slm_
 the rotation matrix under the basis of S_l^m. size: [nsym][lmax][nm*nm]
int rotmat_Slm_version_ = 0
std::vector< std::map< int, std::vector< std::complex< double > > > > Ms_
std::vector< std::vector< int > > little_groups_
std::vector< SpinRotation::Su2 > spin_U_
Irred_Sector irs_
 irreducible sector

Detailed Description

Real-space (RI::Tensor / HContainer) H(R) and RI-coefficient symmetry restoration for EXX/RPA, built on top of the LibRI-independent k-space restoration in ModuleSymmetry::Symmetry_rotation_k (source_cell/module_symmetry/symm_rotation_k.h), which provides cal_Ms/restore_dm/rot_matrix_ao and the shared rotation-matrix machinery (rotmat_Slm_, irs_, Ms_, spin_U_, ...). Only the parts that genuinely need LibRI (RI::Tensor atom-pair maps, HContainer real-space rotation) live here.

Constructor & Destructor Documentation

◆ Symmetry_rotation()

ModuleSymmetry::Symmetry_rotation::Symmetry_rotation ( )
inline

◆ ~Symmetry_rotation()

ModuleSymmetry::Symmetry_rotation::~Symmetry_rotation ( )
inline

Member Function Documentation

◆ get_rotmat_Slm_tensor()

const RI::Tensor< std::complex< double > > & ModuleSymmetry::Symmetry_rotation::get_rotmat_Slm_tensor ( const int isym,
const int l ) const
inlineprivate

RI::Tensor mirror of rotmat_Slm_ (which is stored as ModuleBase::ComplexMatrix, shared with the LibRI-free k-space code), rebuilt lazily and cached across the many set_rotation_matrix/set_rotation_matrix_abf calls within one ion step (one per atom pair/cell), instead of reconverting the same small block every time.

Cached (isym, l) lookup into rotmat_Slm_tensor_: rebuilt only when rotmat_Slm_version_ (bumped by cal_rotmat_Slm, i.e. once per ion step) changes, instead of reconverting the same block on every set_rotation_matrix/set_rotation_matrix_abf call (once per atom pair).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_HR()

template<typename Tdata>
void ModuleSymmetry::Symmetry_rotation::print_HR ( const std::map< int, std::map< std::pair< int, TC >, RI::Tensor< Tdata > > > & HR,
const std::string name,
const double & threshold = 0.0 )
Here is the call graph for this function:

◆ restore_HR() [1/2]

template<typename Tdata>
std::map< int, std::map< std::pair< int, TC >, RI::Tensor< Tdata > > > ModuleSymmetry::Symmetry_rotation::restore_HR ( const Symmetry & symm,
const Atom * atoms,
const std::vector< int > & iat2it,
const char mode,
const std::map< int, std::map< std::pair< int, TC >, RI::Tensor< Tdata > > > & HR_irreduceble ) const

The main functions to rotate matrices Given H(R) in the irreduceble sector, calculate H(R) for all the atompairs and cells.

Parameters
iat2itmap from global atom index to its species index
Here is the call graph for this function:
Here is the caller graph for this function:

◆ restore_HR() [2/2]

template<typename TR>
void ModuleSymmetry::Symmetry_rotation::restore_HR ( const Symmetry & symm,
const Atom * atoms,
const std::vector< int > & iat2it,
const std::vector< int > & iat2ia,
const char mode,
const hamilt::HContainer< TR > & HR_irreduceble,
hamilt::HContainer< TR > & HR_rotated ) const
Parameters
iat2itmap from global atom index to its species index
iat2iamap from global atom index to its index within the species
Here is the call graph for this function:

◆ restore_HR_nspin4()

template<typename Tdata>
std::array< std::map< int, std::map< std::pair< int, TC >, RI::Tensor< Tdata > > >, 4 > ModuleSymmetry::Symmetry_rotation::restore_HR_nspin4 ( const Symmetry & symm,
const Atom * atoms,
const std::vector< int > & iat2it,
const char mode,
const std::array< std::map< int, std::map< std::pair< int, TC >, RI::Tensor< Tdata > > >, 4 > & HR_irreducible_soc ) const

(nspin=4) spinor overload: rotate all 4 spin channels of H(R) together. On top of the orbital rotation T1^dagger(.)T2 (mode 'H') / T1^T(.)T2^* (mode 'D') applied to every channel, the SU(2) spin part U(isym) mixes them: H'^{ab}=sum_{cd} conj(U_{ca}) U_{db} [T1^dagger H^{cd} T2]. The 4 channels are ordered is=a*2+b (a=row spin, b=col spin), matching RI_2D_Comm::split_is_block. (nspin=4 magnetic) The atom-pair reduction may also use the ANTIUNITARY elements of the Shubnikov group, flagged by isym >= nsym_. In real space time reversal acts as H(R) -> sigma_y H^*(R) sigma_y (R and the orbital indices untouched), which becomes a remap of the 4 channels applied after the SU(2) mixing; see symm_rotation_r.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rotate_atompair_parallel()

template<typename TR>
void ModuleSymmetry::Symmetry_rotation::rotate_atompair_parallel ( const TR * Alocal_in,
const int isym,
const Atom * atoms,
const std::vector< int > & iat2it,
const std::vector< int > & iat2ia,
const Tap & ap_in,
const Tap & ap_out,
const char mode,
const Parallel_Orbitals & pv,
TR * Alocal_out,
const bool output = false ) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rotate_atompair_serial() [1/2]

template<typename Tdata>
RI::Tensor< Tdata > ModuleSymmetry::Symmetry_rotation::rotate_atompair_serial ( const RI::Tensor< Tdata > & A,
const int isym,
const Atom & a1,
const Atom & a2,
const char mode,
bool output = false ) const
private

The sub functions to rotate matrices mode='H': H_12(R)=T^\dagger(V)H_1'2'(VR+O_1-O_2)T(V) mode='D': D_12(R)=T^T(V)D_1'2'(VR+O_1-O_2)T^*(V)

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rotate_atompair_serial() [2/2]

template<typename Tdata>
void ModuleSymmetry::Symmetry_rotation::rotate_atompair_serial ( Tdata * TAT,
const Tdata * A,
const int & nw1,
const int & nw2,
const int isym,
const Atom & a1,
const Atom & a2,
const char mode ) const
private
Here is the call graph for this function:

◆ rotate_singleC_serial()

template<typename Tdata>
RI::Tensor< Tdata > ModuleSymmetry::Symmetry_rotation::rotate_singleC_serial ( const RI::Tensor< Tdata > & C,
const int isym,
const Atom & a1,
const Atom & a2,
const int & type1,
bool output = false ) const
private

rotate a 3-dim C tensor in RI technique

Here is the call graph for this function:

◆ set_Cs_rotation()

void ModuleSymmetry::Symmetry_rotation::set_Cs_rotation ( const std::vector< std::vector< int > > & abfs_l_nchi)

◆ set_rotation_matrix()

template<typename Tdata>
RI::Tensor< Tdata > ModuleSymmetry::Symmetry_rotation::set_rotation_matrix ( const Atom & a,
const int & isym ) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_rotation_matrix_abf()

template<typename Tdata>
RI::Tensor< Tdata > ModuleSymmetry::Symmetry_rotation::set_rotation_matrix_abf ( const int & type,
const int & isym ) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ abfs_l_nchi_

std::vector<std::vector<int> > ModuleSymmetry::Symmetry_rotation::abfs_l_nchi_
private

number of abfs for each angular momentum

◆ reduce_Cs_

bool ModuleSymmetry::Symmetry_rotation::reduce_Cs_ = false
private

◆ rotmat_Slm_tensor_

std::vector<std::vector<RI::Tensor<std::complex<double> > > > ModuleSymmetry::Symmetry_rotation::rotmat_Slm_tensor_
mutableprivate

◆ rotmat_Slm_tensor_version_

int ModuleSymmetry::Symmetry_rotation::rotmat_Slm_tensor_version_ = -1
mutableprivate

The documentation for this class was generated from the following files: