schrodinger.application.matsci.interface module¶
Utilities for building interfaces using pymatgen.
Copyright Schrodinger, LLC. All rights reserved.
- class schrodinger.application.matsci.interface.SubstrateFilmMillers(substrate, film)¶
Bases:
tuple- film¶
Alias for field number 1
- substrate¶
Alias for field number 0
- class schrodinger.application.matsci.interface.Slab(slab, st)¶
Bases:
tuple- slab¶
Alias for field number 0
- st¶
Alias for field number 1
- class schrodinger.application.matsci.interface.SubstrateFilmTerminations(substrate, film)¶
Bases:
tuple- film¶
Alias for field number 1
- substrate¶
Alias for field number 0
- class schrodinger.application.matsci.interface.SubstrateFilmSlabs(terminations, substrate_slab, film_slab)¶
Bases:
tuple- film_slab¶
Alias for field number 2
- substrate_slab¶
Alias for field number 1
- terminations¶
Alias for field number 0
- class schrodinger.application.matsci.interface.SubstrateFilmInterface(interface, interface_st, substrate_st, film_st)¶
Bases:
tuple- film_st¶
Alias for field number 3
- interface¶
Alias for field number 0
- interface_st¶
Alias for field number 1
- substrate_st¶
Alias for field number 2
- exception schrodinger.application.matsci.interface.InterfaceException¶
Bases:
Exception
- schrodinger.application.matsci.interface.get_topo_matches(substrate_st, film_st, substrate_max_miller=1, film_max_miller=1, zslgen_kwargs=None, calculate_kwargs=None)¶
Return topological matches for the given substrate/film pair where the film can be strained.
- Parameters:
substrate_st (
schrodinger.structure.Structure) – the bulk substrate structurefilm_st (
schrodinger.structure.Structure) – the bulk film structuresubstrate_max_miller (int) – maximum Miller index to generate for substrate surfaces
film_max_miller (int) – maximum Miller index to generate for film surfaces
zslgen_kwargs (dict or None) – options for pymatgen.analysis.interfaces.zsl.ZSLGenerator if there are any
calculate_kwargs (dict or None) – options for pymatgen.analysis.interfaces.substrate_analyzer.SubstrateAnalyzer.calculate if there are any
- Raises:
InterfaceException – if there is an issue
- Return type:
dict[
SubstrateFilmMillers]=pymatgen.analysis.interfaces.substrate_analyzer.SubstrateMatch- Returns:
keys are SubstrateFilmMillers, values are pymatgen.analysis.interfaces.substrate_analyzer.SubstrateMatch
- schrodinger.application.matsci.interface.get_slabs(st, millers, generator_kwargs=None, get_slabs_kwargs=None)¶
Return slabs for the given structure, Miller indices, and other parameters.
- Parameters:
st (
schrodinger.structure.Structure) – the bulk structuremillers (tuple[int]) – triple of Miller indices
generator_kwargs (dict or None) – options for pymatgen.core.surface.SlabGenerator if there are any
get_slabs_kwargs (dict or None) – options for pymatgen.core.surface.SlabGenerator.get_slabs if there are any
- Return type:
dict[str]=list[
Slab]- Returns:
keys are termination strings, values are lists of Slab
- schrodinger.application.matsci.interface.get_title(bulk, tag, millers, termination)¶
Return the structure title for the given information.
- Parameters:
bulk (str) – bulk title read from input
tag (str) – one of module constants SUBSTRATE or FILM
millers (tuple[int]) – triple of Miller indices
termination (str) – the slab termination
- Return type:
str
- Returns:
the structure title
- schrodinger.application.matsci.interface.get_interface_slabs(substrate_st, film_st, all_millers, zslgen_kwargs=None)¶
Return slabs for the given substrate/film pair and their Miller indices that can be made into interfaces.
- Parameters:
substrate_st (
schrodinger.structure.Structure) – the bulk substrate structurefilm_st (
schrodinger.structure.Structure) – the bulk film structureall_millers (list[
SubstrateFilmMillers]) – collection of substrate and film Miller indiceszslgen_kwargs (dict or None) – options for pymatgen.analysis.interfaces.zsl.ZSLGenerator if there are any
- Raises:
InterfaceException – if there is an issue
- Return type:
dict[
SubstrateFilmMillers]=dict[SubstrateFilmTerminations]=`SubstrateFilmSlabs`- Returns:
outer keys are SubstrateFilmMillers, inner keys are SubstrateFilmTerminations, values are SubstrateFilmSlabs
- schrodinger.application.matsci.interface.get_interfaces(substrate_st, film_st, all_terminations, zslgen_kwargs=None, get_interfaces_kwargs=None)¶
Return interfaces for the given substrate/film pair, their Miller indices, and their terminations.
- Parameters:
substrate_st (
schrodinger.structure.Structure) – the bulk substrate structurefilm_st (
schrodinger.structure.Structure) – the bulk film structureall_terminations (dict[
SubstrateFilmMillers]=list[SubstrateFilmTerminations]) – collection of substrate and film Miller indices and terminationszslgen_kwargs (dict or None) – options for pymatgen.analysis.interfaces.zsl.ZSLGenerator if there are any
get_interfaces_kwargs (dict or None) – options for pymatgen.analysis.interfaces.coherent_interfaces.CoherentInterfaceBuilder. get_interfaces if there are any
- Raises:
InterfaceException – if there is an issue
- Return type:
dict[
SubstrateFilmMillers]=dict[SubstrateFilmTerminations]=list[SubstrateFilmInterface]- Returns:
outer keys are SubstrateFilmMillers, inner keys are SubstrateFilmTerminations, values are lists of SubstrateFilmInterface
- schrodinger.application.matsci.interface.isnan(value)¶
Wraps numpy.isnan to take a value of any type and not traceback.
- Parameters:
value (any) – the value to check
- Return type:
bool
- Returns:
True if the value is not a number
- schrodinger.application.matsci.interface.get_millers_tuple_from_str(millers_str)¶
Return a Millers tuple from a Millers string.
- Parameters:
millers_str (str) – the Millers string
- Raises:
InterfaceException – if there is an issue
- Return type:
tuple(int)
- Returns:
the Millers tuple
- schrodinger.application.matsci.interface.get_millers_and_terminations(row_idx, row_dict, include_terminations=True)¶
Return a validated tuple of (substrate millers, film millers) or (substrate millers, film millers, substrate termination, film termination) from the given dictionary of row data.
- Parameters:
row_idx (int) – the row index, 1-based
row_dict (dict[str]=any) – contains row data, keys are columns, values are data of any type
include_terminations (bool) – True if including terminations
- Raises:
InterfaceException – if there is an issue
- Return type:
tuple(tuple, tuple) or tuple(tuple, tuple, str, str)
- Returns:
validated tuple of (substrate millers, film millers) or (substrate millers, film millers, substrate termination, film termination)
- class schrodinger.application.matsci.interface.TopologicalMatches(substrate_st, film_st, basename, substrate_max_miller=1, film_max_miller=1, zslgen_kwargs=None, calculate_kwargs=None, generate_slabs=False, logger=None)¶
Bases:
object- __init__(substrate_st, film_st, basename, substrate_max_miller=1, film_max_miller=1, zslgen_kwargs=None, calculate_kwargs=None, generate_slabs=False, logger=None)¶
- Parameters:
substrate_st (
schrodinger.structure.Structure) – the bulk substrate structurefilm_st (
schrodinger.structure.Structure) – the bulk film structurebasename (str) – the base name to use for output file naming
substrate_max_miller (int) – maximum Miller index to generate for substrate surfaces
film_max_miller (int) – maximum Miller index to generate for film surfaces
zslgen_kwargs (dict or None) – options for pymatgen.analysis.interfaces.zsl.ZSLGenerator if there are any
calculate_kwargs (dict or None) – options for pymatgen.analysis.interfaces.substrate_analyzer.SubstrateAnalyzer.calculate if there are any
generate_slabs (bool) – for each topological match generate substrate and film slab models with terminations that are commensurate for interface building
logger (
logging.Logger) – the logger
- generateSlabs(millers, match)¶
Generate slabs.
- Parameters:
millers (
SubstrateFilmMillers) – substrate and film Miller indicesmatch (
pymatgen.analysis.interfaces.substrate_analyzer.SubstrateMatch) – the match object
- setMatchDataFrame()¶
Set the match data frame.
- writeOutputFiles()¶
Write the output files.
- run()¶
Run it.
- static getTopologicalMatchesDF(csv_fn, generate_slabs=False)¶
Return the topological matches dataframe.
- Parameters:
csv_fn (str) – the topological matches output csv file name
generate_slabs (bool) – True if the topological matches was run with the generate slabs option
- Raises:
InterfaceException – if there is an issue
- Return type:
pandas.DataFrame- Returns:
the topological matches dataframe
- class schrodinger.application.matsci.interface.BuildInterfaces(substrate_st, film_st, basename, get_interfaces_kwargs, zslgen_kwargs=None, logger=None)¶
Bases:
object- __init__(substrate_st, film_st, basename, get_interfaces_kwargs, zslgen_kwargs=None, logger=None)¶
- Parameters:
substrate_st (
schrodinger.structure.Structure) – the bulk substrate structurefilm_st (
schrodinger.structure.Structure) – the bulk film structurebasename (str) – the base name to use for output file naming
get_interfaces_kwargs (dict[
SubstrateFilmMillers]=dict[SubstrateFilmTerminations]=list[dict]) – outer keys are SubstrateFilmMillers, inner keys are SubstrateFilmTerminations, values are lists of options for pymatgen.analysis.interfaces.coherent_interfaces.CoherentInterfaceBuilder. get_interfaceszslgen_kwargs (dict or None) – options for pymatgen.analysis.interfaces.zsl.ZSLGenerator if there are any
logger (
logging.Logger) – the logger
- static getGetInterfacesKwargs(csv_fn)¶
Return parameters for building interfaces.
- Parameters:
csv_fn (str) – file name for the csv file containing parameters for building interfaces
- Raises:
InterfaceException – if there is an issue
- Return type:
dict[
SubstrateFilmMillers]=dict[SubstrateFilmTerminations]=list[dict]- Returns:
outer keys are SubstrateFilmMillers, inner keys are SubstrateFilmTerminations, values are lists of options for pymatgen.analysis.interfaces.coherent_interfaces.CoherentInterfaceBuilder. get_interfaces
- setInterfaceDataFrame()¶
Set the interface data frame.
- writeOutputFiles()¶
Write the output files.
- run()¶
Run it.