QPMS
Electromagnetic multiple scattering library and toolkit.
Loading...
Searching...
No Matches
Functions | Variables
finitegroups.c File Reference

Name lookup and iteration over the generated finite group tables. More...

#include "groups.h"
#include <string.h>
Include dependency graph for finitegroups.c:

Functions

static const qpms_finite_group_t * lookup_table (const qpms_finite_group_table_entry_t *table, size_t len, const char *name)
 
const qpms_finite_group_t * qpms_finite_group_from_name (const char *name)
 Looks up a finite group by its name over all the generated name tables.
 
size_t qpms_finite_group_list_len (void)
 Total number of the groups in the merged generated name tables.
 
const qpms_finite_group_t * qpms_finite_group_list_get (size_t i)
 The i'th group of the merged generated name tables (NULL past the end).
 
qpms_iri_t qpms_finite_group_find_irrep_by_name (const qpms_finite_group_t *G, const char *name)
 NOT IMPLEMENTED Get irrep index by name.
 
char * qpms_irrep_label_pretty (const char *name)
 "Pretty" (LaTeX math mode) rendering of an irrep label.
 

Variables

const qpms_finite_group_table_entry_t sspec_finite_group_table []
 
const size_t sspec_finite_group_table_len
 
const qpms_finite_group_table_entry_t sspec_finite_group_table_ext []
 
const size_t sspec_finite_group_table_ext_len
 

Detailed Description

Name lookup and iteration over the generated finite group tables.

The actual group data lives in the generated (and committed) files finitegroups_data.c (misc/codegen_finitegroups.py: the trivial group and the auxiliary reflection groups) and finitegroups_data_ext.c (misc/codegen_finitegroups_ext.py: all the proper point groups). This file only ties them together.

Function Documentation

◆ qpms_finite_group_from_name()

const qpms_finite_group_t * qpms_finite_group_from_name ( const char *  name)

Looks up a finite group by its name over all the generated name tables.

The tables are generated by misc/codegen_finitegroups.py (the trivial group trivial_g with aliases "trivial" and "C1", and the auxiliary reflection groups x_and_z_flip, y_and_z_flip) and misc/codegen_finitegroups_ext.py (all the proper point groups: the 32 crystallographic ones, the axial series C_n, S_2n, C_nh, C_nv, D_n, D_nd, D_nh for n <= 12, the cubic T, Td, Th, O, Oh and the icosahedral I, Ih; aliases "Ci" for S2 and "C3i" for S6). The original table is searched first. Returns NULL for an unknown name.

◆ qpms_finite_group_list_get()

const qpms_finite_group_t * qpms_finite_group_list_get ( size_t  i)

The i'th group of the merged generated name tables (NULL past the end).

The groups of finitegroups_data.c come first, then those of finitegroups_data_ext.c.

◆ qpms_irrep_label_pretty()

char * qpms_irrep_label_pretty ( const char *  name)

"Pretty" (LaTeX math mode) rendering of an irrep label.

Parses a conventional irrep label — a single capital letter or a UTF-8 character prefix (e.g. the Greek k-symbol of a projective label like "K5"), an optional index, an optional g/u parity suffix, and optional primes (e.g. "A", "A2''", "A1g", "Eu", "K5", "Γ3") — and returns its math-mode form with the subscripts typeset, e.g. "A_2''", "A_{1g}", "E_u", "K_5". Suitable for matplotlib mathtext or LaTeX when wrapped in $...$. Anything unparsable is copied verbatim. Returns a malloc()ed string to be free()d by the caller; NULL only for a NULL argument.