From f5073f8c14957899702d915a8e50c126900af342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Tue, 26 Feb 2019 08:15:03 +0200 Subject: [PATCH] Add group inverse array to qpms_finite_group_t. Former-commit-id: 4a61223d430f0c8ee73b2ceee83bbbfe4edc3521 --- qpms/groups.h | 3 ++- qpms/symmetries.py | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/qpms/groups.h b/qpms/groups.h index 96f9faa..b1198b7 100644 --- a/qpms/groups.h +++ b/qpms/groups.h @@ -43,9 +43,10 @@ struct qpms_irot3_t; */ typedef struct qpms_finite_group_t { char *name; - size_t order; ///< Group order (number of elements) + qpms_gmi_t order; ///< Group order (number of elements) qpms_gmi_t idi; ///< Identity element index qpms_gmi_t *mt; ///< Group multiplication table. If c = a*b, then ic = mt[order * ia + ib]. + qpms_gmi_t *invi; ///< Group elem inverse indices. qpms_gmi_t *gens; ///< A canonical set of group generators. int ngens; ///< Number of the generators in gens; qpms_permutation_t permrep[]; ///< Permutation representations of the elements. diff --git a/qpms/symmetries.py b/qpms/symmetries.py index 906a2e4..cd9f959 100644 --- a/qpms/symmetries.py +++ b/qpms/symmetries.py @@ -103,6 +103,10 @@ class SVWFPointGroupInfo: # only for point groups, coz in svwf_rep() I use I_tyt ss = ', '.join([str(permindices[permlist[i]*permlist[j]]) for j in range(order)]) s += ' ' + ss + ',\n' s += ' },\n' + # qpms_gmi_t *invi + s += ' { // invi\n' + s += ' ' + ', '.join([str(permindices[permlist[j]**-1]) for j in range(order)]) + s += '\n },\n' # qpms_gmi_t *gens s += ' {' + ', '.join([str(permindices[g]) for g in self.permgroupgens]) + '}, // gens\n' # int ngens @@ -111,7 +115,7 @@ class SVWFPointGroupInfo: # only for point groups, coz in svwf_rep() I use I_tyt s += ' { // permrep\n' for i in range(order): s += ' "%s",\n' % str(permlist[i]) - s += ' }\n' + s += ' },\n' # char **elemlabels s += ' NULL, // elemlabels\n' # int permrep_nelem