schrodinger.application.matsci.nano.space_groups module¶
Classes and functions for creating crystals by unit cell.
Copyright Schrodinger, LLC. All rights reserved.
- schrodinger.application.matsci.nano.space_groups.get_spacegroups()¶
Get space groups object.
- Return type
- Returns
Cached space groups object, do not modify!!
- schrodinger.application.matsci.nano.space_groups.get_symmops_from_spglib(symm)¶
Get set of symmetry operators from a set of rotations and translations. Symmetry operator is defined with a 4 x 4 matrix, top left 3 x 3 is rotation matrix, top right column 1 x 3 is translation, rest, bottom row is [0 0 0 1]
- Parameters
symm (dict of two keys: 'rotations': list of 3 x 3 matrices, 'translations': list of 1 x 3 matrices) – dictionary of list of rotations and translations
- Returns
list of 4x4 matrices
- Return type
list of symmetry operators
- class schrodinger.application.matsci.nano.space_groups.CrystalSystems¶
Bases:
object
Manage the properties of the seven crystal systems.
- TRICLINIC_NAME = 'triclinic'¶
- MONOCLINIC_NAME = 'monoclinic'¶
- ORTHORHOMBIC_NAME = 'orthorhombic'¶
- TETRAGONAL_NAME = 'tetragonal'¶
- TRIGONAL_NAME = 'trigonal'¶
- HEXAGONAL_NAME = 'hexagonal'¶
- CUBIC_NAME = 'cubic'¶
- class Triclinic(name)¶
Bases:
object
Manage the triclinic system.
- __init__(name)¶
Create an instance.
- Parameters
name (str) – crystal system name
- class Monoclinic(name)¶
Bases:
object
Manage the monoclinic system.
- __init__(name)¶
Create an instance.
- Parameters
name (str) – crystal system name
- class Orthorhombic(name)¶
Bases:
object
Manage the orthorhombic system.
- __init__(name)¶
Create an instance.
- Parameters
name (str) – crystal system name
- class Tetragonal(name)¶
Bases:
object
Manage the tetragonal system.
- __init__(name)¶
Create an instance.
- Parameters
name (str) – crystal system name
- class Trigonal(name)¶
Bases:
object
Manage the trigonal system.
- __init__(name)¶
Create an instance.
- Parameters
name (str) – crystal system name
- class Hexagonal(name)¶
Bases:
object
Manage the hexagonal system.
- __init__(name)¶
Create an instance.
- Parameters
name (str) – crystal system name
- class Cubic(name)¶
Bases:
object
Manage the cubic system.
- __init__(name)¶
Create an instance.
- Parameters
name (str) – crystal system name
- getCrystalSystem(name)¶
Return the crystal system object for the crystem system of the provided name.
- Parameters
name (str) – crystal system name
- Return type
one of the seven crystal system objects
- Returns
crystal_system_obj
- class schrodinger.application.matsci.nano.space_groups.SpaceGroup(definition_id: int, space_group_id: int, ichoice: int, num_choices: int, space_group_short_name: str, space_group_full_name: str, point_group_name: str, centering_opers: List, primary_opers: List, symmetry_opers: List, num_centering_opers: int, num_primary_opers: int, num_symmetry_opers: int, centering_opers_strs: List, primary_opers_strs: List, symmetry_opers_strs: List, crystal_system: schrodinger.application.matsci.nano.space_groups.CrystalSystems, xyzasu: str, spg_setting: str)¶
Bases:
tuple
Collect the properties of a space group.
- DEFINITION_ID = 'Def. ID'¶
- SPACE_GROUP_ID = 'Space Group ID'¶
- CRYSTAL_SYSTEM = 'Crystal System'¶
- SHORT_HERMANN_MAUGUIN_SYMBOL = 'Short H.-M. Symbol'¶
- FULL_HERMANN_MAUGUIN_SYMBOL = 'Full H.-M. Symbol'¶
- POINT_GROUP_NAME = 'Point Group'¶
- NUM_CENTERING_OPERS = 'N Centering Ops.'¶
- NUM_PRIMARY_OPERS = 'N Primary Ops.'¶
- NUM_SYMMETRY_OPERS = 'N Symmetry Ops.'¶
- CENTERING_OPERS = 'Centering Operators'¶
- PRIMARY_OPERS = 'Primary Operators'¶
- SYMMETRY_OPERS = 'Symmetry Operators'¶
- SPACE_GROUP_SETTING = 'Space Group Setting'¶
- ID_TAG = 'spgid '¶
- SHORT_NAME_TAG = 'sspgname '¶
- FULL_NAME_TAG = 'fspgname '¶
- POINT_GROUP_TAG = 'pgname '¶
- CRYSTAL_SYSTEM_TAG = 'crysym '¶
- SETTING_TAG = 'setting '¶
- ASU_TAG = 'xyzasu '¶
- PRIMARY_OPERATIONS_TAG = 'primoper '¶
- CENTERING_OPERATIONS_TAG = 'centoper '¶
- END_OF_DEF_TAG = 'endofdef'¶
- definition_id: int¶
Alias for field number 0
- space_group_id: int¶
Alias for field number 1
- ichoice: int¶
Alias for field number 2
- num_choices: int¶
Alias for field number 3
- space_group_short_name: str¶
Alias for field number 4
- space_group_full_name: str¶
Alias for field number 5
- point_group_name: str¶
Alias for field number 6
- centering_opers: List¶
Alias for field number 7
- primary_opers: List¶
Alias for field number 8
- symmetry_opers: List¶
Alias for field number 9
- num_centering_opers: int¶
Alias for field number 10
- num_primary_opers: int¶
Alias for field number 11
- num_symmetry_opers: int¶
Alias for field number 12
- centering_opers_strs: List¶
Alias for field number 13
- primary_opers_strs: List¶
Alias for field number 14
- symmetry_opers_strs: List¶
Alias for field number 15
- crystal_system: schrodinger.application.matsci.nano.space_groups.CrystalSystems¶
Alias for field number 16
- xyzasu: str¶
Alias for field number 17
- spg_setting: str¶
Alias for field number 18
- classmethod fromData(definition_id, space_group_id, ichoice, num_choices, space_group_short_name, space_group_full_name, point_group_name, centering_opers, primary_opers, symmetry_opers, centering_opers_strs, primary_opers_strs, symmetry_opers_strs, crystal_system, xyzasu, spg_setting)¶
Create an instance.
- Parameters
definition_id (int) – the id of the definition, i.e. a number ranging from 1 to 291 (some of the 230 space groups have more than a single unit cell definition).
space_group_id (int) – the id of the space group, i.e. a number ranging from 1 to 230, which the number of space groups.
ichoice (int) – the space group setting index
num_choices (int) – the number of different unit cell settings for this space group. For example, a setting may be a choice of axes, etc.
space_group_short_name (string) – the short Hermann-Mauguin symbol of the space group.
space_group_full_name (string) – the full Hermann-Mauguin symbol of the space group.
point_group_name (string) – the name of the point group of the space group.
centering_opers (list of numpy.array) – contains the centering matricies of the space group.
primary_opers (list of numpy.array) – contains the primary matricies of the space group.
symmetry_opers (list of numpy.array) – contains the symmetry matricies of the space group, i.e. the combinations of the centering and primary matricies.
centering_opers_strs (list) – string representation of the centering operators.
primary_opers_strs (list) – string representation of the primary operators.
symmetry_opers_strs (list) – string representation of the symmetry operators, i.e. the combination of the centering and primary string representations.
crystal_system (one of the sevel crystal system objects) – the crystal system.
xyzasu (str) – the xyzasu descriptor which will be parsed but not used
spgsetting – the setting of the space group
- isSohnckeGroup()¶
Return whether this group is Sohncke or not.
:rtype bool :return: Whether this group is Sohncke or not.
- printSymmetryOpers(logger=None)¶
Log a formatted print of all of the symmetry operators for this space group.
- Parameters
logger (logging.getLogger) – output logger
- printDatabaseEntry(logger=None)¶
Print a space group object in mmspg/spgbase.dat format.
- Parameters
logger (logging.getLogger) – output logger
- __contains__(key, /)¶
Return key in self.
- __len__()¶
Return len(self).
- count(value, /)¶
Return number of occurrences of value.
- index(value, start=0, stop=9223372036854775807, /)¶
Return first index of value.
Raises ValueError if the value is not present.
- class schrodinger.application.matsci.nano.space_groups.SpaceGroups¶
Bases:
object
Manage space group objects.
- NUM_SPACE_GROUPS = 230¶
- CRYSTAL_SYSTEMS = <schrodinger.application.matsci.nano.space_groups.CrystalSystems object>¶
- CENTERING = 'centering'¶
- PRIMARY = 'primary'¶
- SYMMETRY = 'symmetry'¶
- __init__()¶
Create an instance.
- getAllSpaceGroups()¶
Make a list of all SpaceGroup objects each of which contains some space group parameters from mmspg/spgbase.dat.
- getSpgObjByName(name, first=True)¶
Get a space group object by name.
- Parameters
name (str) – short name (HM symbol) checked first. If short_only=False, long symbol checked second. The first space group encountered with such a name is returned.
first (bool) – If True, returns the first occurrence based on the symmetry operators
- Return type
SpaceGroup or None
- Returns
Space group object or None if not found
- printAllSpgInfo(verbose, logger)¶
Print all space group information.
- Parameters
verbose (bool) – verbose log
logger (logging.getLogger) – output logger
- schrodinger.application.matsci.nano.space_groups.equal_rotations(rotations1, rotations2)¶
Check if rotations are equal.
- Parameters
rotations1 (3D numpy.array) – Array of rotation matrices (2D arrays) associated with a space group
rotations2 (3D numpy.array) – Array of rotation matrices (2D arrays) associated with a space group
- Return type
bool
- Returns
True, if rotations are the same, otherwise False