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) {
151 c[ir][
op] = other.
c[ir][
op];
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) {
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;
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)) {
249 xmin = std::min(xmin,rx); ymin = std::min(ymin,ry); zmin = std::min(zmin,rz);
255 r[0] = xmin; r[1] = ymin; r[2] = zmin;
293 int order =
g.get_order();
295 s <<
"Group " <<
g.get_name() <<
" - irreducible cell " <<
g.ircell() <<
"\n";
298 for (
int op=0;
op<order; ++
op)
299 s <<
" " << std::setw(3) <<
g.get_op_name(
op);
302 for (
int op=0;
op<order; ++
op)
307 int irx =
g.cart_ir(0);
308 int iry =
g.cart_ir(1);
309 int irz =
g.cart_ir(2);
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";
double q(double t)
Definition DKops.h:18
Definition pointgroup.h:50
int order
group order
Definition pointgroup.h:52
coordT ircell() const
Returns irreducible cell.
Definition pointgroup.h:232
const std::string & get_ir_name(int ir) const
Definition pointgroup.h:279
PointGroup(const std::string name)
Constructs point group by name (D2h and subgroups only)
Definition pointgroup.h:61
int ctable(int ir, int op) const
Definition pointgroup.h:287
std::string irs[8]
Names of the irreps.
Definition pointgroup.h:53
int irmul(int ir1, int ir2) const
Returns irreducible representation corresponding to product.
Definition pointgroup.h:162
virtual ~PointGroup()
Destructor.
Definition pointgroup.h:159
const std::string & get_name() const
Definition pointgroup.h:271
static coordT apply(const std::string &op, const coordT &r)
Applies named operator (e, c2z, c2y, c2x, sxy, sxz, syz, i) to point.
Definition pointgroup.h:172
PointGroup & operator=(const PointGroup &other)
Assignment.
Definition pointgroup.h:143
int get_order() const
Definition pointgroup.h:275
coordT apply(int op, const coordT &r) const
Applies group operator number op (0,1,...,order-1) to point.
Definition pointgroup.h:167
std::string ops[8]
Names of the operators.
Definition pointgroup.h:54
madness::Vector< double, 3 > coordT
Definition pointgroup.h:58
const std::string & get_op_name(int op) const
Definition pointgroup.h:283
std::string name
group name
Definition pointgroup.h:51
int c[8][8]
Character table.
Definition pointgroup.h:55
int cart_ir(int axis) const
Returns the irrep of the Cartesian axis (0, 1, 2 = x, y, z)
Definition pointgroup.h:206
static bool test()
Definition pointgroup.h:259
PointGroup(const PointGroup &other)
Copy constructor.
Definition pointgroup.h:138
A simple, fixed dimension vector.
Definition vector.h:64
Tensor< double > op(const Tensor< double > &x)
Definition kain.cc:508
std::ostream & operator<<(std::ostream &s, const PointGroup &g)
Definition pointgroup.h:292
Defines and implements most of Tensor.
AtomicInt sum
Definition test_atomicint.cc:46
double g(const coord_1d &r)
Definition testgconv.cc:49
std::size_t axis
Definition testpdiff.cc:59
Implement the madness:Vector class, an extension of std::array that supports some mathematical operat...