pyxtal.supergroup module

Module to search for the supergroup symmetry

pyxtal.supergroup.find_mapping(atom_sites, splitter, max_num=720)[source]

search for all mappings for a given splitter

Parameters:
  • atom_sites – list of wp object

  • splitter – wp_splitter object

  • max_num (int) – maximum number of atomic mapping

Returns:

unique solutions

pyxtal.supergroup.find_mapping_per_element(sites1, sites2, max_num=720)[source]

search for all mappings for a given splitter

Parameters:
  • sites1 (list) – e.g., l layer [‘4a’, ‘8b’, ‘4c’]

  • sites2 (list) – e.g., 2 layers [[‘4a’], [‘8b’, ‘4c’]]

  • max_num (int) – maximum number of atomic mapping

Returns:

e.g. 3 layers: [[[0], [1,2]]]

Return type:

unique solutions

pyxtal.supergroup.find_xyz(G2_op, coord, quadrant=[0, 0, 0])[source]

Finds the x,y,z free parameter values for positions in the G_2 basis.

Parameters:
  • G2_op – a symmetry operation in G2

  • coord – the coordinate that matches G2_op

  • quadrant – a 3 item list (ex:[1,1,-1]) that contains information on the orientation of the molecule

Returns:

x,y,z parameters written in the G2 basis

Return type:

G2_holder

pyxtal.supergroup.new_path(path, paths)[source]

check if it is a new path

pyxtal.supergroup.new_structure(struc, refs)[source]

check if struc is already in the reference solutions

pyxtal.supergroup.search_G1(G, rot, tran, pos, wp1, op)[source]

search the best matched position in G1 basis

Parameters:
  • G – the target space group object

  • rot – rotation, 3*3 matrix

  • tran – translation, 1*3 vector

  • pos – starting position

  • wp1 – wyckoff symmetry

  • op – one symmetry operation

Returns:

the cloest position and the distance

pyxtal.supergroup.search_G2(rot, tran, pos1, pos2, cell=None)[source]

search the best matched position in G2 basis

Parameters:
  • rot – 3*3 rotation matrix

  • tran – 1*3 translation vector

  • pos1 – position in G1

  • pos2 – reference position in G2

  • cell – 3*3 matrix

Returns:

matched position in G2 dist: relative distance

Return type:

pos

class pyxtal.supergroup.supergroup(struc, G)[source]

Bases: object

Class to find the structure with supergroup symmetry

Parameters:
  • struc – pyxtal structure

  • G – target supergroup number

calc_disps(split_id, solution, d_tol)[source]

For a given solution, compute the minimum disp by adusting translation.

Parameters:
  • split_id (int) – integer

  • solution (list) – e.g., [[‘2d’], [‘6h’], [‘2c’, ‘6h’, ‘12i’]]

  • d_tol (float) – tolerance

Returns:

maximum atomic displcement translation: overall cell translation

Return type:

max_disp

get_coord_H(splitter, id, atom_sites_H, mapping)[source]

Extract the atomic coordinates

get_initial_mask(splitter)[source]

Get the mask

make_pyxtal_in_supergroup(solution)[source]

Make the pyxtal according to the given solution

Parameters:

solution – a tuple of (sp, mapping, translation, wyc_set_id, max_disp)

Returns:

a pyxtal structure in high symmetry

make_pyxtals_in_subgroup(solution, N_images=5)[source]

Make the pyxtal according to the given solution

Parameters:
  • solution – a tuple of (sp, mapping, translation, wyc_set_id, max_disp)

  • N_images – number of images

Returns:

a list of pyxtal structures in low symmetry

make_supergroup(solutions, show_detail=False)[source]

Create unique supergroup structures from a list of solutions

Parameters:
  • solutions – list of tuples (splitter, mapping, translation, disp)

  • show_detail (bool) – print out the detail

Returns:

list of pyxtal structures

print_detail(solution, coords_H, coords_G, elements)[source]

Print out the details of tranformation

print_wp(sp, id)[source]

A short cut to print the wp information (for debug purpose)

search_supergroup(d_tol=0.9, max_per_G=2500, max_solutions=None)[source]

Search for valid supergroup transition

