principia_materia.translation_group package
Submodules
- principia_materia.translation_group.cluster module
ClusterCluster.dimCluster.natomsCluster.nspeciesCluster.positionsCluster.orbitalsCluster.norbitalsCluster.atomsCluster.speciesCluster.centerCluster.atomsCluster.atoms_species_mapCluster.axial_strain()Cluster.centerCluster.check_atoms_overlap()Cluster.copy()Cluster.dimCluster.find_atoms()Cluster.natomsCluster.norbitalsCluster.nspeciesCluster.orbitalsCluster.positionsCluster.rotate()Cluster.rotate_atoms()Cluster.shift_atom()Cluster.shift_atoms()Cluster.shift_origin()Cluster.speciesCluster.species_namesCluster.strain()Cluster.to_dict()
get_cluster_io_wrapper()
- principia_materia.translation_group.crystal module
- principia_materia.translation_group.crystal_ftg module
CrystalFTGCrystalFTG.as_primitive()CrystalFTG.atomsCrystalFTG.copy()CrystalFTG.find_atoms()CrystalFTG.from_primitive()CrystalFTG.get_basis_at_q()CrystalFTG.get_wigner_seitz_cell()CrystalFTG.invsupaCrystalFTG.orbitalsCrystalFTG.rotate()CrystalFTG.shift_atom()CrystalFTG.species_namesCrystalFTG.supaCrystalFTG.supa_atoms_mapCrystalFTG.supa_translationsCrystalFTG.to_dict()CrystalFTG.tol
get_crystal_ftg_io_wrapper()
- principia_materia.translation_group.kpoints module
KpointsKpoints.copy()Kpoints.find_irreducible_lattice_points()Kpoints.get_index()Kpoints.invsupaKpoints.irreducible_kpointsKpoints.irreducible_kpoints_index_mapKpoints.irreducible_kpoints_mapKpoints.irreducible_kpoints_multKpoints.irreducible_kpoints_transKpoints.kpointsKpoints.kpoints_to_rlattice()Kpoints.multiplicityKpoints.rlattice_to_kpoints()Kpoints.rotated_kpointsKpoints.rvec_bzKpoints.supaKpoints.to_dict()
get_kpoints_io_wrapper()
- principia_materia.translation_group.lattice module
LatticeLattice.abcLattice.abgLattice.axial_strain()Lattice.cartesian_to_lattice()Lattice.copy()Lattice.dimLattice.lattice_to_cartesian()Lattice.rabcLattice.rabgLattice.rvecLattice.rvolLattice.set_ws_cell()Lattice.similarity_transform()Lattice.strain()Lattice.to_dict()Lattice.vecLattice.volLattice.ws_weight()
get_lattice_io_wrapper()
- principia_materia.translation_group.lattice_ftg module
LatticeFTGLatticeFTG.copy()LatticeFTG.find_irreducible_lattice_points()LatticeFTG.get_index()LatticeFTG.invsupaLatticeFTG.multiplicityLatticeFTG.set_lattice_points()LatticeFTG.set_lattice_points_diagonal()LatticeFTG.set_lattice_points_generic()LatticeFTG.supaLatticeFTG.supa_is_diagonalLatticeFTG.to_dict()
get_lattice_ftg_io_wrapper()get_lattice_points()
- principia_materia.translation_group.minimum_supercell module
- principia_materia.translation_group.qpoints_n module
QpointsNQpointsN.QpointsQpointsN.Qpoints_orbitsQpointsN.find_irreducible_Qpoints()QpointsN.get_Qindex()QpointsN.irreducible_QpointsQpointsN.irreducible_Qpoints_QindQpointsN.irreducible_Qpoints_inverseQpointsN.irreducible_Qpoints_mapQpointsN.irreducible_Qpoints_multQpointsN.irreducible_Qpoints_permutationQpointsN.irreducible_Qpoints_rotationQpointsN.multiplicityQpointsN.nQpointsQpointsN.n_irreducible_QpointsQpointsN.supaQpointsN.to_dict()
QpointsPermQpointsPerm.QpointsQpointsPerm.find_permutationally_irreducible_Qpoints()QpointsPerm.get_Qindex()QpointsPerm.irreducible_QpointsQpointsPerm.irreducible_Qpoints_QindQpointsPerm.irreducible_Qpoints_inverseQpointsPerm.irreducible_Qpoints_mapQpointsPerm.irreducible_Qpoints_multQpointsPerm.irreducible_Qpoints_permutationQpointsPerm.multiplicityQpointsPerm.nQpointsQpointsPerm.n_irreducible_QpointsQpointsPerm.supaQpointsPerm.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
stypedetermines which type of the translation group object to construct. It can be set to each of the translation group type, or “auto”. Ifstypeis 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
vecis provided (either in YAML file or in arguments), andatoms,supaare missing, Lattice will be constructed.If
vecandsupaare provided andpg,atoms, are missing, LatticeFTG will be constructed.If
vec,supaandpgare provided andatoms, are missing, Kpoints will be constructed.If
atomsis provided andvec,supaare missing, Cluster will be constructed.If
vec,atomsare provided andsupais missing, Crystal will be constructed.If
vec,atomsandsupaare all provided, CrystalFTG will be constructed.
In cases 1, 4, 5, 6
pgis optional, and in cases 4, 5, 6orbitalsis 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
inpis provided,vec,pg,supa,atoms,orbitalsshould 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
inpis 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.