gyroid Package

gyroid Package

gyroid

gyroid is a python package that generates symmetry adapted basis functions based on the space group of a unit cell.

References

  • Qin, J., PhD Thesis, advisor: D. C. Morse, 2009
  • Ranjan, A., PhD Thesis, advisor: D. C. Morse, 2007
  • Tyler, C. A., PhD Thesis, advisor: D. C. Morse, 2004
  • Tyler, C. A.; Morse, D. C. Macromolecules, 2003, 36, 3764

basis Module

gyroid.basis

copyright:
  1. 2012 by Yi-Xin Liu
license:

BSD, see LICENSE for more details.

class gyroid.basis.Basis(group, grid)[source]

Bases: object

generate_structure(real_grid, c)[source]

real_grid is a tuple contains the discrete numbers for a, b, and c unit vectors in real space. c is an array contains the coefficients for each basis.

class gyroid.basis.StarSet(group, grid, Gsq)

Bases: object

A StarSet is a collection of stars with all waves have same magnitude. For example, for P6mm in a 32 x 32 grid HEXAGONAL unit cell, an example of a collection of star with same magnitude 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 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]]
and
[[7 7 0 0 -7 -7],
[0 -7 7 -7 7 0]]
class gyroid.basis.StarAtom(grid, Gsq, waves, phases, iwaves=None, iphases=None)

Bases: object

A StarAtom is a star or an open star pair.

f(x, shape)

the value of basis function f(r) at position r. r is a Bravais type real space vector.

common Module

gyroid.common

grid Module

gyroid.grid

class gyroid.grid.Grid(ngrid, g)[source]

Bases: object

Discrete form of a unit cell in reciprocal space.

is_wave_cancel(G, g)[source]

A wave is canceled if and only if following conditions are met: 1) Leaves G invariant (i.e. G.R == G), and 2) Produces a non-zero phase, such that G.t % 1.0 != 0

max_Gsq
to_BZ(G)[source]

G - wavevector, must be a numpy.ndarray Shift a wave vector to the first Brillouin Zone. Output the wave vector and its square magnitude.

gyroid.grid.wave_norm(G, shape)[source]

G is a wave vector with 1, 2, or 3 elements shape is a shape matrix

group Module

gyroid.group

class gyroid.group.Group(dim, basis_type, shape_matrix, HM_symbol=None, ITA_number=None)[source]

Bases: object

A representaion of a space group.

All symmetries in a space group must have the same basis, 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)

class gyroid.group.CayleyTable(symm=None)[source]

Bases: object

Make a full Cayley table from a group.

update(symm)

Currently, only len(symm) > self.order is supported.

space_group Module

gyroid.space_group

gyroid.space_group.symmetry_generator1(ITA_number, b, h)[source]
gyroid.space_group.symmetry_generator2(ITA_number, b, h)[source]

There are 17 2D space groups. Currently, Only following 2D space groups are supported:

[17]
ITA_number - a sequential number as given in the
International Tables for Crystallography, Vol. A

b - Basis type h - Shape instance that describes the unit cell

A list of Symmetry instances that contains the minimun number of symmetries which can be further expanded to the full set of point group symmetries.
gyroid.space_group.symmetry_generator3(ITA_number, b, h)[source]

symmetry Module

gyroid.symmetry

class gyroid.symmetry.Symmetry(dim, basis_type, shape_matrix, R=None, t=None)[source]

Bases: object

A representation of a symmetry element in a group.

The basis type of a symmetry element should be either ‘Cartesian’ or ‘Bravais’. A symmetry element contains a point group matrix and a translational vector.

inverse()[source]

unitcell Module

gyroid.unitcell

Define a standard unit cell and its (real space) lattice basis vectors according to the cystal system.

class gyroid.unitcell.UnitCell(dim, cell_type='Default', cell_param=None)[source]

Bases: object

class gyroid.unitcell.Shape(dim, a1, a2=None, a3=None)[source]

Bases: object

Shape matrix constructed from unit vectors in Cartesian Coordinate.

The Morse convention is used. That is each row in the shape matrix represents a unit vector, e.g. h = (a1,a2,a3) where a_i = (x_i,y_i,z_i) is the unit vector of the Bravis lattice in Cartesian Coordinate.

g[source]

The shape matrix in Reciprocal Space.

h[source]

The shape matrix in Real Space.

l[source]

return (|a1|,|a2|,|a3|), the length vector.

shift(t, basis_type)[source]

Shift position or translation vector so as to lie in the first unit cell.

util Module

gyroid.util

gyroid.util.render_structure_1d(basis, Na, c, save_data=True, data_name='struct1d.mat', save_img=True, show_img=True, img_name='struct1d.png', **kwargs)[source]

basis - An instance of Basis class Na - Number of grids to discretes the side a of the unit cell. c - coefficients for each basis function.

gyroid.util.render_structure_2d(basis, Na, Nb, c, save_data=True, data_name='struct2d.mat', save_img=True, show_img=True, img_name='struct2d.png', levels=None, cmap=None, **kwargs)[source]

basis - An instance of Basis class Na,Nb - Number of grids to discrete the side a of the unit cell. c - coefficients for each basis function.

gyroid.util.render_structure_3d(basis, Na, Nb, Nc, c, save_data=True, data_name='struct3d.mat', save_img=True, show_img=True, img_name='struct3d.png', levels=None, cmap=None, **kwargs)[source]

basis - An instance of Basis class Na,Nb,Nc - Number of grids to discrete the side a of the unit cell. c - coefficients for each basis function. NOTE: the best way to view 3D volume data is: first save the data to mat, and let Matlab (C) render the volume data.