33 #ifndef MAD_POINTGROUP_H 
   34 #define MAD_POINTGROUP_H 
   69         else if (name == 
"C2") {
 
   71             irs[0] = 
"a"; irs[1] = 
"b";
 
   72             ops[0] = 
"e"; ops[1] = 
"c2z";
 
   73             c[0][0] = 1;  c[0][1] = 1;
 
   74             c[1][0] = 1;  c[1][1] =-1;
 
   76         else if (name == 
"Ci") {
 
   78             irs[0] = 
"ag"; irs[1] = 
"au";
 
   79             ops[0] = 
"e"; ops[1] = 
"i";
 
   80             c[0][0] = 1;  c[0][1] = 1;
 
   81             c[1][0] = 1;  c[1][1] =-1;
 
   83         else if (name == 
"Cs") {
 
   85             irs[0] = 
"a"; irs[1] = 
"a'";
 
   86             ops[0] = 
"e"; ops[1] = 
"sxy";
 
   87             c[0][0] = 1;  c[0][1] = 1;
 
   88             c[1][0] = 1;  c[1][1] =-1;
 
   90         else if (name == 
"C2h") {
 
   92             irs[0] = 
"ag"; irs[1] = 
"au"; irs[2] = 
"bg"; irs[3] = 
"bu";
 
   93             ops[0] = 
"e";  ops[1] = 
"c2z";ops[2] = 
"sxy";ops[3] = 
"i";
 
   94             c[0][0] = 1; c[0][1] = 1; c[0][2] = 1; c[0][3] = 1;
 
   95             c[1][0] = 1; c[1][1] = 1; c[1][2] =-1; c[1][3] =-1;
 
   96             c[2][0] = 1; c[2][1] =-1; c[2][2] =-1; c[2][3] = 1;
 
   97             c[3][0] = 1; c[3][1] =-1; c[3][2] = 1; c[3][3] =-1;
 
   99         else if (name == 
"C2v") {
 
  101             irs[0] = 
"a1"; irs[1] = 
"a2"; irs[2] = 
"b1"; irs[3] = 
"b2";
 
  102             ops[0] = 
"e";  ops[1] = 
"c2z";ops[2] = 
"sxz";ops[3] = 
"syz";
 
  103             c[0][0] = 1; c[0][1] = 1; c[0][2] = 1; c[0][3] = 1;
 
  104             c[1][0] = 1; c[1][1] = 1; c[1][2] =-1; c[1][3] =-1;
 
  105             c[2][0] = 1; c[2][1] =-1; c[2][2] = 1; c[2][3] =-1;
 
  106             c[3][0] = 1; c[3][1] =-1; c[3][2] =-1; c[3][3] = 1;
 
  108         else if (name == 
"D2") {
 
  110             irs[0] = 
"a1"; irs[1] = 
"b1"; irs[2] = 
"b2"; irs[3] = 
"b3";
 
  111             ops[0] = 
"e";  ops[1] = 
"c2z";ops[2] = 
"c2y";ops[3] = 
"c2x";
 
  112             c[0][0] = 1; c[0][1] = 1; c[0][2] = 1; c[0][3] = 1;
 
  113             c[1][0] = 1; c[1][1] = 1; c[1][2] =-1; c[1][3] =-1;
 
  114             c[2][0] = 1; c[2][1] =-1; c[2][2] = 1; c[2][3] =-1;
 
  115             c[3][0] = 1; c[3][1] =-1; c[3][2] =-1; c[3][3] = 1;
 
  117         else if (name == 
"D2h") {
 
  119             irs[0] = 
"ag"; irs[1] = 
"au"; irs[2] = 
"b1g"; irs[3] = 
"b1u";
 
  120             irs[4] = 
"b2g";irs[5] = 
"b2u";irs[6] = 
"b3g"; irs[7] = 
"b3u";
 
  121             ops[0] = 
"e";  ops[1] = 
"c2z";ops[2] = 
"c2y"; ops[3] = 
"c2x";
 
  122             ops[4] = 
"i";  ops[5] = 
"sxy";ops[6] = 
"sxz"; ops[7] = 
"syz";
 
  123             c[0][0] = 1;   c[0][1] = 1;   c[0][2] = 1;   c[0][3] = 1;   c[0][4] = 1;   c[0][5] = 1;   c[0][6] = 1;   c[0][7] = 1;
 
  124             c[1][0] = 1;   c[1][1] = 1;   c[1][2] = 1;   c[1][3] = 1;   c[1][4] =-1;   c[1][5] =-1;   c[1][6] =-1;   c[1][7] =-1;
 
  125             c[2][0] = 1;   c[2][1] = 1;   c[2][2] =-1;   c[2][3] =-1;   c[2][4] = 1;   c[2][5] = 1;   c[2][6] =-1;   c[2][7] =-1;
 
  126             c[3][0] = 1;   c[3][1] = 1;   c[3][2] =-1;   c[3][3] =-1;   c[3][4] =-1;   c[3][5] =-1;   c[3][6] = 1;   c[3][7] = 1;
 
  127             c[4][0] = 1;   c[4][1] =-1;   c[4][2] = 1;   c[4][3] =-1;   c[4][4] = 1;   c[4][5] =-1;   c[4][6] = 1;   c[4][7] =-1;
 
  128             c[5][0] = 1;   c[5][1] =-1;   c[5][2] = 1;   c[5][3] =-1;   c[5][4] =-1;   c[5][5] = 1;   c[5][6] =-1;   c[5][7] = 1;
 
  129             c[6][0] = 1;   c[6][1] =-1;   c[6][2] =-1;   c[6][3] = 1;   c[6][4] = 1;   c[6][5] =-1;   c[6][6] =-1;   c[6][7] = 1;
 
  130             c[7][0] = 1;   c[7][1] =-1;   c[7][2] =-1;   c[7][3] = 1;   c[7][4] =-1;   c[7][5] = 1;   c[7][6] = 1;   c[7][7] =-1;
 
  133             throw "PointGroup: unknown group";
 
  144         if (
this != &other) {
 
  147             for (
int ir=0; ir<order; ++ir) {
 
  148                 irs[ir] = other.irs[ir];
 
  149                 ops[ir] = other.ops[ir];
 
  150                 for (
int op=0; 
op<order; ++
op) {
 
  151                     c[ir][
op] = other.c[ir][
op];
 
  168         return apply(ops[op], r);
 
  173         const double x=r[0], y=r[1], z=r[2];
 
  176             q[0]=x;  q[1]=y;  q[2]=z;
 
  178         else if (op == 
"c2z") {
 
  179             q[0]=-x; q[1]=-y; q[2]=z;
 
  181         else if (op == 
"c2y") {
 
  182             q[0]=-x; q[1]=y;  q[2]=-z;
 
  184         else if (op == 
"c2x") {
 
  185             q[0]=x;  q[1]=-y; q[2]=-z;
 
  187         else if (op == 
"sxy") {
 
  188             q[0]=x;  q[1]=y;  q[2]=-z;
 
  190         else if (op == 
"sxz") {
 
  191             q[0]=x;  q[1]=-y; q[2]=z;
 
  193         else if (op == 
"syz") {
 
  194             q[0]=-x; q[1]=y;  q[2]=z;
 
  196         else if (op == 
"i") {
 
  197             q[0]=-x; q[1]=-y; q[2]=-z;
 
  200             throw "PointGroup: apply_op_by_name: unknown operator name";
 
  209         for (
int ir=0; ir<order; ++ir) {
 
  211             for (
int op=0; 
op<order; ++
op) {
 
  219         throw "PointGroup: cart_ir: problem identifying axis";
 
  233         double xmin=1.0, ymin=1.0, zmin=1.0;
 
  235         for (
int x=-1; x<=1; x+=2) {
 
  236             for (
int y=-1; y<=1; y+=2) {
 
  237                 for (
int z=-1; z<=1; z+=2) {
 
  239                     double rx=x, ry=y, rz=z;
 
  240                     for (
int op=0; 
op<order; ++
op) {
 
  242                         r[0] = rx; r[1] = ry; r[2] = rz;
 
  244                         double xx = q[0], yy=q[1], zz = q[2];
 
  245                         if ((xx>rx) || (xx==rx && yy>ry) || (xx==rx && yy==ry && zz>rz)) {
 
  255         r[0] = xmin; r[1] = ymin; r[2] = zmin;
 
  295     s << 
"Group " << g.
get_name() << 
" - irreducible cell " << g.
ircell() << 
"\n";
 
  298     for (
int op=0; 
op<order; ++
op)
 
  302     for (
int op=0; 
op<order; ++
op)
 
  311     for (
int ir=0; ir<order; ++ir) {
 
  312         s << 
"  " << std::left << std::setw(3) << g.
get_ir_name(ir) << std::right << 
"  ";
 
  313         for (
int op=0; 
op<order; ++
op) {
 
  314             s << 
" " << std::setw(3) << g.
ctable(ir, 
op);
 
  316         if (ir == irx) s << 
"   x";
 
  317         if (ir == iry) s << 
"   y";
 
  318         if (ir == irz) s << 
"   z";
 
int ctable(int ir, int op) const 
Definition: DFcode/pointgroup.h:287
NDIM const Function< R, NDIM > & g
Definition: mra.h:2179
coordT ircell() const 
Returns irreducible cell. 
Definition: DFcode/pointgroup.h:232
::std::string string
Definition: gtest-port.h:872
static coordT apply(const std::string &op, const coordT &r)
Applies named operator (e, c2z, c2y, c2x, sxy, sxz, syz, i) to point. 
Definition: DFcode/pointgroup.h:172
PointGroup(const std::string name)
Constructs point group by name (D2h and subgroups only) 
Definition: DFcode/pointgroup.h:61
Defines and implements most of Tensor. 
int cart_ir(int axis) const 
Returns the irrep of the Cartesian axis (0, 1, 2 = x, y, z) 
Definition: DFcode/pointgroup.h:206
madness::Vector< double, 3 > coordT
Definition: DFcode/pointgroup.h:58
const mpreal min(const mpreal &x, const mpreal &y)
Definition: mpreal.h:2675
const std::string & get_op_name(int op) const 
Definition: DFcode/pointgroup.h:283
const std::string & get_name() const 
Definition: DFcode/pointgroup.h:271
PointGroup & operator=(const PointGroup &other)
Assignment. 
Definition: DFcode/pointgroup.h:143
const mpreal sum(const mpreal tab[], unsigned long int n, mp_rnd_t rnd_mode)
Definition: mpreal.cc:241
static bool test()
Definition: DFcode/pointgroup.h:259
Definition: DFcode/pointgroup.h:50
std::ostream & operator<<(std::ostream &s, const PointGroup &g)
Definition: DFcode/pointgroup.h:292
const std::string & get_ir_name(int ir) const 
Definition: DFcode/pointgroup.h:279
virtual ~PointGroup()
Destructor. 
Definition: DFcode/pointgroup.h:159
Tensor< double > op(const Tensor< double > &x)
Definition: kain.cc:508
PointGroup(const PointGroup &other)
Copy constructor. 
Definition: DFcode/pointgroup.h:138
int get_order() const 
Definition: DFcode/pointgroup.h:275
int irmul(int ir1, int ir2) const 
Returns irreducible representation corresponding to product. 
Definition: DFcode/pointgroup.h:162
coordT apply(int op, const coordT &r) const 
Applies group operator number op (0,1,...,order-1) to point. 
Definition: DFcode/pointgroup.h:167