schrodinger.application.matsci.nano.slab module¶
Classes and functions to create surface models.
Copyright Schrodinger, LLC. All rights reserved.
-
class
schrodinger.application.matsci.nano.slab.
ParserWrapper
(scriptname, description)¶ Bases:
object
Manages the argparse module to parse user command line arguments.
-
__init__
(scriptname, description)¶ Create a ParserWrapper instance and process it.
Parameters: - scriptname (str) – name of this script
- description (str) – description of this script
-
loadIt
()¶ Load ParserWrapper with all options.
-
loadHKLOptions
()¶ Load ParserWrapper with hkl options.
-
loadOptions
()¶ Load ParserWrapper with options.
-
loadEnumeration
()¶ Load ParserWrapper with enumeration options.
-
loadRequired
()¶ Load ParserWrapper with required options.
-
loadCommon
()¶ Load ParserWrapper with common options.
-
parseArgs
(args)¶ Parse the command line arguments.
Parameters: args (tuple) – command line arguments
-
__class__
¶ alias of
builtins.type
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.application.matsci.nano.slab', '__doc__': '\n Manages the argparse module to parse user command line\n arguments.\n ', '__init__': <function ParserWrapper.__init__>, 'loadIt': <function ParserWrapper.loadIt>, 'loadHKLOptions': <function ParserWrapper.loadHKLOptions>, 'loadOptions': <function ParserWrapper.loadOptions>, 'loadEnumeration': <function ParserWrapper.loadEnumeration>, 'loadRequired': <function ParserWrapper.loadRequired>, 'loadCommon': <function ParserWrapper.loadCommon>, 'parseArgs': <function ParserWrapper.parseArgs>, '__dict__': <attribute '__dict__' of 'ParserWrapper' objects>, '__weakref__': <attribute '__weakref__' of 'ParserWrapper' objects>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.application.matsci.nano.slab'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
class
schrodinger.application.matsci.nano.slab.
CheckInput
¶ Bases:
object
Manage checking user input.
-
static
checkSlabThickness
(slab_thickness)¶ Check the specified slab thickness.
Parameters: slab_thickness (float) – thickness of the crystalline slab along the c lattice vector
-
__class__
¶ alias of
builtins.type
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.application.matsci.nano.slab', '__doc__': '\n Manage checking user input.\n ', 'checkSlabThickness': <staticmethod object>, '__dict__': <attribute '__dict__' of 'CheckInput' objects>, '__weakref__': <attribute '__weakref__' of 'CheckInput' objects>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init__
¶ Initialize self. See help(type(self)) for accurate signature.
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.application.matsci.nano.slab'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
static
-
class
schrodinger.application.matsci.nano.slab.
Surface
(cell, h_index=1, k_index=1, l_index=0, angstrom=False, fractional=False, normal_c=False, bottom=None, slab_thickness=None, vacuum_thickness=None, logger=None)¶ Bases:
object
Manage the building of a surface model.
-
NUMDIGITS
= 3¶
-
MSGWIDTH
= 100¶
-
__init__
(cell, h_index=1, k_index=1, l_index=0, angstrom=False, fractional=False, normal_c=False, bottom=None, slab_thickness=None, vacuum_thickness=None, logger=None)¶ Create an instance.
Parameters: - cell (
schrodinger.structure.Structure
) – the crystalline cell used to define the surface model - h_index (int) – the Miller h-index of the crystal plane to expose
- k_index (int) – the Miller k-index of the crystal plane to expose
- l_index (int) – the Miller l-index of the crystal plane to expose
- angstrom (bool) – specify that slab and vacuum thickness be in units of angstrom rather than inter-planar spacing
- fractional (bool) – specify that slab and vacuum thickness be in units of fractional rather than inter-planar spacing
- bottom (float or None) – the distance along the plane normal to serve as the bottom of the surface model or None if the default is to be used
- slab_thickness (float or None) – thickness of the crystalline slab along the c lattice vector or None if the default is to be used
- vacuum_thickness (float or None) – thickness of the vacuum layer along the c or None if the default is to be used
- logger (logging.Logger) – output logger
- cell (
-
getLatticeProperties
(cell)¶ Get the lattice properties.
-
setParameters
(thickness_extent=1)¶ Set some parameters in units of Angstrom relative to the slab c-vector.
Parameters: thickness_extent (int) – Thickness extent used to get original length of Z coordinate of the c-vector
-
buildSlab
()¶ Build the slab.
-
pruneIt
()¶ Prune the slab cell. The desired slab thickness may be a non-integer number of cells along the c-vector direction. This method automatically removes the necessary atoms from the top of the cell. For example, consider an atomic cell in which vacuum is being added on top but in which specific intra-cell atom layers are to be exposed at the bottom and top of the cell. Allow this only for infinite systems as there is no need to support cutting of molecular fragments.
-
addVacuum
()¶ Add vacuum.
-
setSurfaceProperties
()¶ Set surface properties.
-
printParams
()¶ Log the parameters.
-
runIt
()¶ Create the surface model.
-
__class__
¶ alias of
builtins.type
-
__delattr__
¶ Implement delattr(self, name).
-
__dict__
= mappingproxy({'__module__': 'schrodinger.application.matsci.nano.slab', '__doc__': '\n Manage the building of a surface model.\n ', 'NUMDIGITS': 3, 'MSGWIDTH': 100, '__init__': <function Surface.__init__>, 'getLatticeProperties': <function Surface.getLatticeProperties>, 'setParameters': <function Surface.setParameters>, 'buildSlab': <function Surface.buildSlab>, 'pruneIt': <function Surface.pruneIt>, 'addVacuum': <function Surface.addVacuum>, 'setSurfaceProperties': <function Surface.setSurfaceProperties>, 'printParams': <function Surface.printParams>, 'runIt': <function Surface.runIt>, '__dict__': <attribute '__dict__' of 'Surface' objects>, '__weakref__': <attribute '__weakref__' of 'Surface' objects>})¶
-
__dir__
() → list¶ default dir() implementation
-
__eq__
¶ Return self==value.
-
__format__
()¶ default object formatter
-
__ge__
¶ Return self>=value.
-
__getattribute__
¶ Return getattr(self, name).
-
__gt__
¶ Return self>value.
-
__hash__
¶ Return hash(self).
-
__init_subclass__
()¶ This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
-
__le__
¶ Return self<=value.
-
__lt__
¶ Return self<value.
-
__module__
= 'schrodinger.application.matsci.nano.slab'¶
-
__ne__
¶ Return self!=value.
-
__new__
()¶ Create and return a new object. See help(type) for accurate signature.
-
__reduce__
()¶ helper for pickle
-
__reduce_ex__
()¶ helper for pickle
-
__repr__
¶ Return repr(self).
-
__setattr__
¶ Implement setattr(self, name, value).
-
__sizeof__
() → int¶ size of object in memory, in bytes
-
__str__
¶ Return str(self).
-
__subclasshook__
()¶ Abstract classes can override this to customize issubclass().
This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
schrodinger.application.matsci.nano.slab.
get_hkl
(astructure)¶ Return an hkl Miller index triple for the given structure. If any of the structure properties are missing then by convention return (0, 0, 1).
Parameters: astructure ( schrodinger.structure.Structure
) – the structure for which you want the Miller indicesReturn type: tuple Returns: hkl Miller index triple
-
schrodinger.application.matsci.nano.slab.
maestro_rotate_cell
(astructure, origin, a_vec, b_vec, c_vec)¶ Rotate the cell for proper Maestro view.
Parameters: - astructure (
schrodinger.structure.Structure
) – the structure that you want rotated - origin (numpy.array) – the origin
- a_vec (numpy.array) – the a lattice vector
- b_vec (numpy.array) – the b lattice vector
- c_vec (numpy.array) – the c lattice vector
Return type: schrodinger.structure.Structure
and four numpy.arrayReturns: rotated structure and vectors
- astructure (