pyqcstrc.ico
: for icosahedral quasicrystals
Description
This modules provides algorithm for building 6D structural models of the icosahedral quasicrystals:
Translation operation of occupation domain
Symmetry operations of occupation domain
Intersection of two occupation domains
API Reference
This is the reference for building initial structural models of icosahedral quasicrystals.
Occupation domain
- pyqcstrc.ico.occupation_domain.as_it_is(obj)
Returns an object as it is,
- Parameters:
obj (numpy.ndarray) – the shape is (num,4,6,3) or (num*4,6,3), where num=numbre_of_tetrahedron.
- Returns:
the shape is (num,4,6,3), where num=numbre_of_tetrahedron.
- Return type:
Occupation domains (numpy.ndarray)
- pyqcstrc.ico.occupation_domain.asymmetric(symmetric_obj, position, vecs)
Asymmetric part of occupation domain.
- Parameters:
symmetric_obj (numpy.ndarray) – Occupation domain of which the asymmetric part is calculated. The shape is (num,4,6,3), where num=numbre_of_tetrahedron.
position (numpy.ndarray) – 6d coordinate of the site of which the occupation domain centres. The shape is (6,3)
vecs (numpy.ndarray) – Three vectors that defines the asymmetric part. The shape is (3,6,3)
- Returns:
The shape is (num,4,6,3), where num=numbre_of_tetrahedron.
- Return type:
Asymmetric part of the occupation domains (numpy.ndarray)
- pyqcstrc.ico.occupation_domain.gen_surface(obj, verbose=0)
Generate triangles on the surface of the occupation domain.
- Parameters:
obj (numpy.ndarray) – the occupation domain The shape is (num,4,6,3), where num=numbre_of_tetrahedron.
verbose (int) – verbose = 0 (silent, default) verbose = 1 (normal)
- Returns:
The shape is (num,3,6,3), where num=numbre_of_triangles.
- Return type:
Triangles of the occupation domains (numpy.ndarray)
- pyqcstrc.ico.occupation_domain.generate_edges(obj, verbose=0)
Generate edges of the occupation domain.
- Parameters:
obj (numpy.ndarray) – The occupation domain The shape is (num,4,6,3), where num=numbre_of_tetrahedron.
shift (numpy.ndarray) – 6d coordinate to which the occupation domain is shifted. The shape is (6,3)
verbose (int) – verbose = 0 (silent, default) verbose = 1 (normal)
- Returns:
The shape is (num,2,6,3), where num=numbre_of_edge.
- Return type:
Edges of the occupation domains (numpy.ndarray)
- pyqcstrc.ico.occupation_domain.read_xyz(path, basename, select='tetrahedron')
Load new occupation domain on input XYZ file.
- Parameters:
path (str) – Path of the input XYZ file
basename (str) – Basename of the input XYZ file
select (str) – ‘tetrahedron’: set of tetrahedra (default) ‘vertex’ : set of vertices (default, select = ‘tetrahedron’)
- Returns:
Loaded occupation domains. The shape is (num,4,6,3), where num=numbre_of_tetrahedra (select = ‘tetrahedron’). The shape is (num,6,3), where num=numbre_of_vertices (select = ‘vertex’).
- Return type:
Occupation domains (numpy.ndarray)
- pyqcstrc.ico.occupation_domain.shift(obj, shift, verbose=0)
Shift the occupation domain.
- Parameters:
obj (numpy.ndarray) – The occupation domain The shape is (num,4,6,3), where num=numbre_of_tetrahedron.
shift (numpy.ndarray) – 6d coordinate to which the occupation domain is shifted. The shape is (6,3)
verbose (int) – verbose = 0 (silent, default) verbose = 1 (normal)
- Returns:
The shape is (num,4,6,3), where num=numbre_of_tetrahedron.
- Return type:
Shifted occupation domains (numpy.ndarray)
- pyqcstrc.ico.occupation_domain.simpl_add_point(obj, point, verbose=0)
Legacy: simple
- pyqcstrc.ico.occupation_domain.simpl_manual(obj, num, verbose_level=0)
Legacy: simple
- pyqcstrc.ico.occupation_domain.simpl_manual_2(obj, num, obj_partial, verbose_level=0)
Legacy: simple
- pyqcstrc.ico.occupation_domain.simple(obj, select, num_cycle=3, verbose=0, num_cycle_234=[3, 0, 0], num_shuffle_234=[1, 0, 0])
Legacy: simple
- pyqcstrc.ico.occupation_domain.simple_hand_step1(obj, path, basename_tmp)
Simplification of occupation domains by hand (step1).
- Parameters:
obj (numpy.ndarray) – the occupation domain The shape is (num,4,6,3), where num=numbre_of_tetrahedron.
path (str) – path of the tmporal file
basename_tmp (str) – name for tmporal file.
- Returns:
The shape is (num,4,6,3), where num=numbre_of_tetrahedron.
- Return type:
Tmporal occupation domains (numpy.ndarray)
- pyqcstrc.ico.occupation_domain.simple_hand_step2(obj, merge_list)
Simplification of occupation domains by hand (step2).
- Parameters:
obj (numpy.ndarray) – the occupation domain The shape is (num,4,6,3), where num=numbre_of_tetrahedron.
merge_list (list[[int,int,int,int,],[],...,[]]) – A list containing lists of indices of vertices of tetrahedron. The indices of vertices of tetrahedron in temporal file obtaind by ‘simple_hand_step1()’.
- Returns:
The shape is (num,4,6,3), where num=numbre_of_tetrahedron.
- Return type:
Simplified occupation domains (numpy.ndarray)
- pyqcstrc.ico.occupation_domain.simple_rondom(obj, num_cycle, combination_num, verbose_level=0)
Legacy: simple
- pyqcstrc.ico.occupation_domain.simple_special(obj, num, num_cycle, verbose_level=0)
Legacy: simple_special
- pyqcstrc.ico.occupation_domain.simple_special_1(obj, num, num_cycle, verbose_level=0)
Legacy: simple
- pyqcstrc.ico.occupation_domain.simplification(obj, num_cycle=10, verbose=0)
Simplification of occupation domains.
- Parameters:
obj (numpy.ndarray) – the occupation domain The shape is (num,4,6,3), where num=numbre_of_tetrahedron.
num_cycle (int) – numbre of cycles
verbose (int) – verbose = 0 (silent, default) verbose = 1 (normal) verbose > 2 (detail)
- Returns:
- Simplified occupation domains (numpy.ndarray)
The shape is (num,4,6,3), where num=numbre_of_tetrahedron.
- pyqcstrc.ico.occupation_domain.site_symmetry(wyckoff_position, centering, verbose=0)
Symmetry operators in the site symmetry group G and its left coset decomposition.
- Parameters:
position (Wyckoff) – 6D coordinate. The shape is (6,3).
centering – primitive lattice (‘p’) face-centered lattice (‘f’) and body-centered lattice (‘i’)
verbose (int)
- Returns:
The symmetry operators leaves xyz identical.
- List of index of symmetry operators in the left coset representatives of the poibt group G (list):
The symmetry operators generates equivalent positions of the site xyz.
- Return type:
List of index of symmetry operators of the site symmetry group G (list)
- pyqcstrc.ico.occupation_domain.symmetric(asymmetric_part_obj, position)
Generate symmterical occupation domain by symmetric elements of m-3-5 on the asymmetric unit.
- Parameters:
asymmetric_part_obj (numpy.ndarray) – Asymmetric unit of the occupation domain The shape is (num,4,6,3), where num=numbre_of_tetrahedron.
position (numpy.ndarray) – 6d coordinate of the site of which the occupation domain centres. The shape is (6,3)
- Returns:
The shape is (num,4,6,3), where num=numbre_of_tetrahedron.
- Return type:
Symmetric occupation domains (numpy.ndarray)
- pyqcstrc.ico.occupation_domain.write(obj, path='.', basename='tmp', format='xyz', color='k', verbose=0, select='tetrahedron')
Export occupation domains.
- Parameters:
obj (numpy.ndarray) – the occupation domain The shape is (num,4,6,3), where num=numbre_of_tetrahedron.
path (str) – Path of the output XYZ file
basename (str) – Basename of the output XYZ file
format (str) – format of output file format = ‘xyz’ (default) format = ‘vesta’
color (str) – one of the characters {‘k’,’r’,’b’,’p’}, which are short-hand notations for shades of black, red, blue, and pink, in case where ‘vesta’ format is selected (default, color = ‘k’).
- Returns:
0 (succeed), 1 (fail)
- Return type:
int
- pyqcstrc.ico.occupation_domain.write_podatm(obj, position, vlist=[0], path='.', basename='tmp', shift=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], verbose=0)
Generate pod and atom files.
- Parameters:
obj (numpy.ndarray) – the occupation domain The shape is (num,4,6,3), where num=numbre_of_tetrahedron.
position (numpy.ndarray) – 6D coordinates of the position of the occupation domain.
vertices (list)
vlist (list)
path (str) – Path of the output files
basename (str) – Basename of the output files
verbose (int) – verbose = 0 (silent, default) verbose = 1 (normal)
- Returns:
0 (succeed), 1 (fail)
- Return type:
int
- pyqcstrc.ico.occupation_domain.write_vesta(obj, path='.', basename='tmp', color='k', select='normal', verbose=0)
Export occupation domains in VESTA format.
- Parameters:
obj (numpy.ndarray) – the occupation domain The shape is (num,4,6,3), where num=numbre_of_tetrahedron.
path (str) – Path of the output XYZ file
basename (str) – Basename of the output XYZ file
color (str) – one of the characters {‘k’,’r’,’b’,’p’}, which are short-hand notations for shades of black, red, blue, and pink, in case where ‘vesta’ format is selected (default, color = ‘k’).
select (str) – ‘simple’ or ‘normal’ ‘simple’: Merging tetrahedra into one single objecte ‘normal’: Each tetrahedron is set as single objecte (large file) ‘podatm’: same as ‘simple’ but return “vertices” necessary to input (default, select = ‘normal’)
- Returns:
0 (succeed), 1 (fail) when select = ‘simple’ or ‘normal’. ndarray: vertices, when select = ‘podatm’.
- Return type:
int
- pyqcstrc.ico.occupation_domain.write_xyz(obj, path='.', basename='tmp', select='tetrahedron', verbose=0)
Export occupation domains in XYZ format.
- Parameters:
obj (numpy.ndarray) – the occupation domain The shape is (num,4,6,3), where num=numbre_of_tetrahedron.
path (str) – Path of the output XYZ file
basename (str) – Basename of the output XYZ file
select (str) – ‘tetrahedron’: set of tetrahedra (default) ‘triangle’ : set of triangles ‘edge’ : set of edges ‘vertex’ : set of vertices (default, select = ‘tetrahedron’)
- Returns:
0 (succeed), 1 (fail)
- Return type:
int
Two occupation domains
- pyqcstrc.ico.two_occupation_domains.genobjv(obj, vlist=[0], path='.', basename='tmp', verbose=0)
Generate objs from vlist.
- Parameters:
obj (numpy.ndarray) – ndarray contains vertices The shape is (num,4,6,3), where num=numbre_of_vertices.
vlist (list)
path (str) – Path of the output files
basename (str) – Basename of the output files
verbose (int) – verbose = 0 (silent, default) verbose = 1 (normal)
- Returns:
0 (succeed), 1 (fail)
- Return type:
int
- pyqcstrc.ico.two_occupation_domains.intersection(obj1, obj2, flag=0, verbose=0)
Intersection of two occupation domains projected onto perp space.
- Parameters:
obj1 (numpy.ndarray) – The shape is (num,4,6,3) or (num*4,6,3), where num=numbre_of_tetrahedron.
obj2 (numpy.ndarray) – The shape is (num,4,6,3) or (num*4,6,3), where num=numbre_of_tetrahedron.
flag (int) – flag = 0, Intersection with rough checking. flag = 1, Intersection without checking.
verbose (int) – verbose = 0 (silent, default) verbose = 1 (normal)
- Returns:
The shape is (num,4,6,3), where num=numbre_of_tetrahedron.
- Return type:
Common part of two occupation domains projected onto perp space (numpy.ndarray)
- pyqcstrc.ico.two_occupation_domains.intersection_2(obj1, obj2, verbose=0)
Intersection of two occupation domains projected onto perp space.
- Parameters:
obj1 (numpy.ndarray) – The shape is (num,4,6,3) or (num*4,6,3), where num=numbre_of_tetrahedron.
obj2 (numpy.ndarray) – The shape is (num,4,6,3) or (num*4,6,3), where num=numbre_of_tetrahedron.
verbose (int) – verbose = 0 (silent, default) verbose = 1 (normal)
- Returns:
The shape is (num,4,6,3), where num=numbre_of_tetrahedron.
- Return type:
Common part of two occupation domains projected onto perp space (numpy.ndarray)
- pyqcstrc.ico.two_occupation_domains.intersection_3(obj1, obj2, verbose=0)
Intersection of two occupation domains projected onto perp space.
- Parameters:
obj1 (numpy.ndarray) – The shape is (num,4,6,3) or (num*4,6,3), where num=numbre_of_tetrahedron.
obj2 (numpy.ndarray) – The shape is (num,4,6,3) or (num*4,6,3), where num=numbre_of_tetrahedron.
verbose (int) – verbose = 0 (silent, default) verbose = 1 (normal)
- Returns:
The shape is (num,4,6,3), where num=numbre_of_tetrahedron.
- Return type:
Common part of two occupation domains projected onto perp space (numpy.ndarray)
- pyqcstrc.ico.two_occupation_domains.intersection_convex(obj1, obj2, verbose=0)
Intersection of two occupation domains projected onto perp space. The common part forms convex hull.
- Parameters:
obj1 (numpy.ndarray) – The shape is (num,4,6,3) or (num*4,6,3), where num=numbre_of_tetrahedron.
obj2 (numpy.ndarray) – The shape is (num,4,6,3) or (num*4,6,3), where num=numbre_of_tetrahedron.
verbose (int) – verbose = 0 (silent, default) verbose = 1 (normal)
- Returns:
- Common part of two occupation domains projected onto perp space (numpy.ndarray)
The shape is (num,4,6,3), where num=numbre_of_tetrahedron.
- pyqcstrc.ico.two_occupation_domains.intersection_old(obj1, obj2, flag=[0, 0, 0], fname='tmp0', verbose=0)
legacy Intersection of two occupation domains projected onto perp space.
- Parameters:
obj1 (numpy.ndarray) – The shape is (num,4,6,3) or (num*4,6,3), where num=numbre_of_tetrahedron.
obj2 (numpy.ndarray) – The shape is (num,4,6,3) or (num*4,6,3), where num=numbre_of_tetrahedron.
flag (list) – list = [a1,a2,a3] a1 = 0, rough check intersection of obj1 and obj2; a1 = 1, no a2 = 0, rough check intersection of tetrahedron in obj1 and obj2; a2 = 1, no a3 = 0, rough check intersection of tetrahedron in obj1 and tetrahedron in obj2; a3 = 1, no
fname (str) – filename of output
verbose (int) – verbose = 0 (silent, default) verbose = 1 (normal)
- Returns:
The shape is (num,4,6,3), where num=numbre_of_tetrahedron.
- Return type:
Common part of two occupation domains projected onto perp space (numpy.ndarray)
- pyqcstrc.ico.two_occupation_domains.mergev(obj1, obj2, path='.', basename='tmp', verbose=0)
merge vertices of two obj
- pyqcstrc.ico.two_occupation_domains.mergev3(obj1, obj2, obj3, path='.', basename='tmp', verbose=0)
merge vertices of three obj
- pyqcstrc.ico.two_occupation_domains.mergev_objs(objs_in_list, path='.', basename='tmp', verbose=0)
merge vertices of objs
- pyqcstrc.ico.two_occupation_domains.subtraction(obj1, obj2, obj_common, verbose=0)
obj1 NOT obj2
legacy Substruction of two occupation domains (obj1, obj2) projected onto perp space, obj1 NOT obj2
- Parameters:
obj1 (numpy.ndarray) – The shape is (num,4,6,3) or (num*4,6,3), where num=numbre_of_tetrahedron.
obj2 (numpy.ndarray) – The shape is (num,4,6,3) or (num*4,6,3), where num=numbre_of_tetrahedron.
obj_common (numpy.ndarray) – Common part of two occupation domains projected onto perp space. The shape is (num,4,6,3), where num=numbre_of_tetrahedron.
verbose (int) – verbose = 0 (silent, default) verbose = 1 (normal)
- Returns:
- Substructed part of two occupation domains projected onto perp space (numpy.ndarray)
The shape is (num,4,6,3), where num=numbre_of_tetrahedron.