3
\brief This file contains functions which provide information
4
from the group character tables as given in Cotton
11
#include <libciomr/libciomr.h>
17
namespace psi { namespace optking {
19
int **get_char_table(char *ptgrp); /* returns the character table */
20
int get_nirreps(char *ptgrp); /* " " number of irreps */
21
const char **get_irrep_labels(char *ptgrp); /* " " number of symmetry operations */
22
const char **get_symm_ops(char *ptgrp); /* " " symm operation labels */
23
int *get_ops_coeffs(char *ptgrp); /* " " coefficients of the symmetry operations */
24
int get_num_ops(char *ptgrp); /* " " number of operations */
25
int get_num_classes(char *ptgrp); /* " " number of classes of operations */
26
int *get_ops_in_class(char *ptgrp, int nirreps);
28
int **get_char_table(char *ptgrp) {
34
static int C1[1] = {1};
36
/* This works for CS, CI and C2 */
37
static int CS[4] = { 1, 1,
40
/* This works for C2V and D2 */
41
static int D2[16] = { 1, 1, 1, 1,
46
static int C2H[16] = { 1, 1, 1, 1,
51
/* This works for C3V and D3 */
52
static int D3[9] = { 1, 1, 1,
56
/* This works for C4V, D2D and D4 */
57
static int D4[25] = { 1, 1, 1, 1, 1,
63
/* This works for O and TD point groups */
64
static int TD[25] = { 1, 1, 1, 1, 1,
70
/* This works for C6V and D6 */
71
static int D6[36] = { 1, 1, 1, 1, 1, 1,
78
/* This works for D3D and D3H */
79
static int D3D[36] = { 1, 1, 1, 1, 1, 1,
86
static int D2H[64] = { 1, 1, 1, 1, 1, 1, 1, 1,
87
1, 1,-1,-1, 1, 1,-1,-1,
88
1,-1, 1,-1, 1,-1, 1,-1,
89
1,-1,-1, 1, 1,-1,-1, 1,
90
1, 1, 1, 1,-1,-1,-1,-1,
91
1, 1,-1,-1,-1,-1, 1, 1,
92
1,-1, 1,-1,-1, 1,-1, 1,
93
1,-1,-1, 1,-1, 1, 1,-1};
96
static int D4H[100] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
97
1, 1, 1,-1,-1, 1, 1, 1,-1,-1,
98
1,-1, 1, 1,-1, 1,-1, 1, 1,-1,
99
1,-1, 1,-1, 1, 1,-1, 1,-1, 1,
100
2, 0,-2, 0, 0, 2, 0,-2, 0, 0,
101
1, 1, 1, 1, 1,-1,-1,-1,-1,-1,
102
1, 1, 1,-1,-1,-1,-1,-1, 1, 1,
103
1,-1, 1, 1,-1,-1, 1,-1,-1, 1,
104
1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
105
2, 0,-2, 0, 0,-2, 0, 2, 0, 0};
107
static int OH[100] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
108
1, 1,-1,-1, 1, 1,-1, 1, 1,-1,
109
2,-1, 0, 0, 2, 2, 0,-1, 2, 0,
110
3, 0,-1, 1,-1, 3, 1, 0,-1,-1,
111
3, 0, 1,-1,-1, 3,-1, 0,-1, 1,
112
1, 1, 1, 1, 1,-1,-1,-1,-1,-1,
113
1, 1,-1,-1, 1,-1, 1,-1,-1, 1,
114
2,-1, 0, 0, 2,-2, 0, 1,-2, 0,
115
3, 0,-1, 1,-1,-3,-1, 0, 1, 1,
116
3, 0, 1,-1,-1,-3, 1, 0, 1,-1};
118
static int D6H[144] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
119
1, 1, 1, 1,-1,-1, 1, 1, 1, 1,-1,-1,
120
1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1,
121
1,-1, 1,-1,-1, 1, 1,-1, 1,-1,-1, 1,
122
2, 1,-1,-2, 0, 0, 2, 1,-1,-2, 0, 0,
123
2,-1,-1, 2, 0, 0, 2,-1,-1, 2, 0, 0,
124
1, 1, 1, 1, 1, 1,-1,-1,-1,-1,-1,-1,
125
1, 1, 1, 1,-1,-1,-1,-1,-1,-1, 1, 1,
126
1,-1, 1,-1, 1,-1,-1, 1,-1, 1,-1, 1,
127
1,-1, 1,-1,-1, 1,-1, 1,-1, 1, 1,-1,
128
2, 1,-1,-2, 0, 0,-2,-1, 1, 2, 0, 0,
129
2,-1,-1, 2, 0, 0,-2, 1, 1,-2, 0, 0};
131
nirreps = get_nirreps(ptgrp);
132
table = init_int_matrix(nirreps,nirreps);
136
if (strcmp(ptgrp,"C1 ") == 0)
139
else if ((strcmp(ptgrp,"CS ") == 0) || (strcmp(ptgrp,"CI ") == 0) || (strcmp(ptgrp,"C2 ") == 0)) {
140
for (i=0;i<nirreps;++i)
141
for (j=0;j<nirreps;++j)
142
table[i][j] = CS[count++];
144
else if ((strcmp(ptgrp,"D2 ") == 0) || (strcmp(ptgrp,"C2V") == 0)) {
145
for (i=0;i<nirreps;++i)
146
for (j=0;j<nirreps;++j)
147
table[i][j] = D2[count++];
149
else if (strcmp(ptgrp,"C2H") == 0) {
150
for (i=0;i<nirreps;++i)
151
for (j=0;j<nirreps;++j)
152
table[i][j] = C2H[count++];
154
else if ((strcmp(ptgrp,"C3V") == 0) || (strcmp(ptgrp,"D3 ") == 0)) {
155
for (i=0;i<nirreps;++i)
156
for (j=0;j<nirreps;++j)
157
table[i][j] = D3[count++];
159
else if ((strcmp(ptgrp,"C4V") == 0) || (strcmp(ptgrp,"D2D") == 0) || (strcmp(ptgrp,"D4 ") == 0)) {
160
for (i=0;i<nirreps;++i)
161
for (j=0;j<nirreps;++j)
162
table[i][j] = D4[count++];
164
else if ((strcmp(ptgrp,"O ") == 0) || (strcmp(ptgrp,"TD ") == 0)) {
165
for (i=0;i<nirreps;++i)
166
for (j=0;j<nirreps;++j)
167
table[i][j] = TD[count++];
169
else if ((strcmp(ptgrp,"C6V") == 0) || (strcmp(ptgrp,"D6 ") == 0)) {
170
for (i=0;i<nirreps;++i)
171
for (j=0;j<nirreps;++j)
172
table[i][j] = D6[count++];
174
else if ((strcmp(ptgrp,"D3D") == 0) || (strcmp(ptgrp,"D3H") == 0)) {
175
for (i=0;i<nirreps;++i)
176
for (j=0;j<nirreps;++j)
177
table[i][j] = D3D[count++];
179
else if (strcmp(ptgrp,"D2H") == 0) {
180
for (i=0;i<nirreps;++i)
181
for (j=0;j<nirreps;++j)
182
table[i][j] = D2H[count++];
184
else if (strcmp(ptgrp,"D4H") == 0) {
185
for (i=0;i<nirreps;++i)
186
for (j=0;j<nirreps;++j)
187
table[i][j] = D4H[count++];
189
else if (strcmp(ptgrp,"OH ") == 0) {
190
for (i=0;i<nirreps;++i)
191
for (j=0;j<nirreps;++j)
192
table[i][j] = OH[count++];
194
else if (strcmp(ptgrp,"D6H") == 0) {
195
for (i=0;i<nirreps;++i)
196
for (j=0;j<nirreps;++j)
197
table[i][j] = D6H[count++];
210
int get_nirreps(char *ptgrp) {
212
if (strcmp(ptgrp,"C1 ") == 0)
214
else if ((strcmp(ptgrp,"CS ") == 0) || (strcmp(ptgrp,"CI ") == 0) || (strcmp(ptgrp,"C2 ") == 0))
216
else if ((strcmp(ptgrp,"C2V") == 0) || (strcmp(ptgrp,"D2 ") == 0))
218
else if (strcmp(ptgrp,"C2H") == 0)
220
else if ((strcmp(ptgrp,"C3V") == 0) || (strcmp(ptgrp,"D3 ") == 0))
222
else if ((strcmp(ptgrp,"C5V") == 0) || (strcmp(ptgrp,"D5") == 0))
224
else if ((strcmp(ptgrp,"C4V") == 0) || (strcmp(ptgrp,"D2D") == 0) || (strcmp(ptgrp,"D4 ") == 0))
226
else if ((strcmp(ptgrp,"O ") == 0) || (strcmp(ptgrp,"TD ") == 0))
228
else if ((strcmp(ptgrp,"C6V") == 0) || (strcmp(ptgrp,"D6 ") == 0))
230
else if ((strcmp(ptgrp,"D3D") == 0) || (strcmp(ptgrp,"D3H") == 0))
232
else if (strcmp(ptgrp,"D4D") == 0)
234
else if (strcmp(ptgrp,"D2H") == 0)
236
else if ((strcmp(ptgrp,"D5D") == 0) || (strcmp(ptgrp,"D5H") == 0))
238
else if (strcmp(ptgrp,"D6D") == 0)
240
else if (strcmp(ptgrp,"D4H") == 0)
242
else if (strcmp(ptgrp,"OH ") == 0)
244
else if (strcmp(ptgrp,"D6H") == 0)
250
const char **get_symm_ops(char *ptgrp) {
255
static const char *C1[] = {"E"};
256
static const char *CS[] = {"E","SGH"};
257
static const char *CI[] = {"E","I"};
258
static const char *C2[] = {"E","C2"};
259
static const char *D2[] = {"E","C2Z","C2Y","C2X"};
260
static const char *C2V[] = {"E","C2","SGV","SGV"};
261
static const char *C2H[] = {"E","C2","I","SGH"};
262
static const char *D3[] = {"E","C3","C2"};
263
static const char *C3V[] = {"E","C3","SGV"};
264
static const char *D4[] = {"E","C4","C2","C2'","C2\""};
265
static const char *D2D[] = {"E","S4","C2","C2'","SGD"};
266
static const char *C4V[] = {"E","C4","C2","SGV","SGD"};
267
static const char *TD[] = {"E","C3","C2","S4","SGD"};
268
static const char *O[] = {"E","C3","C2","C4","C2"};
269
static const char *D6[] = {"E","C6","C3","C2","C2'","C2\""};
270
static const char *C6V[] = {"E","C6","C3","C2","SGV","SGD"};
271
static const char *D3D[] = {"E","C3","C2","I","S6","SGD"};
272
static const char *D3H[] = {"E","C3","C2","SGH","S3","SGV"};
273
static const char *D2H[] = {"E","C2Z","C2Y","C2X","I","SGXY","SGXZ","SGYZ"};
274
static const char *D4H[] = {"E","C4","C2","C2'","C2\"","I","S4","SGH","SGV","SGD"};
275
static const char *OH[] = {"E","C3","C2","C4","C2","I","S4","S6","SGH","SGD"};
276
static const char *D6H[] = {"E","C6","C3","C2","C2'","C2\"","I","S3","S6","SGH","SGD","SGV"};
278
if (strcmp(ptgrp,"C1 ") == 0)
280
else if (strcmp(ptgrp,"CS ") == 0)
282
else if (strcmp(ptgrp,"CI ") == 0)
284
else if (strcmp(ptgrp,"C2 ") == 0)
286
else if (strcmp(ptgrp,"C2V") == 0)
288
else if (strcmp(ptgrp,"D2 ") == 0)
290
else if (strcmp(ptgrp,"C2H") == 0)
292
else if (strcmp(ptgrp,"C3V") == 0)
294
else if (strcmp(ptgrp,"D3 ") == 0)
296
else if (strcmp(ptgrp,"C4V") == 0)
298
else if (strcmp(ptgrp,"D2D") == 0)
300
else if (strcmp(ptgrp,"D4 ") == 0)
302
else if (strcmp(ptgrp,"O ") == 0)
304
else if (strcmp(ptgrp,"TD ") == 0)
306
else if (strcmp(ptgrp,"C6V") == 0)
308
else if (strcmp(ptgrp,"D6 ") == 0)
310
else if (strcmp(ptgrp,"D3D") == 0)
312
else if (strcmp(ptgrp,"D3H") == 0)
314
else if (strcmp(ptgrp,"D2H") == 0)
316
else if (strcmp(ptgrp,"D4H") == 0)
318
else if (strcmp(ptgrp,"OH ") == 0)
320
else if (strcmp(ptgrp,"D6H") == 0)
329
const char **get_irrep_labels(char *ptgrp) {
334
static const char *C1[] = {"A"};
335
static const char *CS[] = {"Ap","App"};
336
static const char *CI[] = {"Ag","Au"};
337
static const char *C2[] = {"A","B"};
338
static const char *D2[] = {"A","B1","B2","B3"};
339
static const char *C2V[] = {"A1","A2","B1","B2"};
340
static const char *C2H[] = {"Ag","Bg","Au","Bu"};
341
static const char *D3[] = {"A1","A2","E"};
342
static const char *C3V[] = {"A1","A2","E"};
343
static const char *D4[] = {"A1","A2","B1","B2","E"};
344
static const char *D2D[] = {"A1","A2","B1","B2","E"};
345
static const char *C4V[] = {"A1","A2","B1","B2","E"};
346
static const char *TD[] = {"A1","A2","E","T1","T2"};
347
static const char *O[] = {"A1","A2","E","T1","T2"};
348
static const char *D6[] = {"A1","A2","B1","B2","E1","E2"};
349
static const char *C6V[] = {"A1","A2","B1","B2","E1","E2"};
350
static const char *D3D[] = {"A1g","A2g","Eg","A1u","A2u","Eu"};
351
static const char *D3H[] = {"A1p","A2p","Ep","A1pp","A2pp","Epp"};
352
static const char *D2H[] = {"Ag","B1g","B2g","B3g","Au","B1u","B2u","B3u"};
353
static const char *D4H[] = {"A1g","A2g","B1g","B2g","Eg","A1u","A2u","B1u","B2u","Eu"};
354
static const char *OH[] = {"A1g","A2g","Eg","T1g","T2g","A1u","A2u","Eu","T1u","T2u"};
355
static const char *D6H[] = {"A1g","A2g","B1g","B2g","E1g","E2g","A1u","A2u","B1u","B2u","E1u","E2u"};
357
if (strcmp(ptgrp,"C1 ") == 0)
359
else if (strcmp(ptgrp,"CS ") == 0)
361
else if (strcmp(ptgrp,"CI ") == 0)
363
else if (strcmp(ptgrp,"C2 ") == 0)
365
else if (strcmp(ptgrp,"C2V") == 0)
367
else if (strcmp(ptgrp,"D2 ") == 0)
369
else if (strcmp(ptgrp,"C2H") == 0)
371
else if (strcmp(ptgrp,"C3V") == 0)
373
else if (strcmp(ptgrp,"D3 ") == 0)
375
else if (strcmp(ptgrp,"C4V") == 0)
377
else if (strcmp(ptgrp,"D2D") == 0)
379
else if (strcmp(ptgrp,"D4 ") == 0)
381
else if (strcmp(ptgrp,"O ") == 0)
383
else if (strcmp(ptgrp,"TD ") == 0)
385
else if (strcmp(ptgrp,"C6V") == 0)
387
else if (strcmp(ptgrp,"D6 ") == 0)
389
else if (strcmp(ptgrp,"D3D") == 0)
391
else if (strcmp(ptgrp,"D3H") == 0)
393
else if (strcmp(ptgrp,"D2H") == 0)
395
else if (strcmp(ptgrp,"D4H") == 0)
397
else if (strcmp(ptgrp,"OH ") == 0)
399
else if (strcmp(ptgrp,"D6H") == 0)
408
int *get_ops_coeffs(char *ptgrp) {
410
static int C1[] = {1};
411
static int CS[] = {1,1};
412
static int CI[] = {1,1};
413
static int C2[] = {1,1};
414
static int D2[] = {1,1,1,1};
415
static int C2V[] = {1,1,1,1};
416
static int C2H[] = {1,1,1,1};
417
static int D3[] = {1,2,3};
418
static int C3V[] = {1,2,3};
419
static int D4[] = {1,2,1,2,2};
420
static int D2D[] = {1,2,1,2,2};
421
static int C4V[] = {1,2,1,2,2};
422
static int TD[] = {1,8,3,6,6};
423
static int O[] = {1,8,3,6,6};
424
static int D6[] = {1,2,2,1,3,3};
425
static int C6V[] = {1,2,2,1,3,3};
426
static int D3D[] = {1,2,3,1,2,3};
427
static int D3H[] = {1,2,3,1,2,3};
428
static int D2H[] = {1,1,1,1,1,1,1,1};
429
static int D4H[] = {1,2,1,2,2,1,2,1,2,2};
430
static int OH[] = {1,8,6,6,3,1,6,8,3,6};
431
static int D6H[] = {1,2,2,1,3,3,1,2,2,1,3,3};
433
if (strcmp(ptgrp,"C1 ") == 0)
435
else if (strcmp(ptgrp,"CS ") == 0)
437
else if (strcmp(ptgrp,"CI ") == 0)
439
else if (strcmp(ptgrp,"C2 ") == 0)
441
else if (strcmp(ptgrp,"C2V") == 0)
443
else if (strcmp(ptgrp,"D2 ") == 0)
445
else if (strcmp(ptgrp,"C2H") == 0)
447
else if (strcmp(ptgrp,"C3V") == 0)
449
else if (strcmp(ptgrp,"D3 ") == 0)
451
else if (strcmp(ptgrp,"C4V") == 0)
453
else if (strcmp(ptgrp,"D2D") == 0)
455
else if (strcmp(ptgrp,"D4 ") == 0)
457
else if (strcmp(ptgrp,"O ") == 0)
459
else if (strcmp(ptgrp,"TD ") == 0)
461
else if (strcmp(ptgrp,"C6V") == 0)
463
else if (strcmp(ptgrp,"D6 ") == 0)
465
else if (strcmp(ptgrp,"D3D") == 0)
467
else if (strcmp(ptgrp,"D3H") == 0)
469
else if (strcmp(ptgrp,"D2H") == 0)
471
else if (strcmp(ptgrp,"D4H") == 0)
473
else if (strcmp(ptgrp,"OH ") == 0)
475
else if (strcmp(ptgrp,"D6H") == 0)
484
int get_num_ops(char *ptgrp) {
486
if (strcmp(ptgrp,"C1 ") == 0)
488
else if (strcmp(ptgrp,"CS ") == 0)
490
else if (strcmp(ptgrp,"CI ") == 0)
492
else if (strcmp(ptgrp,"C2 ") == 0)
494
else if (strcmp(ptgrp,"C2V") == 0)
496
else if (strcmp(ptgrp,"D2 ") == 0)
498
else if (strcmp(ptgrp,"C2H") == 0)
500
else if (strcmp(ptgrp,"C3V") == 0)
502
else if (strcmp(ptgrp,"D3 ") == 0)
504
else if (strcmp(ptgrp,"C4V") == 0)
506
else if (strcmp(ptgrp,"D2D") == 0)
508
else if (strcmp(ptgrp,"D4 ") == 0)
510
else if (strcmp(ptgrp,"O ") == 0)
512
else if (strcmp(ptgrp,"TD ") == 0)
514
else if (strcmp(ptgrp,"C6V") == 0)
516
else if (strcmp(ptgrp,"D6 ") == 0)
518
else if (strcmp(ptgrp,"D3D") == 0)
520
else if (strcmp(ptgrp,"D3H") == 0)
522
else if (strcmp(ptgrp,"D2H") == 0)
524
else if (strcmp(ptgrp,"D4H") == 0)
526
else if (strcmp(ptgrp,"OH ") == 0)
528
else if (strcmp(ptgrp,"D6H") == 0)
537
int get_num_classes(char *ptgrp) {
539
if (strcmp(ptgrp,"C1 ") == 0)
541
else if (strcmp(ptgrp,"CS ") == 0)
543
else if (strcmp(ptgrp,"CI ") == 0)
545
else if (strcmp(ptgrp,"C2 ") == 0)
547
else if (strcmp(ptgrp,"C2V") == 0)
549
else if (strcmp(ptgrp,"D2 ") == 0)
551
else if (strcmp(ptgrp,"C2H") == 0)
553
else if (strcmp(ptgrp,"C3V") == 0)
555
else if (strcmp(ptgrp,"D3 ") == 0)
557
else if (strcmp(ptgrp,"C4V") == 0)
559
else if (strcmp(ptgrp,"D2D") == 0)
561
else if (strcmp(ptgrp,"D4 ") == 0)
563
else if (strcmp(ptgrp,"O ") == 0)
565
else if (strcmp(ptgrp,"TD ") == 0)
567
else if (strcmp(ptgrp,"C6V") == 0)
569
else if (strcmp(ptgrp,"D6 ") == 0)
571
else if (strcmp(ptgrp,"D3D") == 0)
573
else if (strcmp(ptgrp,"D3H") == 0)
575
else if (strcmp(ptgrp,"D2H") == 0)
577
else if (strcmp(ptgrp,"D4H") == 0)
579
else if (strcmp(ptgrp,"OH ") == 0)
581
else if (strcmp(ptgrp,"D6H") == 0)
588
/*** GET_OPS_IN_CLASS : finds numbers of operations in the classes
589
* of the molecular point group. nirreps is for checking */
591
int *get_ops_in_class(char *ptgrp, int nirreps) {
593
int num_class, *num_ops, error_var = 0;
595
static int class_C1[] = {1},
603
class_D2[] = {1,1,1,1},
607
class_D3[] = {1,2,3},
611
class_D4[] = {1,2,1,2,2},
615
class_TD[] = {1,8,3,6,6},
619
class_D6[] = {1,2,2,1,3,3},
623
class_D3D[] = {1,2,3,1,2,3},
626
class_D2H[] = {1,1,1,1,1,1,1,1},
629
class_D4H[] = {1,2,1,2,2,1,2,1,2,2},
632
class_OH[] = {1,8,6,6,3,1,6,8,3,6},
635
class_D6H[] = {1,2,2,1,3,3,1,2,2,1,3,3},
639
if (strcmp(ptgrp,"C1 ") == 0) {
640
if(nirreps == num_class_C1)
644
else if (strcmp(ptgrp,"CS ")==0 || strcmp(ptgrp,"CI ")==0 ||
645
strcmp(ptgrp,"C2 ")==0) {
646
if(nirreps == num_class_CS)
650
else if (strcmp (ptgrp, "C2V")==0 || strcmp (ptgrp, "D2 ")==0 ||
651
strcmp(ptgrp,"C2H")==0) {
652
if(nirreps == num_class_D2)
656
else if(strcmp(ptgrp,"C3V")==0 || strcmp(ptgrp,"D3 ")==0) {
657
if(nirreps == num_class_D3)
662
else if(strcmp(ptgrp,"C4V")==0 || strcmp(ptgrp,"D2D")==0 ||
663
strcmp(ptgrp,"D4 ")==0) {
664
if(nirreps == num_class_D4)
669
else if(strcmp(ptgrp,"O ")==0 || strcmp(ptgrp,"TD ")==0) {
670
if(nirreps == num_class_TD)
675
else if(strcmp(ptgrp,"C6V")==0 || strcmp(ptgrp,"D6 ")==0) {
676
if(nirreps == num_class_D6)
681
else if(strcmp(ptgrp,"D3D")==0 || strcmp(ptgrp,"D3H")==0) {
682
if(nirreps == num_class_D3D)
687
else if(strcmp(ptgrp,"D2H")==0) {
688
if(nirreps == num_class_D2H)
693
else if(strcmp(ptgrp,"D4H")==0) {
694
if(nirreps == num_class_D4H)
699
else if(strcmp(ptgrp,"OH ")==0) {
700
if(nirreps == num_class_OH)
705
else if(strcmp(ptgrp,"D6H")==0) {
706
if(nirreps == num_class_D6H)
711
else if (num_ops[0] == 0) error_var = 1;
714
punt("problem assigning number of operations per class");
721
}} /* namespace psi::optking */