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

k-space AO-representation symmetry restoration: reconstructs D(k) at every k-star member from D(k_ibz), for crystal-symmetry-reduced BZ sampling. More...

#include <symm_rotation_k.h>

Inheritance diagram for ModuleSymmetry::Symmetry_rotation_k:
Collaboration diagram for ModuleSymmetry::Symmetry_rotation_k:

Public Member Functions

 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)

Static Public Member Functions

static std::vector< TC > get_bvk_cells (const TC &period)

Public Attributes

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

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

k-space AO-representation symmetry restoration: reconstructs D(k) at every k-star member from D(k_ibz), for crystal-symmetry-reduced BZ sampling.

This is the LibRI-independent subset of what used to be a single source_lcao/module_ri/module_exx_symmetry/Symmetry_rotation class: everything needed to go from an irreducible-k-point density matrix to the full-BZ one, so callers that only need that (e.g. DFT+U's occupation-matrix/DMR restoration) do not have to depend on module_ri or LibRI. EXX/RPA's own real-space H(R)/RI-coefficient restoration (which does need RI::Tensor) is built on top of this class in source_lcao/module_ri/module_exx_symmetry/symm_rotation.h (ModuleSymmetry::Symmetry_rotation, which inherits from this one).

Constructor & Destructor Documentation

◆ Symmetry_rotation_k()

ModuleSymmetry::Symmetry_rotation_k::Symmetry_rotation_k ( )
inline

◆ ~Symmetry_rotation_k()

virtual ModuleSymmetry::Symmetry_rotation_k::~Symmetry_rotation_k ( )
inlinevirtual

Member Function Documentation

◆ cal_Ms()

void ModuleSymmetry::Symmetry_rotation_k::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

The top-level calculation interface of this class. calculate the rotation matrix in AO representation: M only need once call in each ion step (decided by the configuration)

Parameters
kstarsequal k points to each ibz-kpont, corresponding to a certain symmetry operations.
symmanalyzed symmetry of the cell (gmatrix, gmatrix_anti, kgmatrix, ...)
atomsall atoms
latvecCartesian lattice vectors, as rows of a 3x3 matrix
lmaxmaximum angular momentum of the atomic orbitals
nattotal number of atoms
iat2itmap from global atom index iat to its species index it
iat2iamap from global atom index iat to its index ia within the species
nspinstored as a member so restore_dm()/contruct_2d_rot_mat_ao() do not each need to read the global nspin config setting (keeps this LibRI-free class free of a module_parameter link dependency; every existing caller already has nspin in scope).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cal_rotmat_Slm()

void ModuleSymmetry::Symmetry_rotation_k::cal_rotmat_Slm ( const ModuleBase::Matrix3 * gmatc,
const int lmax,
const int nop )

T_mm' = [c^\dagger D c]_mm'.

T_mm' = [c^\dagger D c]_mm', the rotation matrix in the representation of real sphere harmonics

Parameters
nopnumber of operations in gmatc; <0 means nsym_ (the unitary ones only). Pass nsym_+nanti_ to also build the antiunitary operations' T_l.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ contruct_2d_rot_mat_ao()

std::vector< std::complex< double > > ModuleSymmetry::Symmetry_rotation_k::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

2d-block parallized rotation matrix in AO-representation, denoted as M. finally we will use D(k)=M(R, k)^\dagger*D(Rk)*M(R, k) to recover D(k) from D(Rk).

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

◆ find_irred_sector()

void ModuleSymmetry::Symmetry_rotation_k::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 = "" )
inline
Here is the caller graph for this function:

◆ get_bvk_cells()

std::vector< TC > ModuleSymmetry::Symmetry_rotation_k::get_bvk_cells ( const TC & period)
static

list all cells in a Born-von-Karman supercell of the given period (no LibRI dependency, unlike RI_Util::get_Born_von_Karmen_cells which this mirrors for 3D periods).

Here is the caller graph for this function:

◆ get_euler_angle()

TCdouble ModuleSymmetry::Symmetry_rotation_k::get_euler_angle ( const ModuleBase::Matrix3 & gmatc) const

calculate euler angle from rotation matrix

Here is the caller graph for this function:

