schrodinger.application.matsci.nano.surfaces_interfaces_mod module

Classes and functions to enumerate surfaces and interfaces.

Copyright Schrodinger, LLC. All rights reserved.

schrodinger.application.matsci.nano.surfaces_interfaces_mod.get_base_names(ref_xtal_asu, ref_base_name_in=None, ads_xtal_asu=None, ads_base_name_in=None)

Return the reference, adsorption, and final combined base names.

Parameters:
  • ref_xtal_asu (str) – reference xtal input file

  • ref_base_name_in (str or None) – reference base name or None if none has been given

  • ads_xtal_asu (str or None) – adsorption xtal input file or None if none has been given

  • ads_base_name_in (str or None) – adsorption base name or None if none has been given

Return type:

str, str or None, str

Returns:

reference, adsorption, and final combined base names, the adsorption base name will be None if no adsorption xtal asu is provided

class schrodinger.application.matsci.nano.surfaces_interfaces_mod.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 options.

parseArgs(args)

Parse the command line arguments.

Parameters:

args (tuple) – command line arguments

schrodinger.application.matsci.nano.surfaces_interfaces_mod.get_surface_kwargs(options_file)

Return a dictionary of surface options from the given options file.

Parameters:

options_file (str or None) – contains options for the surface build or None if there are none in which case the defaults are used

Return type:

dict

Returns:

contains options for the surface build

schrodinger.application.matsci.nano.surfaces_interfaces_mod.get_interface_kwargs(options_file)

Return a dictionary of interface options from the given options file.

Parameters:

options_file (str or None) – contains options for the interface build or None if there are none in which case the defaults are used

Return type:

dict

Returns:

contains options for the interface build

schrodinger.application.matsci.nano.surfaces_interfaces_mod.get_hkl_indices(flattened_hkl_indices=None, h_min=0, h_max=0, k_min=0, k_max=0, l_min=0, l_max=0)

Collect and return all hkl Miller index triples sorted by increasing l then k then h.

Parameters:
  • flattened_hkl_indices (list or None) – flattened hkl indices, for example 100, 110, etc. as [1, 0, 0, 1, 1, 0, …]

  • h_min (int) – minimum h index

  • h_max (int) – maximum h index

  • k_min (int) – minimum k index

  • k_max (int) – maximum k index

  • l_min (int) – minimum l index

  • l_max (int) – maximum l index

Raises:

ValueError – if there is an issue

Return type:

list

Returns:

contains sorted tuples of hkl triples

schrodinger.application.matsci.nano.surfaces_interfaces_mod.write_to_file(file_name, structs)

Write the structures to file with the feature’s WAM type

Parameters:
  • file_name (str) – The path to the file

  • structs (list) – List of structures to write to file

class schrodinger.application.matsci.nano.surfaces_interfaces_mod.Surfaces(xtal_asu, surface_kwargs=None, logger=None)

Bases: object

Manage the enumeration of surfaces.

__init__(xtal_asu, surface_kwargs=None, logger=None)

Create an instance.

Parameters:
  • xtal_asu (schrodinger.structure.Structure) – the crystalline ASU from which to create surfaces

  • surface_kwargs (None or dict) – kwargs for the surface build or None if there are none in which case the defaults will be used

  • logger (logging.Logger or None) – output logger or None if there isn’t one

getHKLIndices()

Collect and return all hkl Miller index triples for this surface enumeration and sort them according to increasing l then k then h.

Return type:

list

Returns:

contains sorted tuples of hkl triples

getSurface(cell, hkl, logger=None)

Build and return a slab.Surface.

Parameters:
  • cell (schrodinger.structure.Structure) – a cell

  • hkl (tuple) – a triple of Miller indices

  • logger (logging.Logger or None) – output logger or None if there isn’t one

Return type:

slab.Surface

Returns:

the surface object

logParams()

Log the parameters.

getXtalCell()

Build and return the crystal cell from which surfaces will be created.

Return type:

schrodinger.structure.Structure

Returns:

the crystal cell

getSurfaces()

Build and return the slab.Surface objects for all surfaces.

Return type:

list of slab.Surface

Returns:

contains surface objects

writeSurfaces(file_name)

Write surfaces to a Maestro file with the given file name.

Parameters:

file_name (str) – file name of the Maestro file

runIt()

Create the surfaces.

class schrodinger.application.matsci.nano.surfaces_interfaces_mod.Interfaces(ref_surfaces, ads_surfaces, interface_kwargs=None, logger=None)

Bases: object

Manage the enumeration of interfaces.

__init__(ref_surfaces, ads_surfaces, interface_kwargs=None, logger=None)

Create an instance.

Parameters:
  • ref_surfaces (list of schrodinger.structure.Structure) – reference surface ASUs from which interfaces will be created

  • ads_surfaces (list of schrodinger.structure.Structure) – adsorption surface ASUs from which interfaces will be created

  • interface_kwargs (None or dict) – kwargs for the interface builds or None if there are none in which case the defaults will be used

  • logger (logging.Logger or None) – output logger or None if there isn’t one

logParams()

Log the parameters.

getInterface(ref_surface, ads_surface)

Build and return a interface_mod.Interface.

Parameters:
Return type:

interface_mod.Interface

Returns:

the interface object

getInterfaces()

Build and return the interface_mod.Interface objects for all interfaces.

Return type:

list of interface_mod.Interface

Returns:

contains interface objects

writeInterfaces(file_name)

Write interfaces to a Maestro file with the given file name.

Parameters:

file_name (str) – file name of the Maestro file

runIt()

Create the interfaces.

class schrodinger.application.matsci.nano.surfaces_interfaces_mod.SurfacesInterfaces(ref_xtal_asu, ref_surface_kwargs=None, ads_xtal_asu=None, ads_surface_kwargs=None, interface_kwargs=None, logger=None)

Bases: object

Manage the enumeration of surfaces and interfaces.

__init__(ref_xtal_asu, ref_surface_kwargs=None, ads_xtal_asu=None, ads_surface_kwargs=None, interface_kwargs=None, logger=None)

Create an instance.

Parameters:
  • ref_xtal_asu (schrodinger.structure.Structure) – the crystalline ASU from which to create reference surfaces

  • ref_surface_kwargs (None or dict) – kwargs for the reference surface build or None if there are none in which case the defaults will be used

  • ads_xtal_asu (None or schrodinger.structure.Structure) – the crystalline ASU from which to create adsorption surfaces or None if interfaces are not needed

  • ads_surface_kwargs (None or dict) – kwargs for the adsorption surface build or None if there are none in which case the defaults will be used

  • interface_kwargs (None or dict) – kwargs for the interface build or None if there are none in which case the defaults will be used

  • logger (logging.Logger or None) – output logger or None if there isn’t one

checkInput()

Check input.

Raises:

ValueError – if any input crystal ASU is missing any lattice parameter structure properties

createSurfaces()

Create the surfaces.

Raises:

ValueError – if something goes wrong with either surface build

createInterfaces()

Create the interfaces.

runIt()

Create the surfaces and interfaces.