gyroid is a python package that generates symmetry adapted basis functions (SABF) based on the space group of a unit cell.
This module is the main module of the package, wherein Basis class abstractsa whole SABF set.
This module defines three classes: Basis, StarSet, StarAtom.
This module provides one function: index_waves().
Bases: object
Representation of a whole SABF set.
The SABF set mainly depends on the type of unit cell (crystal system), the point group symmetries, and how the unit cell is discretized.
Project a set of FFT coefficients onto a set of SABF coefficients.
Parameters: |
|
---|---|
Returns: | a set of coefficients for SABF. |
Return type: | a 1D double numpy.array |
Generate structure without projecting SABF to FFT.
Parameters: |
|
---|---|
Returns: | real space structure constructed via SABF |
Return type: | double numpy.array object |
Note This method is much slower than generate_structure_by_fft(). Use it for debug only.
Generate structure by projecting SABF to FFT, and then perform an inverse FFT.
Parameters: |
|
---|---|
Returns: | real space structure constructed via SABF |
Return type: | double numpy.array object |
Project a set of SABF coefficients onto a set of FFT coefficients.
Parameters: |
|
---|---|
Returns: | a set of FFT coefficients on the discretized unit cell |
Return type: | double numpy.array |
Bases: object
A StarSet object is a collection of stars containing waves with same magnitude.
Wave vectors with same magnitudes may form more than one closed stars open star pair. For example, for P6mm in a 32 x 32 grid HEXAGONAL unit cell, a collection of waves with same magnitudes is:
[[ 8 8 7 7 5 5 3 3 0 0 -3 -3 -5 -5 -7 -7 -8 -8],
[-3 -5 0 -7 3 -8 5 -8 7 -7 8 -5 8 -3 7 0 5 3]]
It has two closed stars:
[[ 8 8 5 5 3 3 -3 -3 -5 -5 -8 -8],
[-3 -5 3 -8 5 -8 8 -5 8 -3 5 3]]
[[7 7 0 0 -7 -7],
[0 -7 7 -7 7 0]]
Bases: object
A StarAtom object represents a closed star or an open star pair.
For a closed star, when a wave vector G is in it, -G is also in it.
For an open star pair, if a wave vector G is in the first star, the inverse vector -G must be found in the accompanying invert star.
Calculate the value of the SABF f(r) at position r.
Parameters: |
|
---|---|
Returns: | the value of an SABF or two SABF if the star is an open star pair |
Return type: | tuple with two doubles |
Find the index of wave in a list of waves.
Parameters: |
|
---|---|
Returns: | index for a wave in the collection of waves |
Return type: | integer |
This moudle define all global constants.
It includes:
EPS, SMALL, LARGE
BRAVAIS, CARTESIAN
LAMELLAR
SQUARE, RECTANGULAR, HEXAGONAL, OBLIQUE
CUBIC, TETRAGONAL, ORTHORHOMBIC, TRIGONAL, MONOCLINIC, TRICLINIC
DEFAULT
CRYSTAL_SYSTEM1, CRYSTAL_SYSTEM2, CRYSTAL_SYSTEM3
HM_ITA_TABLE1, HM_ITA_TABLE2, HM_ITA_TABLE3
GROUP_ORDER_TABLE1, GROUP_ORDER_TABLE2, GROUP_ORDER_TABLE3
Bases: object
A Grid object represents a Discretized unit cell in reciprocal space.
Check whether the wave vector is canceled.
A wave is canceled if and only if following conditions are met:
Parameters: |
|
---|---|
Return type: | True or False |
Bases: object
A Group object is a representaion of a space group.
All symmetries in a space group must have the same basis type, i.e. they must all be either the BRAVAIS or the CARTESIAN bases.
The space group is constructed either by providing a Hermann-Mauguin Symbol (HM_symbol) or a sequential number as given in the International Tables for Crystallography, Vol. A (ITA_number)
Members : | dim, type, shape, symm |
---|
Bases: object
Make a full Cayley table from a list of Symmetry objects.
Update the CayleyTable object.
Currently, len(symm) must be larger than self.order.
Output 1D space point group symmetry generators.
There are 2 1D space groups. Currently, all 1D space groups are supported:
[1, 2]
Parameters: |
|
---|---|
Returns: | the minimun number of symmetries which can be further expanded to the full set of point group symmetries |
Return type: | a list of Symmetry objects |
Output 2D space point group symmetry generators.
There are 17 2D space groups. Currently, Only following 2D space groups are supported:
[1,2,3,4,5,6,17]
Parameters: |
|
---|---|
Returns: | the minimun number of symmetries which can be further expande to the full set of point group symmetries |
Return type: | a list of Symmetry objects |
Output 3D space point group symmetry generators.
There are 230 3D space groups. The symmetry generators can be found at http://cryst.ehu.es/cryst/get_gen.html. Currently, the supported 3D space groups are:
[183, 229, 230]
Parameters: |
|
---|---|
Returns: | the minimun number of symmetries which can be further expande to the full set of point group symmetries |
Return type: | a list of Symmetry |
Bases: object
A Symmetry object represents a point group symmetry element in a group.
The basis type of a symmetry element should be either BRAVAIS or CARTESIAN.
A symmetry element contains a point group matrix R and a translational vector t.
Define a standard unit cell and its (real space) lattice basis vectors according to the cystal system.
Bases: object
A UnitCell object contains the shape information of a unit cell.
All standard crystal systems in 1D, 2D and 3D spaces are supported.
To construct a unit cell of a standard crystal system, one should provide the space dimension, the name of the standard crystal system, and the cell parameters (the lengths of each unit vectors in the unit cell, and the angles between the unit vectors).
The name of the standard crystal system is best given by first import the gyroid.common module, and use the constant therein. However, you can also input a string, such as ‘Cubic’ for 3D cubic crystal systems. If the name of the crystal system is not given, it will use the default crystal system for each space dimension, and the cell parameters given by the user will be discarded.
The default unit cell in 1D space is LAMELLAR, unit vector length is 1.0. The default unit cell in 2D space is SQUARE, unit vector length is 1.0. The default unit cell in 3D space is CUBIC, unit vector length is also 1.0.
Bases: object
A Shape object fully describes the shape of a unit cell.
The heart of a Shape object is a shape matrix which can be constructed from unit vectors of a unit cell in Cartesian Coordinate.
The Morse convention is used to construct the shape matrix. That is each row in the shape matrix represents a unit vector, e.g.:
h = [a1 a2 a3
b1 b2 b3
c1 c2 c3]
where a_i, b_i, c_i are the i th elements of unit vectors a, b, and c in the Bravis lattice in real space.
Shift position or translation vector so as to lie in the first unit cell.
Parameters: |
|
---|---|
Returns: | shifted translational or positional vector |
Return type: | 1D numpy.array |
Calculate and render 1D structure for given SABF and unit cell.
Parameters: |
|
---|
Calculate and render 2D structure for given SABF and unit cell.
Parameters: |
|
---|
Calculate and render 3D structure for given SABF and unit cell.
Parameters: |
|
---|