◆ get_irred_sector()

const std::map< Tap, std::set< TC > > & ModuleSymmetry::Symmetry_rotation_k::get_irred_sector ( ) const
inline
Here is the caller graph for this function:

◆ get_return_lattice() [1/2]

TCdouble ModuleSymmetry::Symmetry_rotation_k::get_return_lattice ( const int iat,
const int isym ) const
inline

◆ get_return_lattice() [2/2]

TCdouble ModuleSymmetry::Symmetry_rotation_k::get_return_lattice ( const Symmetry & symm,
const ModuleBase::Matrix3 & gmatd,
const TCdouble gtransd,
const TCdouble & posd_a1,
const TCdouble & posd_a2 ) const
inline
Here is the caller graph for this function:

◆ get_rotmat_Slm()

std::vector< std::vector< ModuleBase::ComplexMatrix > > & ModuleSymmetry::Symmetry_rotation_k::get_rotmat_Slm ( )
inline

◆ ovlp_Ylm_Slm()

std::complex< double > ModuleSymmetry::Symmetry_rotation_k::ovlp_Ylm_Slm ( const int l,
const int m1,
const int m2 ) const

c^l_{m1, m2}=<Y_l^m1|S_l^m2>

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

◆ reset_symmetry()

void ModuleSymmetry::Symmetry_rotation_k::reset_symmetry ( )

Discard geometry-dependent caches before rebuilding symmetry for a new cell.

◆ restore_dm() [1/2]

std::vector< std::vector< double > > ModuleSymmetry::Symmetry_rotation_k::restore_dm ( const K_Vectors & kv,
const std::vector< std::vector< double > > & dm_k_ibz,
const Parallel_Blkcyclic & pv ) const

◆ restore_dm() [2/2]

std::vector< std::vector< std::complex< double > > > ModuleSymmetry::Symmetry_rotation_k::restore_dm ( const K_Vectors & kv,
const std::vector< std::vector< std::complex< double > > > & dm_k_ibz,
const Parallel_Blkcyclic & pv ) const

Use calculated M matrix to recover D(k) from D(k_ibz): D(k) = M(R, k)^\dagger D(k_ibz) M(R, k) the link "ik_ibz-isym-ik" can be found in kstars: k_bz = gmat[isym](k)

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

◆ rot_matrix_ao()

std::vector< std::complex< double > > ModuleSymmetry::Symmetry_rotation_k::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
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_abfs_Lmax()

void ModuleSymmetry::Symmetry_rotation_k::set_abfs_Lmax ( const int l)
inline
Here is the caller graph for this function:

◆ set_block_to_mat2d() [1/2]

void ModuleSymmetry::Symmetry_rotation_k::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
Here is the call graph for this function:

◆ set_block_to_mat2d() [2/2]

void ModuleSymmetry::Symmetry_rotation_k::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

set a block matrix onto a 2d-parallelized matrix(col-maj), at the position (starti, startj) if trans=true, the block matrix is transposed before setting

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

◆ set_density_rotations_for_testing()

void ModuleSymmetry::Symmetry_rotation_k::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 )
inline

test-only: inject Ms_/little_groups_/nsym_ directly, bypassing cal_Ms(), so restore_dm() can be unit-tested against synthetic k-stars without a real UnitCell/K_Vectors setup.

◆ set_sigma_y_2d()

std::vector< std::complex< double > > ModuleSymmetry::Symmetry_rotation_k::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.

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

◆ trs_spin_rotate()

std::vector< std::complex< double > > ModuleSymmetry::Symmetry_rotation_k::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

(nspin=4) time-reversal on the spin density matrix: D(k) = sigma_y D^*(-k) sigma_y, realized distribution-safely as scale * Sigma_y * conj(X) * Sigma_y (X is the already space-group-rotated D(-k) stored in the transposed 2d-block convention).

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

◆ wigner_D()

