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 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
__init__

Initialize self. See help(type(self)) for accurate signature.

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
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.

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 indices
Return 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.array

Returns:

rotated structure and vectors