pythmpg.mpg_dicts

Construct dictionaries describing the operations and structure of magnetic point groups.

Upon being imported, this module constructs six dictionaries and makes them available to external modules as module-level attributes. The first four are built from functions imported from pg_elements; the remaining two are built by get_mpg_dict() and get_bns_dict(), which are called at module level at the end of this file. Following normal Python import rules, these module-level statements execute once per session on first import.

pythmpg.mpg_dicts.hex_rot_dict

Maps rotation name (str, 1-2 characters) to rotation matrix (numpy 3×3 float array) for the hexagonal setting.

Type:

dict

pythmpg.mpg_dicts.cub_rot_dict

Maps rotation name (str, 1-2 characters) to rotation matrix (numpy 3×3 float array) for the cubic setting.

Type:

dict

pythmpg.mpg_dicts.hex_table_dict

Multiplication table for hexagonal operations. Keys are 2-tuples of rotation names; values are the resulting rotation name (str).

Type:

dict

pythmpg.mpg_dicts.cub_table_dict

Multiplication table for cubic rotations. Keys are 2-tuples of rotation names; values are the resulting rotation name (str).

Type:

dict

pythmpg.mpg_dicts.mpg_dict

Maps each MPG name (str) to a 3-tuple (frame, generators, gen_orders) where frame is 'hex' or 'cub', generators is a list of polycyclic generator 3-tuples, and gen_orders is a list of their corresponding orders (int).

Type:

dict

pythmpg.mpg_dicts.bns_dict

Maps each MPG name (str) to its BNS (Belov-Neronova-Smirnova) serial number (str).

Type:

dict

pythmpg.mpg_dicts.get_bns_dict()[source]

Build the dictionary mapping MPG names to BNS serial numbers.

BNS refers to the Belov-Neronova-Smirnova notation for magnetic point groups. Serial numbers have the form 'c.p.m' where c is the index of the classical (non-magnetic) parent group, p is the index of the MPG within that parent, and m is the overall 1-based index across all 122 MPGs.

Returns:

bns_dict – Maps each MPG name (str) to its BNS serial number (str).

Return type:

dict

pythmpg.mpg_dicts.get_closure(in_list)[source]

Compute the closure of a set of MPG operations under multiplication.

Starting from the supplied operations, repeatedly forms all pairwise products and adds any new results until the set is closed.

Parameters:

in_list (list of tuple) – Initial MPG operations, each a 3-tuple (rot, p_space, p_time).

Returns:

op_list – Smallest closed set of MPG operations containing all elements of in_list.

Return type:

list of tuple

pythmpg.mpg_dicts.get_cycle(op)[source]

Compute all elements of the cyclic group generated by one MPG operation.

Repeatedly multiplies op by itself (starting from the identity) until the identity is recovered. No MPG operation has order greater than 6, so the loop is bounded accordingly.

Parameters:

op (tuple) – A single MPG operation as a 3-tuple (rot, p_space, p_time).

Returns:

cycle – All elements of the cyclic group generated by op, beginning with the identity ('1', 0, 0).

Return type:

list of tuple

pythmpg.mpg_dicts.get_mpg_dict()[source]

Construct the dictionary of all 122 magnetic point groups (MPGs).

Each MPG is represented as a polycyclic group: its elements can be written uniquely as g_1^k_1 ... g_M^k_M, where g_m is the m-th polycyclic generator of order N_m and k_m ranges from 0 to N_m - 1. The order of the MPG is therefore the product of the generator orders. Polycyclic generators are used in preference to the generators listed in the International Tables or the Bilbao Crystallographic server (which are not generally polycyclic) because they make subsequent operations more straightforward and efficient.

All individual MPG operations are 3-tuples (rot, p_space, p_time) where rot is the proper rotation name (str, 1-2 characters), and p_space and p_time are 0 or 1 indicating composition with spatial inversion or time reversal respectively.

Returns:

mpg_dict – Maps each MPG name (str) to a 3-tuple (frame, generators, gen_orders):

framestr

'hex' for hexagonal setting, 'cub' for cubic.

generatorslist of tuple

Polycyclic generators, each a 3-tuple (rot, p_space, p_time).

gen_orderslist of int

Order of each polycyclic generator.

Return type:

dict

Notes

The ‘generators’ listed in the International Tables and in the Bilbao Crystallographic server are not generally polycyclic. The construction of polycyclic generators in this module makes the coding of some later operations more straightforward and efficient.

pythmpg.mpg_dicts.parse_mpg(mpg, if_print=False)[source]

Parse an MPG name and derive its polycyclic generators and their orders.

Reads the Hermann-Mauguin symbol, assigns rotation-axis suffixes, selects the hexagonal or cubic reference frame, inserts any extra generators required for cubic groups 23 and 432, removes redundant generators, and verifies that the resulting polycyclic generator set produces a group of the correct order with no duplicate elements.

Parameters:
  • mpg (str) – Magnetic point group name in Hermann-Mauguin notation, e.g. '4/mmm', "m'-3'm".

  • if_print (bool, optional) – If True, print intermediate results to stdout for debugging. Default is False.

Returns:

  • frame (str) – Reference frame: 'hex' for hexagonal, 'cub' for cubic.

  • generators (list of tuple) – Polycyclic generators of the MPG, each a 3-tuple (rot, p_space, p_time).

  • generator_orders (list of int) – Order of each polycyclic generator.

pythmpg.mpg_dicts.product(op1, op2)[source]

Compute the product of two MPG operations.

Each MPG operation is a 3-tuple (rot, p_space, p_time) where rot is a proper rotation name (str, 1-2 characters) and p_space, p_time are 0 or 1. The proper-rotation part of the product is looked up in the module-level table_dict. Spatial and time parities combine by addition modulo 2.

Parameters:
  • op1 (tuple) – First MPG operation, as a 3-tuple (rot, p_space, p_time).

  • op2 (tuple) – Second MPG operation, as a 3-tuple (rot, p_space, p_time).

Returns:

product – Resulting MPG operation, as a 3-tuple (rot, p_space, p_time).

Return type:

tuple