principia_materia.translation_group package
Submodules
- principia_materia.translation_group.cluster module
Cluster
Cluster.dim
Cluster.natoms
Cluster.nspecies
Cluster.positions
Cluster.orbitals
Cluster.norbitals
Cluster.atoms
Cluster.species
Cluster.center
Cluster.atoms
Cluster.atoms_species_map
Cluster.axial_strain()
Cluster.center
Cluster.check_atoms_overlap()
Cluster.copy()
Cluster.dim
Cluster.find_atoms()
Cluster.natoms
Cluster.norbitals
Cluster.nspecies
Cluster.orbitals
Cluster.positions
Cluster.rotate()
Cluster.rotate_atoms()
Cluster.shift_atom()
Cluster.shift_atoms()
Cluster.shift_origin()
Cluster.species
Cluster.species_names
Cluster.strain()
Cluster.to_dict()
get_cluster_io_wrapper()
- principia_materia.translation_group.crystal module
- principia_materia.translation_group.crystal_ftg module
CrystalFTG
CrystalFTG.as_primitive()
CrystalFTG.atoms
CrystalFTG.copy()
CrystalFTG.find_atoms()
CrystalFTG.from_primitive()
CrystalFTG.get_basis_at_q()
CrystalFTG.get_wigner_seitz_cell()
CrystalFTG.invsupa
CrystalFTG.orbitals
CrystalFTG.rotate()
CrystalFTG.shift_atom()
CrystalFTG.species_names
CrystalFTG.supa
CrystalFTG.supa_atoms_map
CrystalFTG.supa_translations
CrystalFTG.to_dict()
CrystalFTG.tol
get_crystal_ftg_io_wrapper()
- principia_materia.translation_group.kpoints module
Kpoints
Kpoints.copy()
Kpoints.find_irreducible_lattice_points()
Kpoints.get_index()
Kpoints.invsupa
Kpoints.irreducible_kpoints
Kpoints.irreducible_kpoints_index_map
Kpoints.irreducible_kpoints_map
Kpoints.irreducible_kpoints_mult
Kpoints.irreducible_kpoints_trans
Kpoints.kpoints
Kpoints.kpoints_to_rlattice()
Kpoints.multiplicity
Kpoints.rlattice_to_kpoints()
Kpoints.rotated_kpoints
Kpoints.rvec_bz
Kpoints.supa
Kpoints.to_dict()
get_kpoints_io_wrapper()
- principia_materia.translation_group.lattice module
Lattice
Lattice.abc
Lattice.abg
Lattice.axial_strain()
Lattice.cartesian_to_lattice()
Lattice.copy()
Lattice.dim
Lattice.lattice_to_cartesian()
Lattice.rabc
Lattice.rabg
Lattice.rvec
Lattice.rvol
Lattice.set_ws_cell()
Lattice.similarity_transform()
Lattice.strain()
Lattice.to_dict()
Lattice.vec
Lattice.vol
Lattice.ws_weight()
get_lattice_io_wrapper()
- principia_materia.translation_group.lattice_ftg module
LatticeFTG
LatticeFTG.copy()
LatticeFTG.find_irreducible_lattice_points()
LatticeFTG.get_index()
LatticeFTG.invsupa
LatticeFTG.multiplicity
LatticeFTG.set_lattice_points()
LatticeFTG.set_lattice_points_diagonal()
LatticeFTG.set_lattice_points_generic()
LatticeFTG.supa
LatticeFTG.supa_is_diagonal
LatticeFTG.to_dict()
get_lattice_ftg_io_wrapper()
get_lattice_points()
- principia_materia.translation_group.minimum_supercell module
- principia_materia.translation_group.qpoints_n module
QpointsN
QpointsN.Qpoints
QpointsN.Qpoints_orbits
QpointsN.find_irreducible_Qpoints()
QpointsN.get_Qindex()
QpointsN.irreducible_Qpoints
QpointsN.irreducible_Qpoints_Qind
QpointsN.irreducible_Qpoints_inverse
QpointsN.irreducible_Qpoints_map
QpointsN.irreducible_Qpoints_mult
QpointsN.irreducible_Qpoints_permutation
QpointsN.irreducible_Qpoints_rotation
QpointsN.multiplicity
QpointsN.nQpoints
QpointsN.n_irreducible_Qpoints
QpointsN.supa
QpointsN.to_dict()
QpointsPerm
QpointsPerm.Qpoints
QpointsPerm.find_permutationally_irreducible_Qpoints()
QpointsPerm.get_Qindex()
QpointsPerm.irreducible_Qpoints
QpointsPerm.irreducible_Qpoints_Qind
QpointsPerm.irreducible_Qpoints_inverse
QpointsPerm.irreducible_Qpoints_map
QpointsPerm.irreducible_Qpoints_mult
QpointsPerm.irreducible_Qpoints_permutation
QpointsPerm.multiplicity
QpointsPerm.nQpoints
QpointsPerm.n_irreducible_Qpoints
QpointsPerm.supa
QpointsPerm.to_dict()
get_QpointsN_io_wrapper()
- principia_materia.translation_group.wigner_seitz module
Module contents
- principia_materia.translation_group.fit_in_supercell(qpoint, supa, decimal=6)
Check if q-point fit in a supercell.
- Parameters:
qpoint (array of floats of Fraction, shape (dim, ) or (N, ..., N', dim)) – qpoint(s) to check the fit.
supa (array of int, shape(dim, dim)) – Supercell matrix.
decimal (int, optional, default to 6) – Decimal points for tolerance.
- Returns:
fit – Whether the q-point(s) fit in the given supercell.
- Return type:
bool or array of bool
- principia_materia.translation_group.get_structure(inp=None, vec=None, pg=None, supa=None, atoms=None, orbitals=None, scale=None, strict_symmetry=False, lattice_coordinate=True, tol=1e-06, stype='auto', copy=False)
Construct a translation group object based on input data.
There are several types of inputs accepted:
If a translation group object (i.e. an object of type Lattice/LatticeFTG/Cluster/Kpoints/Crystal/CrystalFTG) is passed in as
inp
, it will return the object back directly, or return a copy of the object ifcopy==True
.If A YAML file containing information to construct the object, is passed in as
inp
, it will be parsed and its content will be used to construct the object.The key information of the object can be directly passed in.
The keyword
stype
determines which type of the translation group object to construct. It can be set to each of the translation group type, or “auto”. Ifstype
is not “auto” input type 1 is used, it will check if the input object is an instance ofstype
.If
stype==auto
, and input type 2 or 3 is passed in, then the type of object to construct will be determined using the following rule:If
vec
is provided (either in YAML file or in arguments), andatoms
,supa
are missing, Lattice will be constructed.If
vec
andsupa
are provided andpg
,atoms
, are missing, LatticeFTG will be constructed.If
vec
,supa
andpg
are provided andatoms
, are missing, Kpoints will be constructed.If
atoms
is provided andvec
,supa
are missing, Cluster will be constructed.If
vec
,atoms
are provided andsupa
is missing, Crystal will be constructed.If
vec
,atoms
andsupa
are all provided, CrystalFTG will be constructed.
In cases 1, 4, 5, 6
pg
is optional, and in cases 4, 5, 6orbitals
is optional.- Parameters:
inp (str or translation group object, default to None) – A YAML file/YAML string containing information to construct the translation group object, or a translation group object. If
inp
is provided,vec
,pg
,supa
,atoms
,orbitals
should not be provided through the arguments, vice versa.vec (arrays of float, shape(dim, dim), default to None) – The lattice vectors, in row convention.
pg (str or PointGroup object, default to None) – The point group of the lattice.
supa (array of int, shape(dim, dim), default to None) – Super lattice matrix.
atoms (dict (preferably ordered), with str as keys and array of float as values, default None) – A dictionary of names of atoms and their positions.
orbitals (str or list of str or nested list of str, default to None) – Orbital names to assign to the atoms.
scale (float or array of float with shape of (dim, ), default to None) – Scale the lattice vectors.
strict_symmetry (bool, optional, default to False) – In case of LatticeFTG or Kpoints, whether to allow points be rotated out of the given grid.
lattice_coordinate (bool, optional, default to True) – In case of Crystal or CrystalFTG, the positions are in lattice coordinate if
lattice_coordinate==True
, otherwise they are in cartesian coordinate.tol (float, optional, default to 1.0E-6) – Tolerance threshold.
stype (str or traslation group types, optional, default to "auto") – The type of translation group object to construct.
copy (bool, optional, default to False) – In the case when
inp
is a translation group object, whether to return the object directly or a copy of it.
Examples
>>> struct = get_structure("structure.yml") >>> type(struct) <class 'principia_materia.translation_group.crystal_ftg.CrystalFTG'> >>> print(struct.to_dict()) OrderedDict([('vec', array([[2., 0., 0.], [0., 2., 0.], [0., 0., 2.]])), ('atoms', OrderedDict([('H', array([[0., 0., 0.]])), ('He', array([[0.25, 0.25, 0.25], [0.75, 0.75, 0.75]]))])), ('orbitals', ['s', 'd', 'p']), ('supa', array([[2, 0, 0], [0, 2, 0], [0, 0, 1]]))])
- principia_materia.translation_group.register_structure_datawrapper_type(wrapper)
- principia_materia.translation_group.register_structure_hdf5wrapper_type(wrapper)
- principia_materia.translation_group.save_structure(structure, file=None, use_config=False)
Save structure object into YAML file.
- Parameters:
structure (Lattice, Cluster, LatticeFTG, Crystal, Kpoints or CrystalFTG object) – A structure object to save.
file (str, optional, default to None) – The file to save YAML string into, if None return the string.