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.
Surface
(cell, h_index=1, k_index=1, l_index=0, normal_c=False, bottom=0.0, slab_thickness=1.0, vacuum_thickness=2.0, terminal_fragment='none', do_bonding=True, 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, normal_c=False, bottom=0.0, slab_thickness=1.0, vacuum_thickness=2.0, terminal_fragment='none', do_bonding=True, 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
- bottom (float or None) – the distance along the plane normal in fractional coordinates to serve as the bottom of the surface model
- slab_thickness (float or None) – thickness of the crystalline slab along the plane normal in fractional coordinates
- vacuum_thickness (float or None) – thickness of the vacuum layer along the plane normal in fractional coordinates
- terminal_fragment (str) – the fragment by which to terminate the surface
- do_bonding (bool) – whether to do the bonding, i.e. both connecting atoms and assigning bond orders
- logger (logging.Logger) – output logger
- cell (
-
getLatticeProperties
(cell)¶ Get the lattice properties.
Raise: ValueError if missing PDB PBC
-
buildSlab
()¶ Build the slab.
-
pruneIt
()¶ Prune the slab cell.
Raise: ValueError if the slab model has zero atoms Return type: dict Returns: contains bonding pairs that need termination, keys are outside atom indices, values are inside atom indices
-
doTermination
(terminal_pairs_dict)¶ Do the termination.
Parameters: terminal_pairs_dict (dict) – contains bonding pairs that need termination, keys are outside atom indices, values are inside atom indices
-
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 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 (