schrodinger.application.matsci.nano.interface_mod module

Classes and functions to create interface models.

Copyright Schrodinger, LLC. All rights reserved.

class schrodinger.application.matsci.nano.interface_mod.Interface(ref_layer, ads_layer, bot_layer='reference', strain_a=0.5, strain_b=0.5, strain_alpha=5.0, strain_beta=5.0, strain_gamma=5.0, separation=0.0, max_extents=10, translate_a=0.0, translate_b=0.0, base_name=None, logger=None)

Bases: object

Manage the building of an interface model.

MSGWIDTH = 100
buildLayer(cell, in_params, extents, is_infinite)

Build a layer by extending the input slab cell, also eliminate any PBC bonds along the c lattice vector.

Parameters:
  • cell (schrodinger.structure.Structure) – slab cell to extend
  • in_params (list) – the six lattice parameters
  • extents (list) – extents for layer
  • is_infinite (bool) – whether the slab cell is infinite
Return type:

schrodinger.structure.Structure

Returns:

extended layer

buildLayers(ref_extents, ads_extents)

Build the reference and adsorption layers by extending the input slab cells, also eliminate any PBC bonds along the c lattice vector.

Parameters:
  • ref_extents (list) – extents for reference layer
  • ads_extents (list) – extents for adsorption layer
Return type:

schrodinger.structure.Structure, schrodinger.structure.Structure

Returns:

extended reference and adsorption layers

getExtentsAndStrainedLength(index, strain)

For the lattice vector specified with the given index return (1) the reference and adsorption layer extents necessary to bring the extended lengths to within the specified amount of strain and (2) the strained adsorption layer length.

Parameters:
  • index (int) – an index used to specify along which direction to get the extents, i.e. 0 is a, 1 is b, 2 is c
  • strain (float) – the amount of strain allowed along the given lattice vector of the adsorption layer in units of Angstrom
Raises:

ValueError – if either extent is larger than the allowable maximum

Return type:

tuple, float

Returns:

the tuple contains the reference and adsorption layer integer extents, the float is the strained adsorption layer length in units of Angstrom

getInterface(ref_layer, ads_layer)

Build the interface model from the two finalized layers and return it.

Parameters:
Return type:

schrodinger.structure.Structure

Returns:

the interface model

getOrigin(lattice_params)

Return the origin in units of Angstrom for the given lattice parameters.

Parameters:lattice_params (list) – the six lattice parameters
Return type:numpy.array
Returns:the origin in units of Angstrom
getStrainedAdsorptionLayer(ads_layer)

Return the strained adsorption layer.

Parameters:ads_layer (schrodinger.structure.Structure) – the extended unstrained adsorption layer
Return type:schrodinger.structure.Structure
Returns:the strained adsorption layer
getStrainedAngle(index, strain)

Return the strained adsorption layer angle.

Parameters:
  • index (int) – the angle index
  • strain (float) – the allowable amount of strain in degrees
Raises:

ValueError – if the reference and adsorption layer angles are not within the specified amount of strain

Return type:

float

Returns:

strained adsorption layer angle in units of degree

getUpdatedCParams(in_params)

Return the set of lattice parameters with an updated c parameter.

Parameters:in_params (list) – the six lattice parameters
Return type:list
Returns:the six lattice parameters with c updated
logParams()

Log the parameters.

runIt()

Create the interface model.

setBaseName()

Set a base name.

setHKL()

Set hkl for both the reference and adsorption layers.

setInterfaceLatticeProperties()

Set the lattice parameter attributes for the interface model.

setInterfaceProperties()

Set some interface properties.

setIsInfinite()

Set the is_infinite attributes.

setLatticeProperties()

Set lattice parameter attributes for both the reference and adsorption layers.

setStrainedAdsorptionLatticeProperties(strained_a, strained_b, strained_alpha, strained_beta, strained_gamma)

Set the strained lattice parameter attributes for the adsorption layer.

Parameters:
  • strained_a (float) – the strained lattice a parameter in units of Angstrom
  • strained_b (float) – the strained lattice b parameter in units of Angstrom
  • strained_alpha (float) – the strained lattice alpha parameter in units of degree
  • strained_beta (float) – the strained lattice beta parameter in units of degree
  • strained_gamma (float) – the strained lattice gamma parameter in units of degree
translateTopLayer(ref_layer, ads_layer)

Translate the top layer.

Parameters:
class schrodinger.application.matsci.nano.interface_mod.ParserWrapper(scriptname, description)

Bases: object

Manages the argparse module to parse user command line arguments.

loadCommon()

Load ParserWrapper with common options.

loadIt()

Load ParserWrapper with all options.

loadOptions()

Load ParserWrapper with options.

loadRequired()

Load ParserWrapper with required options.

parseArgs(args)

Parse the command line arguments.

Parameters:args (tuple) – command line arguments
schrodinger.application.matsci.nano.interface_mod.del_atom_props(astructure, keys=['s_matsci_f1f2f3', 'r_matsci_f1', 'r_matsci_f2', 'r_matsci_f3'])

Delete the given atom properties from the given structure.

Parameters:
  • astructure (schrodinger.structure.Structure) – the structure from which to delete atom properties
  • keys (list) – keys of atom properties to be deleted
schrodinger.application.matsci.nano.interface_mod.get_formulas_basename(unit_cell_1, unit_cell_2)

Return a formatted basename containing the two unit cell formulas for the given two unit cells.

Parameters:
Return type:

str

Returns:

the formatted basename containing the two unit cell formulas

schrodinger.application.matsci.nano.interface_mod.lcm_approx(smaller, larger, tolerance=0.0, max_mult=10, threshold=1e-10)

From the two given numbers return two least common multiples (LCMs) that are within the specified tolerance of each other. If the numbers are integers and the tolerance is zero then this function is equivalent to the traditional LCM and the two returned LCMs will be identical integers. Raise a ValueError if either integer multiplier is larger than the given maximum.

Parameters:
  • smaller (float) – the smaller number
  • larger (float) – the larger number
  • tolerance (float) – a parameter controlling the extent to which two floats may be considered equivalent
  • max_mult (int) – the maximum allowable multiplier, supported to avoid potentially very long loops given that the inputs are floats compared using a specified tolerance
  • threshold (float) – a parameter controlling numerical precision
Raises:

ValueError – if either integer multipler is larger than the given maximum

Return type:

tuple, tuple

Returns:

the first tuple contains the two LCMs, the second contains the two integer multipliers, i.e. those integers which when multiplied by the inputs produce the LCMs

schrodinger.application.matsci.nano.interface_mod.list_to_string(alist, accuracy=3, separator=', ')

Return a formatted string containing the floats in the given list rounded to the given accuracy and separated by the given separator.

Parameters:
  • alist (list) – list of floats
  • accuracy (int) – used to round the floats
  • separator (str) – used to separate the rounded floats
Return type:

str

Returns:

the formatted string