std::complex< double > ModuleSymmetry::Symmetry_rotation_k::wigner_D ( const TCdouble & euler_angle,
const int l,
const int m1,
const int m2,
const bool inv ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ wigner_d()

double ModuleSymmetry::Symmetry_rotation_k::wigner_d ( const double beta,
const int l,
const int m1,
const int m2 ) const

calculate Wigner D matrix

Here is the caller graph for this function:

Member Data Documentation

◆ abfs_Lmax

const int& ModuleSymmetry::Symmetry_rotation_k::abfs_Lmax = this->abfs_Lmax_

◆ abfs_Lmax_

int ModuleSymmetry::Symmetry_rotation_k::abfs_Lmax_ = 0
protected

◆ eps_

double ModuleSymmetry::Symmetry_rotation_k::eps_ = 1e-6
protected

◆ irs_

Irred_Sector ModuleSymmetry::Symmetry_rotation_k::irs_
protected

irreducible sector

◆ little_groups_

std::vector<std::vector<int> > ModuleSymmetry::Symmetry_rotation_k::little_groups_
protected

The little group of each ibz-kpoint: the subset of unitary space-group operations that fix kvec_d_ibz modulo a reciprocal lattice vector. D(k_ibz) is averaged over this group before star-expansion, since a finite-grid SCF density need not exactly respect it. size: [nks_ibz][<=nsym_], always non-empty (identity is always a member).

◆ magnetic_nspin4_

bool ModuleSymmetry::Symmetry_rotation_k::magnetic_nspin4_ = false
protected

(nspin=4) true when the configuration carries a non-zero local moment. Then pure time reversal is NOT a symmetry (it reverses m) and the k-star must be restored with the Shubnikov elements Theta*gmatrix_anti[] instead of the generic -k shortcut.

◆ Ms_

std::vector<std::map<int, std::vector<std::complex<double> > > > ModuleSymmetry::Symmetry_rotation_k::Ms_
protected

The unitary matrix associate D(Rk) with D(k) for each ibz-kpoint Rk and each symmetry operation. size: [nks_ibz][nsym][nbasis*nbasis], only need to calculate once.

◆ nanti_

int ModuleSymmetry::Symmetry_rotation_k::nanti_ = 0
protected

(nspin=4, magnetic) number of ANTIUNITARY elements Theta*g of the Shubnikov group. Their orbital rotations / return lattices / Ms are appended after the nsym_ unitary ones, so the raw index isym in [nsym_, nsym_+nanti_) addresses gmatrix_anti[isym-nsym_].

◆ nspin_

int ModuleSymmetry::Symmetry_rotation_k::nspin_ = 1
protected

set by cal_Ms() (or set_density_rotations_for_testing()); avoids reading the global nspin config setting in restore_dm()/contruct_2d_rot_mat_ao(), which would otherwise pull a module_parameter link dependency into every target that links this LibRI-free class.

◆ nsym_

int ModuleSymmetry::Symmetry_rotation_k::nsym_ = 1
protected

◆ rotmat_Slm

const std::vector<std::vector<ModuleBase::ComplexMatrix> >& ModuleSymmetry::Symmetry_rotation_k::rotmat_Slm = this->rotmat_Slm_

the rotation matrix under the basis of S_l^m. size: [nsym][lmax][nm*nm]

◆ rotmat_Slm_

std::vector<std::vector<ModuleBase::ComplexMatrix> > ModuleSymmetry::Symmetry_rotation_k::rotmat_Slm_
protected

the rotation matrix under the basis of S_l^m. size: [nsym][lmax][nm*nm]

◆ rotmat_Slm_version_

int ModuleSymmetry::Symmetry_rotation_k::rotmat_Slm_version_ = 0
protected

bumped every time cal_rotmat_Slm() (re)fills rotmat_Slm_, so derived classes caching a converted copy of rotmat_Slm_ (e.g. EXX's RI::Tensor mirror) can detect staleness without recomparing the whole matrix.

◆ spin_U_

std::vector<SpinRotation::Su2> ModuleSymmetry::Symmetry_rotation_k::spin_U_
protected

(nspin=4) the SU(2) spin-1/2 rotation U(isym) for each symmetry operation, size [nsym]. The spinor AO rotation is T(isym) (x) U(isym); restore_HR_nspin4 (EXX) uses it to mix the 4 spin channels of the real-space H(R). Filled in cal_Ms (identity for nspin<4).


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