Parameters:
  • d_tol (float) – tolerance for atomic displacement

  • max_per_G (int) – maximum number of possible solution for each G

  • max_solutions (int) – maximum number of solutions.

Returns:

list of solutions with small displacements

Return type:

solutions

sort_solutions(solutions)[source]
symmetrize(splitter, mapping, translation)[source]

Symmetrize the structure (G) to supergroup symmetry (H)

Parameters:
  • splitter – splitter object to specify the relation between G and H

  • mapping – atomic mapping between H and G

  • translation – an overall shift from H to G, None or 3 vector

Returns:

coordinates in G coords_G2: coordinates in G under the subgroup setting coords_H1: coordinates in H elements: list of elements

Return type:

coords_G1

symmetrize_dist(splitter, mapping, mask, translation=None, d_tol=1.2)[source]

For a given solution, search for the possbile supergroup structure based on a given translation and mask.

Parameters:
  • splitter – splitter object between G and H

  • mapping – list of sites in H, e.g., [‘4a’, ‘8b’]

  • mask – if there is a need to freeze the direction

  • translation – an overall shift from H to G, None or 3 vector

  • d_tol – the tolerance in angstrom

Returns:

atomic displacement cell translation vector mask

symmetrize_site_double_k(splitter, id, coord_H, translation, run_type=1)[source]

Symmetrize two WPs (wp_h1, wp_h2) to another wp_G with higher symmetry

Parameters:
  • splitter – splitter object

  • id – index of splitter

  • coord_H – 2*3 coordinates

  • translation – 1*3 transaltion vector

  • run_type – return distance or coordinates

symmetrize_site_double_t(splitter, id, coord_H, translation, run_type=1)[source]

Symmetrize two WPs (wp_h1, wp_h2) to another wp_G with higher symmetry

Parameters:
  • splitter – splitter object

  • id – the id in the splitter

  • coord_H – coordinates to work on

  • translation – 1*3 transaltion vector

  • run_type – return distance or coordinates

symmetrize_site_multi(splitter, id, coord_H, translation, run_type=1)[source]

Symmetrize multiple WPs to another with higher symmetry

Parameters:
  • splitter – splitter object

  • id – the id in the splitter

  • coord_H – coordinates to work on

  • translation – 1*3 transaltion vector

  • run_type – return distance or coordinates

symmetrize_site_single(splitter, id, base, translation, run_type=1)[source]

Symmetrize one WP to another with higher symmetry

Parameters:
  • splitter – splitter object

  • id – index of splitter

  • base – atomic position of site in H

  • translation – 1*3 translation vector

  • run_type – return distance or coordinates

class pyxtal.supergroup.supergroups(struc, G=None, path=None, d_tol=1.0, max_per_G=100, max_layer=5, show=False)[source]

Bases: object

Class to search for the feasible transition to a given super group

Parameters:
  • struc – pyxtal structure

  • G (int) – the desired super group number

  • path – the path to connect G and H, e.g, [62, 59, 74]

  • d_tol (float) – tolerance for largest atomic displacement

  • show (bool) – whether or not show the detailed process

get_transformation(N_images=2)[source]

Get the series of transformed structures between H and G

Parameters:

N_images – number of structures

Returns:

a series of pyxtal structures

print_solutions()[source]
struc_along_path(path)[source]

Search for the super group structure along a given path

Parameters:

path – [59, 71, 139]

Returns:

list of structures along the path working_path: list of space group path valid: True or False

Return type:

strucs

write_cifs()[source]

Dump the cif files in sequence

pyxtal.supergroup.write_poscars(H_struc, G_struc, mappings, splitters, wyc_sets, N_images=3)[source]

Write the intermediate POSCARs betwee H and G structure. The key is to continuously change G to subgroup represenations with zero displacements. Finally, call write_poscars_intermediate.

Parameters:
  • H_struc – PyXtal low symmetry structure

  • G_strucs – a list of PyXtal high symmetry structures

  • mapping – a list of atomic mappings

  • splitter – a list of splitter object

  • wyc_set – a list of wyc_set transformation

  • N_images – number of intermediate structures between H and G

Returns:

a list of POSCARs