Skip to content

Commit 25b0568

Browse files
committed
1. add RPA::set_symmetry() and G0W0::set_symmetry()
1 parent 8c2a890 commit 25b0568

File tree

5 files changed

+39
-1
lines changed

5 files changed

+39
-1
lines changed

include/RI/physics/Exx.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <mpi.h>
1414
#include <array>
1515
#include <map>
16+
#include <set>
1617

1718
namespace RI
1819
{

include/RI/physics/GW.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <mpi.h>
1414
#include <array>
1515
#include <map>
16+
#include <set>
1617

1718
namespace RI
1819
{
@@ -34,6 +35,10 @@ class G0W0
3435
const std::array<Tatom_pos,Ndim> &latvec,
3536
const std::array<Tcell,Ndim> &period);
3637

38+
void set_symmetry(
39+
const bool flag_symmetry,
40+
const std::map<std::pair<TA,TA>, std::set<TC>> &irreducible_sector);
41+
3742
void set_Cs(
3843
const std::map<TA, std::map<TAC, Tensor<Tdata>>> &Cs,
3944
const Tdata_real &threshold_C);

include/RI/physics/GW.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include "GW.h"
88
#include "../ri/Label.h"
9+
#include "./symmetry/Filter_Atom_Symmetry.h"
910

1011
namespace RI
1112
{
@@ -30,6 +31,18 @@ void G0W0<TA,Tcell,Ndim,Tdata>::set_parallel(
3031
// this->post_2D.set_parallel(this->mpi_comm, this->atoms_pos, this->period);
3132
}
3233

34+
template<typename TA, typename Tcell, std::size_t Ndim, typename Tdata>
35+
void G0W0<TA,Tcell,Ndim,Tdata>::set_symmetry(
36+
const bool flag_symmetry,
37+
const std::map<std::pair<TA,TA>, std::set<TC>> &irreducible_sector)
38+
{
39+
if(flag_symmetry)
40+
this->lri.filter_atom = std::make_shared<Filter_Atom_Symmetry<TA,TC,Tdata>>(
41+
this->period, irreducible_sector);
42+
else
43+
this->lri.filter_atom = std::make_shared<Filter_Atom<TA,TAC>>();
44+
}
45+
3346
template<typename TA, typename Tcell, std::size_t Ndim, typename Tdata>
3447
void G0W0<TA,Tcell,Ndim,Tdata>::set_Cs(
3548
const std::map<TA, std::map<TAC, Tensor<Tdata>>> &Cs,

include/RI/physics/RPA.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <mpi.h>
1313
#include <array>
1414
#include <map>
15+
#include <set>
1516

1617
namespace RI
1718
{
@@ -20,7 +21,8 @@ template<typename TA, typename Tcell, std::size_t Ndim, typename Tdata>
2021
class RPA
2122
{
2223
public:
23-
using TAC = std::pair<TA,std::array<Tcell,Ndim>>;
24+
using TC = std::array<Tcell,Ndim>;
25+
using TAC = std::pair<TA,TC>;
2426
using Tdata_real = Global_Func::To_Real_t<Tdata>;
2527
using Tatom_pos = std::array<double,Ndim>; // tmp
2628

@@ -30,6 +32,10 @@ class RPA
3032
const std::array<Tatom_pos,Ndim> &latvec,
3133
const std::array<Tcell,Ndim> &period);
3234

35+
void set_symmetry(
36+
const bool flag_symmetry,
37+
const std::map<std::pair<TA,TA>, std::set<TC>> &irreducible_sector);
38+
3339
void set_Cs(
3440
const std::map<TA, std::map<TAC, Tensor<Tdata>>> &Cs,
3541
const Tdata_real &threshold_C);

include/RI/physics/RPA.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "RPA.h"
99
#include "../ri/Label.h"
1010
#include "../global/Map_Operator.h"
11+
#include "./symmetry/Filter_Atom_Symmetry.h"
1112

1213
#include <cassert>
1314

@@ -27,6 +28,18 @@ void RPA<TA,Tcell,Ndim,Tdata>::set_parallel(
2728
this->flag_finish.stru = true;
2829
}
2930

31+
template<typename TA, typename Tcell, std::size_t Ndim, typename Tdata>
32+
void RPA<TA,Tcell,Ndim,Tdata>::set_symmetry(
33+
const bool flag_symmetry,
34+
const std::map<std::pair<TA,TA>, std::set<TC>> &irreducible_sector)
35+
{
36+
if(flag_symmetry)
37+
this->lri.filter_atom = std::make_shared<Filter_Atom_Symmetry<TA,TC,Tdata>>(
38+
this->period, irreducible_sector);
39+
else
40+
this->lri.filter_atom = std::make_shared<Filter_Atom<TA,TAC>>();
41+
}
42+
3043
template<typename TA, typename Tcell, std::size_t Ndim, typename Tdata>
3144
void RPA<TA,Tcell,Ndim,Tdata>::set_Cs(
3245
const std::map<TA, std::map<TAC, Tensor<Tdata>>> &Cs,

0 commit comments

Comments
 (0)