dftbplus_step package#
Submodules#
dftbplus_step.band_structure module#
Setup DFTB+
- class dftbplus_step.band_structure.BandStructure(flowchart=None, title='Band Structure', extension=None, logger=<Logger dftbplus_step.band_structure (WARNING)>)[source]#
Bases:
DftbBase
- analyze(indent='', data={}, out=[])[source]#
Parse the output and generating the text output and store the data in variables for other stages to access
- property git_revision#
The git version of this module.
- property header#
A printable header for this section of output
- property version#
The semantic version of this module.
dftbplus_step.band_structure_parameters module#
Global control parameters for DFTB+
- class dftbplus_step.band_structure_parameters.BandStructureParameters(defaults={}, data=None)[source]#
Bases:
Parameters
The control parameters for the band structure.
- parameters = {'create tables': {'default': 'yes', 'default_units': None, 'description': 'Create tables as needed:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': 'Whether to create tables as needed for results being saved into tables.', 'kind': 'boolean'}, 'nPoints': {'default': 100, 'default_units': '', 'description': 'Number of points:', 'enumeration': None, 'format_string': '', 'help_text': 'The number of k-points along the band structure path.', 'kind': 'integer'}, 'results': {'default': {}, 'default_units': None, 'description': 'results', 'enumeration': (), 'format_string': '', 'help_text': 'The results to save to variables or in tables. ', 'kind': 'dictionary'}}#
dftbplus_step.band_structure_step module#
Main module.
dftbplus_step.base module#
Non-graphical part of the DFTB+ step in a SEAMM flowchart
- class dftbplus_step.base.DftbBase(flowchart=None, title='Choose Parameters', extension=None, logger=<Logger dftbplus_step.base (WARNING)>)[source]#
Bases:
Node
A base class for substeps in the DFTB+ step.
- band_structure(input_path, sym_points, sym_names, Efermi=[0.0, 0.0], DOS=None)[source]#
Prepare the graph for the band structure.
- Parameters:
path (filename or pathlib.Path) – The path to the band output from DFTB+.
- create_band_structure_data(input_path, sym_points, sym_names, Efermi=[0.0, 0.0])[source]#
Massage the band structure data into a standard form
- Parameters:
path (filename or pathlib.Path) – The path to the band output from DFTB+.
- create_dos_data(input_path, Efermi=[0.0])[source]#
Create the DOS data
- Parameters:
input_path (filename or pathlib.Path) – The path to the band output from DFTB+.
Efermi (float) – The Fermi energy in eV
- dos(input_path, Efermi=[0.0])[source]#
Prepare the graph for the density of states.
- Parameters:
input_path (filename or pathlib.Path) – The path to the band output from DFTB+.
Efermi (float) – The Fermi energy in eV
- property exe_config#
The configuration for the DFTB+ executable.
- find_previous_step(cls, missing_ok=False)[source]#
Find the previous step of class ‘cls’
- Parameters:
cls (class) – The class of the desired step.
missing_ok (bool = False) – Don’t raise an error, but return None if no step found
- Returns:
The node if found, None if not.
- Return type:
seamm.Node
- geometry()[source]#
Create the input for DFTB+ for the geometry.
Example:
Geometry = { TypeNames = { "Ga" "As" } TypesAndCoordinates [Angstrom] = { 1 0.000000 0.000000 0.000000 2 1.356773 1.356773 1.356773 } Periodic = Yes LatticeVectors [Angstrom] = { 2.713546 2.713546 0. 0. 2.713546 2.713546 2.713546 0. 2.713546 } }
- property is_runable#
Indicate whether this not runs or just adds input.
- property model#
The model (chemistry) used to obtain results.
dftbplus_step.choose_parameters module#
Setup DFTB+
- class dftbplus_step.choose_parameters.ChooseParameters(flowchart=None, title='Choose Parameters', extension=None, logger=<Logger dftbplus_step.choose_parameters (WARNING)>)[source]#
Bases:
DftbBase
- analyze(indent='', data={}, out=[])[source]#
Parse the output and generating the text output and store the data in variables for other stages to access
- property git_revision#
The git version of this module.
- property header#
A printable header for this section of output
- property is_runable#
Indicate whether this not runs or just adds input.
- property version#
The semantic version of this module.
dftbplus_step.choose_parameters_parameters module#
Global control parameters for DFTB+
- class dftbplus_step.choose_parameters_parameters.ChooseParametersParameters(defaults={}, data=None)[source]#
Bases:
Parameters
The control parameters for initializing DFTB+
- parameters = {'dataset': {'default': '3ob', 'default_units': None, 'description': 'Parameterization:', 'enumeration': ('DFTB - 3ob', 'DFTB - matsci', 'DFTB - mio', 'DFTB - auorg', 'DFTB - borg', 'DFTB - halorg', 'DFTB - ob2', 'DFTB - pbc', 'DFTB - siband', 'DFTB - rare'), 'format_string': '', 'help_text': 'The parameterization to use.', 'kind': 'string'}, 'elements': {'default': '', 'default_units': None, 'description': 'Elements:', 'enumeration': None, 'format_string': '', 'help_text': 'The elements to include.', 'kind': 'periodic table'}, 'model': {'default': 'any', 'default_units': None, 'description': 'Model:', 'enumeration': ('any', 'Density Functional Tight Binding (DFTB)', 'eXtended Tight Binding (xTB)'), 'format_string': '', 'help_text': 'The model to use.', 'kind': 'string'}, 'subset': {'default': 'none', 'default_units': None, 'description': 'Specialized parameterization to add:', 'enumeration': ('none', '3ob-freq', '3ob-hhmod', '3ob-nhmod', '3ob-ophyd'), 'format_string': '', 'help_text': 'The specialized set parameters to add to the main set.', 'kind': 'string'}}#
dftbplus_step.choose_parameters_step module#
Main module.
dftbplus_step.computational_models module#
dftbplus_step.dftbplus module#
Non-graphical part of the DFTB+ step in a SEAMM flowchart
- class dftbplus_step.dftbplus.Dftbplus(flowchart=None, title='DFTB+', namespace='org.molssi.seamm.dftbplus', extension=None, logger=<Logger dftbplus_step.dftbplus (WARNING)>)[source]#
Bases:
Node
The non-graphical part of a DFTB+ step in a flowchart.
- Parameters:
parser (configargparse.ArgParser) – The parser object.
options (tuple) – It contains a two item tuple containing the populated namespace and the list of remaining argument strings.
subflowchart (seamm.Flowchart) – A SEAMM Flowchart object that represents a subflowchart, if needed.
parameters (DftbplusParameters) – The control parameters for DFTB+.
See also
TkDftbplus
,Dftbplus
,DftbplusParameters
- analyze(indent='', data=None, **kwargs)[source]#
Do any analysis of the output from this step.
Also print important results to the local step.out file using ‘printer’.
- Parameters:
indent (str) – An extra indentation for the output
- description_text(P=None)[source]#
Create the text description of what this step will do. The dictionary of control values is passed in as P so that the code can test values, etc.
- Parameters:
P (dict) – An optional dictionary of the current values of the control parameters.
- Returns:
A description of the current step.
- Return type:
str
- property exe_config#
- property git_revision#
The git version of this module.
- run()[source]#
Run a DFTB+ step.
- Parameters:
None
- Returns:
The next node object in the flowchart.
- Return type:
seamm.Node
- property version#
The semantic version of this module.
- dftbplus_step.dftbplus.deep_merge(d, u)[source]#
Do a deep merge of one dict into another.
This will update d with values in u, but will not delete keys in d not found in u at some arbitrary depth of d. That is, u is deeply merged into d.
- Args -
d, u: dicts
Note: this is destructive to d, but not u.
Returns: None
Written by djpinne @ https://stackoverflow.com/questions/3232943/update-value-of-a-nested-dictionary-of-varying-depth
dftbplus_step.dftbplus_parameters module#
Control parameters for the DFTB+ step in a SEAMM flowchart
- class dftbplus_step.dftbplus_parameters.DftbplusParameters(defaults={}, data=None)[source]#
Bases:
Parameters
The control parameters for DFTB+.
The developer will add a dictionary of Parameters to this class. The keys are parameters for the current plugin, which themselves might be dictionaries.
You need to replace the ‘time’ example below with one or more definitions of the control parameters for your plugin and application.
- Parameters:
parameters ({str: str}) – A dictionary containing the parameters for the current step. Each key of the dictionary is a dictionary that contains the the following keys: kind, default, default_units, enumeration, format_string, description and help text.
parameters['kind'] (custom) – Specifies the kind of a variable. While the ‘kind’ of a variable might be a numeric value, it may still have enumerated custom values meaningful to the user. For instance, if the parameter is a convergence criterion for an optimizer, custom values like ‘normal’, ‘precise’, etc, might be adequate. In addition, any parameter can be set to a variable of expression, indicated by having ‘$’ as the first character in the field. For example, $OPTIMIZER_CONV.
parameters['default'] ('integer' or 'float' or 'string' or 'boolean' or) – ‘enum’ The default value of the parameter, used to reset it.
parameters['default_units'] (str) – The default units, used for resetting the value.
parameters['enumeration'] (tuple) – A tuple of enumerated values.
parameters['format_string'] (str) – A format string for ‘pretty’ output.
parameters['description'] (str) – A short string used as a prompt in the GUI.
parameters['help_text'] (tuple) – A longer string to display as help for the user.
See also
Dftbplus
,TkDftbplus
,Dftbplus
,DftbplusParameters
,DFTB
Examples
: parameters = { “time”: { “default”: 100.0, “kind”: “float”, “default_units”: “ps”, “enumeration”: tuple(), “format_string”: “.1f”, “description”: “Simulation time:”, “help_text”: (“The time to simulate in the dynamics run.”) }, }
- parameters = {'calculation': {'default': 'geometry optimization', 'default_units': None, 'description': 'Calculation type:', 'enumeration': ('current structure', 'geometry optimization', 'molecular dynamics'), 'format_string': '', 'help_text': 'Whether to do a calculation on the current structure, optimize the geometry, or run molecular dynamics.', 'kind': 'string'}}#
dftbplus_step.dftbplus_step module#
- class dftbplus_step.dftbplus_step.DftbplusStep(flowchart=None, gui=None)[source]#
Bases:
object
Helper class needed for the stevedore integration.
This must provide a description() method that returns a dict containing a description of this node, and create_node() and create_tk_node() methods for creating the graphical and non-graphical nodes.
- Parameters:
my_description ({}) – A human-readable description of this step. It can be several lines long, and needs to be clear to non-expert users. It contains the following keys: description, group, name.
my_description['description'] (tuple) – A description of the DFTB+ step. It must be clear to non-experts.
my_description['group'] (str) – Which group in the menus to put this step. If the group does not exist it will be created. Common groups are ‘Building’, ‘Calculations’, ‘Control’ and ‘Data’.
my_description['name'] (str) – The name of this step, to be displayed in the menus.
- create_node(flowchart=None, **kwargs)[source]#
Create and return the new node object.
- Parameters:
flowchart (seamm.Node) – A non-graphical SEAMM node
**kwargs (keyworded arguments) – Various keyworded arguments such as title, namespace or extension representing the title displayed in the flowchart, the namespace for the plugins of a subflowchart and the extension, respectively.
- Return type:
See also
Dftbplus
- create_tk_node(canvas=None, **kwargs)[source]#
Create and return the graphical Tk node object.
- Parameters:
canvas (tk.Canvas) – The Tk Canvas widget
**kwargs (keyworded arguments) – Various keyworded arguments such as tk_flowchart, node, x, y, w, h representing a graphical flowchart object, a non-graphical node for a step, and dimensions of the graphical node.
- Return type:
See also
TkDftbplus
- my_description = {'description': 'An interface for DFTB+', 'group': 'Simulations', 'name': 'DFTB+'}#
dftbplus_step.dos module#
Setup DFTB+
- class dftbplus_step.dos.DOS(flowchart=None, title='DOS', extension=None, logger=<Logger dftbplus_step.dos (WARNING)>)[source]#
Bases:
DftbBase
- analyze(indent='', data={}, out=[])[source]#
Parse the output and generating the text output and store the data in variables for other stages to access
- property git_revision#
The git version of this module.
- property header#
A printable header for this section of output
- property version#
The semantic version of this module.
dftbplus_step.dos_parameters module#
Global control parameters for DFTB+
- class dftbplus_step.dos_parameters.DOSParameters(defaults={}, data=None)[source]#
Bases:
Parameters
The control parameters for the band structure.
- parameters = {'create tables': {'default': 'yes', 'default_units': None, 'description': 'Create tables as needed:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': 'Whether to create tables as needed for results being saved into tables.', 'kind': 'boolean'}, 'k-grid method': {'default': 'grid spacing', 'default_units': '', 'description': 'Specify k-space grid using:', 'enumeration': ('supercell folding', 'grid spacing'), 'format_string': '', 'help_text': 'How to specify the k-space integration grid.', 'kind': 'string'}, 'k-spacing': {'default': 0.05, 'default_units': '1/Å', 'description': 'K-spacing:', 'enumeration': None, 'format_string': '', 'help_text': 'The spacing of the grid in reciprocal space.', 'kind': 'float'}, 'na': {'default': 10, 'default_units': '', 'description': 'NPoints in a:', 'enumeration': None, 'format_string': '', 'help_text': 'Number of points in the first direction of the Brillouin zone.', 'kind': 'integer'}, 'nb': {'default': 10, 'default_units': '', 'description': 'NPoints in b:', 'enumeration': None, 'format_string': '', 'help_text': 'Number of points in the second direction of the Brillouin zone.', 'kind': 'integer'}, 'nc': {'default': 10, 'default_units': '', 'description': 'NPoints in c:', 'enumeration': None, 'format_string': '', 'help_text': 'Number of points in the third direction of the Brillouin zone.', 'kind': 'integer'}, 'results': {'default': {}, 'default_units': None, 'description': 'results', 'enumeration': (), 'format_string': '', 'help_text': 'The results to save to variables or in tables. ', 'kind': 'dictionary'}}#
dftbplus_step.dos_step module#
Main module.
dftbplus_step.energy module#
Setup DFTB+
- class dftbplus_step.energy.Energy(flowchart=None, title='Single-Point Energy', extension=None, logger=<Logger dftbplus_step.energy (WARNING)>)[source]#
Bases:
DftbBase
- analyze(indent='', data={}, out=[])[source]#
Parse the output and generating the text output and store the data in variables for other stages to access
- property git_revision#
The git version of this module.
- property header#
A printable header for this section of output
- make_plots(data)[source]#
Create the density and orbital plots if requested.
- Parameters:
data (dict()) – Dictionary of results from the calculation (results.tag file)
- property version#
The semantic version of this module.
dftbplus_step.energy_parameters module#
Global control parameters for DFTB+
- class dftbplus_step.energy_parameters.EnergyParameters(defaults={}, data=None)[source]#
Bases:
Parameters
The control parameters for the DFTB+ Hamiltonian
Example:
Hamiltonian = DFTB { Scc = Yes SlaterKosterFiles = { O-O = "../../slakos/mio-ext/O-O.skf" O-H = "../../slakos/mio-ext/O-H.skf" H-O = "../../slakos/mio-ext/H-O.skf" H-H = "../../slakos/mio-ext/H-H.skf" } MaxAngularMomentum = { O = "p" H = "s" } PolynomialRepulsive = {} ShellResolvedSCC = No OldSKInterpolation = No RangeSeparated = None {} ReadInitialCharges = No InitialCharges = {} SCCTolerance = 1.0000000000000001E-005 HCorrection = None {} SpinPolarisation = {} ElectricField = {} Solver = RelativelyRobust {} Charge = 0.0000000000000000 MaxSCCIterations = 100 OnSiteCorrection = {} Dispersion = {} Solvation = {} Electrostatics = GammaFunctional {} ThirdOrder = No ThirdOrderFull = No Differentiation = FiniteDiff { Delta = 1.2207031250000000E-004 } ForceEvaluation = "Traditional" Mixer = Broyden { MixingParameter = 0.20000000000000001 InverseJacobiWeight = 1.0000000000000000E-002 MinimalWeight = 1.0000000000000000 MaximalWeight = 100000.00000000000 WeightFactor = 1.0000000000000000E-002 } Filling = Fermi { Temperature = 0.0000000000000000 } }
- output = {'difference density': {'default': 'yes', 'default_units': '', 'description': 'Plot difference density:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': 'Whether to plot the difference density.', 'kind': 'boolean'}, 'nx': {'default': 50, 'default_units': '', 'description': 'Grid:', 'enumeration': None, 'format_string': '', 'help_text': 'Number of grid points in first direction', 'kind': 'integer'}, 'ny': {'default': 50, 'default_units': '', 'description': 'x', 'enumeration': None, 'format_string': '', 'help_text': 'Number of grid points in second direction', 'kind': 'integer'}, 'nz': {'default': 50, 'default_units': '', 'description': 'x', 'enumeration': None, 'format_string': '', 'help_text': 'Number of grid points in first direction', 'kind': 'integer'}, 'orbitals': {'default': 'yes', 'default_units': '', 'description': 'Plot orbitals:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': 'Whether to plot orbitals.', 'kind': 'boolean'}, 'region': {'default': 'default', 'default_units': '', 'description': 'Region:', 'enumeration': ('default', 'explicit'), 'format_string': '', 'help_text': 'The region for the plots', 'kind': 'string'}, 'selected k-points': {'default': 'none', 'default_units': '', 'description': 'For crystals, k-points:', 'enumeration': ('none', 'all'), 'format_string': '', 'help_text': 'Plots the orbitals at these k-points.', 'kind': 'string'}, 'selected orbitals': {'default': '-1, HOMO, LUMO, +1', 'default_units': '', 'description': 'Selected orbitals:', 'enumeration': ('all', '-1, HOMO, LUMO, +1'), 'format_string': '', 'help_text': 'Which orbitals to plot.', 'kind': 'string'}, 'total density': {'default': 'yes', 'default_units': '', 'description': 'Plot total density:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': 'Whether to plot the total charge density.', 'kind': 'boolean'}, 'total spin density': {'default': 'yes', 'default_units': '', 'description': 'Plot total spin density:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': 'Whether to plot the total spin density.', 'kind': 'boolean'}}#
- parameters = {'ConvergentSccOnly': {'default': 'No', 'default_units': '', 'description': 'Not converged is error:', 'enumeration': ('Yes', 'No'), 'format_string': '', 'help_text': "Whether to throw an error if the SCC cycle doesn't converge.", 'kind': 'string'}, 'Damping Exponent': {'default': 4.0, 'default_units': '', 'description': 'Damping exponent:', 'enumeration': None, 'format_string': '', 'help_text': 'The exponent for the short range damping of interactions where at least one atom is a hydrogen.', 'kind': 'float'}, 'Filling': {'default': 'Fermi', 'default_units': '', 'description': 'Electronic temperature method:', 'enumeration': ('Fermi', 'Gaussian', 'Methfessel-Paxton'), 'format_string': '', 'help_text': 'The method to populate the electrons due to temperature.', 'kind': 'string'}, 'Filling Temperature': {'default': 300, 'default_units': 'K', 'description': 'Temperature:', 'enumeration': None, 'format_string': '', 'help_text': 'The electronic temperature for the electronic population.', 'kind': 'float'}, 'HCorrection': {'default': 'Default for parameters', 'default_units': '', 'description': 'Hydrogen interaction correction:', 'enumeration': ('None', 'Default for parameters', 'Damping', 'DFTB3-D3H5'), 'format_string': '', 'help_text': 'Whether and how to correct the interactions of hydrogens, mainly hydrogen bonds.', 'kind': 'string'}, 'MaxSCCIterations': {'default': 100, 'default_units': '', 'description': 'Maximum number of iterations:', 'enumeration': None, 'format_string': '', 'help_text': 'Maximal number of SCC cycles to reach convergence. If convergence is not reached after the specified number of steps, the program stops unless requested elsewhere.', 'kind': 'integer'}, 'RelaxTotalSpin': {'default': 'yes', 'default_units': '', 'description': 'Optimize the spin:', 'enumeration': ('no', 'yes'), 'format_string': '', 'help_text': 'Whether to optimize the spin polarization or leave it fixed.', 'kind': 'string'}, 'SCC': {'default': 'Yes', 'default_units': '', 'description': 'Self-consistent charges:', 'enumeration': ('Yes', 'No'), 'format_string': '', 'help_text': 'Whether to do a self-consistent charge calculation.', 'kind': 'string'}, 'SCCTolerance': {'default': 1e-05, 'default_units': '', 'description': 'Convergence criterion:', 'enumeration': None, 'format_string': '', 'help_text': 'Stopping criteria for the SCC. Specifies the tolerance for the maximum difference in any charge between two SCC cycles.', 'kind': 'float'}, 'ShellResolvedSCC': {'default': 'no', 'default_units': '', 'description': 'Shell-resolved charges:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': 'Whether to use shell-resolved charges. If the parameter set does not support this, it will be ignored.', 'kind': 'string'}, 'ShellResolvedSpin': {'default': 'yes', 'default_units': '', 'description': 'Shell-resolved spins:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': 'Whether to use shell-resolved spin. If the parameter set does not support this, it will be ignored.', 'kind': 'string'}, 'SpinPolarisation': {'default': 'from system', 'default_units': '', 'description': 'Spin polarization:', 'enumeration': ('from system', 'none', 'collinear', 'noncollinear'), 'format_string': '', 'help_text': 'How to handle spin polarization', 'kind': 'string'}, 'ThirdOrder': {'default': 'Default for parameters', 'default_units': '', 'description': 'Use 3rd order corrections:', 'enumeration': ('No', 'Default for parameters', 'Partial', 'Full'), 'format_string': '', 'help_text': 'Whether to use 3rd order corrections.', 'kind': 'string'}, 'create tables': {'default': 'yes', 'default_units': None, 'description': 'Create tables as needed:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': 'Whether to create tables as needed for results being saved into tables.', 'kind': 'boolean'}, 'initial charges': {'default': 'default', 'default_units': '', 'description': 'Use existing atomic charges:', 'enumeration': ('default', 'none', 'from previous step', 'from structure'), 'format_string': '', 'help_text': 'Whether to use existing charges on the atoms.', 'kind': 'string'}, 'input only': {'default': 'no', 'default_units': '', 'description': 'Write the input files and stop:', 'enumeration': ('yes', 'no'), 'format_string': 's', 'help_text': "Don't run DFTB+. Just write the input files.", 'kind': 'boolean'}, 'k-grid method': {'default': 'grid spacing', 'default_units': '', 'description': 'Specify k-space grid using:', 'enumeration': ('supercell folding', 'grid spacing'), 'format_string': '', 'help_text': 'How to specify the k-space integration grid.', 'kind': 'string'}, 'k-spacing': {'default': 0.2, 'default_units': '1/Å', 'description': 'K-spacing:', 'enumeration': None, 'format_string': '', 'help_text': 'The spacing of the grid in reciprocal space.', 'kind': 'float'}, 'na': {'default': 4, 'default_units': '', 'description': 'NPoints in a:', 'enumeration': None, 'format_string': '', 'help_text': 'Number of points in the first direction of the Brillouin zone.', 'kind': 'integer'}, 'nb': {'default': 4, 'default_units': '', 'description': 'NPoints in b:', 'enumeration': None, 'format_string': '', 'help_text': 'Number of points in the second direction of the Brillouin zone.', 'kind': 'integer'}, 'nc': {'default': 4, 'default_units': '', 'description': 'NPoints in c:', 'enumeration': None, 'format_string': '', 'help_text': 'Number of points in the third direction of the Brillouin zone.', 'kind': 'integer'}, 'primitive cell': {'default': 'Yes', 'default_units': '', 'description': 'Use primitive cell:', 'enumeration': ('Yes', 'No'), 'format_string': '', 'help_text': 'Whether to use the primitive cell for the calculation.', 'kind': 'boolean'}, 'results': {'default': {}, 'default_units': None, 'description': 'results', 'enumeration': (), 'format_string': '', 'help_text': 'The results to save to variables or in tables. ', 'kind': 'dictionary'}, 'use atom spins': {'default': 'yes', 'default_units': '', 'description': 'Use existing atomic spins:', 'enumeration': ('yes', 'no'), 'format_string': '', 'help_text': 'Whether to use existing spins on the atoms.', 'kind': 'string'}}#
dftbplus_step.energy_step module#
Main module.
dftbplus_step.installer module#
Installer for the DFTB+ plug-in.
This handles any further installation needed after installing the Python package dftbplus-step.
- class dftbplus_step.installer.Installer(logger=<Logger dftbplus_step.installer (WARNING)>)[source]#
Bases:
InstallerBase
Handle further installation needed after installing dftbplus-step.
The Python package dftbplus-step should already be installed, using pip, conda, or similar. This plug-in-specific installer then checks for the Dftbplus executable, installing it if needed, and registers its location in ~/SEAMM/dftbplus.ini.
There are a number of ways to determine which are the correct Dftbplus executables to use. The aim of this installer is to help the user locate the executables. There are a number of possibilities:
The correct executables are already available.
If they are already registered in dftbplus.ini there is nothing else to do.
They may be in the current path, in which case they need to be added to dftbplus.ini.
If a module system is in use, a module may need to be loaded to give access to Dftbplus.
They cannot be found automatically, so the user needs to locate the executables for the installer.
Dftbplus is not installed on the machine. In this case they can be installed in a Conda environment. There is one choice:
They can be installed in a separate environment, seamm-dftbplus by default.
The Slater-Koster potentials also need to be installed if not present. They are placed in ~/SEAMM/Parameters/slako or, in containers, ~/Parameters/slako by default. The code uses those in ~/Parameters before those in ~/SEAMM/Parameters.
- check()[source]#
Check the installation and fix errors if requested.
If the option yes is present and True, this method will attempt to correct any errors in the configuration file. Use –yes on the command line to enable this.
The base class handles the DFTB+ executable, ensuring that the following is in the [dftbplus] section of the configuration file.
- installation
How the executables are installed. One of user, modules or conda
- conda-environment
The Conda environment if and only if installation = conda
- modules
The environment modules if installation = modules
- {self.path_name}
The path where the executables are. Automatically defined if installation is conda or modules, but given by the user is it is user.
In addition, this method checks for the Slater-Koster parameters sets, installing them if needed and requested.
- Returns:
True if everything is OK, False otherwise. If yes is given as an option, the return value is after fixing the configuration.
- Return type:
bool
- exe_version(path)[source]#
Get the version of the Dftbplus executable.
- Parameters:
path (pathlib.Path) – Path to the executable.
- Returns:
The version reported by the executable, or ‘unknown’.
- Return type:
str
- install()[source]#
Install DFTB+ and the Slater-Koster files
The base class handles the DFTB+ executable, ensuring that the following is in the [dftbplus] section of the configuration file.
- installation
How the executables are installed. One of user, modules or conda
- conda-environment
The Conda environment if and only if installation = conda
- modules
The environment modules if installation = modules
- {self.path_name}
The path where the executables are. Automatically defined if installation is conda or modules, but given by the user is it is user.
In addition, this method installs the Slater-Koster parameters sets and sets slako-dir in the [dftbplus] section of the configuration file.
- install_files(location)[source]#
Install the Slater-Koster files and update the configuration if needed.
- Parameters:
location (Path) – The directory for the installed files.
- uninstall()[source]#
Uninstall DFTB+ and the Slater-Koster files
The base class handles the DFTB+ executable, ensuring that the following is in the [dftbplus] section of the configuration file.
- installation
How the executables are installed. One of user, modules or conda
- conda-environment
The Conda environment if and only if installation = conda
- modules
The environment modules if installation = modules
- {self.path_name}
The path where the executables are. Automatically defined if installation is conda or modules, but given by the user is it is user.
In addition, this method uninstalls the Slater-Koster parameters sets and sets slako-dir to null in the [dftbplus] section of the configuration file.
- update()[source]#
Update DFTB+ and the Slater-Koster files
The base class handles the DFTB+ executable, ensuring that the following is in the [dftbplus] section of the configuration file.
- installation
How the executables are installed. One of user, modules or conda
- conda-environment
The Conda environment if and only if installation = conda
- modules
The environment modules if installation = modules
- {self.path_name}
The path where the executables are. Automatically defined if installation is conda or modules, but given by the user is it is user.
In addition, this method updates the Slater-Koster parameters sets.
dftbplus_step.metadata module#
This file contains metadata to help describe the results of DFTB+ calculations, etc.
- dftbplus_step.metadata.metadata = {'computational models': {'DFTB': {'models': {'3ob': {'parameterizations': {'3ob': {'code': 'dftb+', 'elements': '1,6,7,8,9,11,12,15,16,17,19,20,30,35,53', 'optimization': True, 'periodic': True, 'reactions': True}, '3ob-freq': {'code': 'dftb+', 'elements': '1,6,7,8,9,11,12,15,16,17,19,20,30,35,53', 'optimization': True, 'periodic': True, 'reactions': True}, '3ob-hhmod': {'code': 'dftb+', 'elements': '1,6,7,8,9,11,12,15,16,17,19,20,30,35,53', 'optimization': True, 'periodic': True, 'reactions': True}, '3ob-nhmod': {'code': 'dftb+', 'elements': '1,6,7,8,9,11,12,15,16,17,19,20,30,35,53', 'optimization': True, 'periodic': True, 'reactions': True}, '3ob-ophyd': {'code': 'dftb+', 'elements': '1,6,7,8,9,11,12,15,16,17,19,20,30,35,53', 'optimization': True, 'periodic': True, 'reactions': True}}}, 'auorg': {'parameterizations': {'auorg': {'code': 'dftb+', 'elements': '1,6,7,8,16,79', 'optimization': True, 'periodic': True, 'reactions': True}}}, 'borg': {'parameterizations': {'borg': {'code': 'dftb+', 'elements': '1,5', 'optimization': True, 'periodic': True, 'reactions': True}}}, 'halorg': {'parameterizations': {'halorg': {'code': 'dftb+', 'elements': '1,6,7,8,9,15,16,17,35,53', 'optimization': True, 'periodic': True, 'reactions': True}}}, 'matsci': {'parameterizations': {'magsil': {'code': 'dftb+', 'elements': '1,5,6,7,8,11,12,13,14,15,22,29', 'optimization': True, 'periodic': True, 'reactions': True}, 'matsci': {'code': 'dftb+', 'elements': '1,5,6,7,8,11,13,14,15,22,29', 'optimization': True, 'periodic': True, 'reactions': True}}}, 'mio': {'parameterizations': {'chalc': {'code': 'dftb+', 'elements': '1,6,7,8,15,16,33', 'optimization': True, 'periodic': True, 'reactions': True}, 'hyb': {'code': 'dftb+', 'elements': '1,6,7,8,14,15,16,31,33,47', 'optimization': True, 'periodic': True, 'reactions': True}, 'mio': {'code': 'dftb+', 'elements': '1,6,7,8,15,16', 'optimization': True, 'periodic': True, 'reactions': True}, 'miomod-hh': {'code': 'dftb+', 'elements': '1,6,7,8,15,16', 'optimization': True, 'periodic': True, 'reactions': True}, 'miomod-nh': {'code': 'dftb+', 'elements': '1,6,7,8,15,16', 'optimization': True, 'periodic': True, 'reactions': True}, 'tiorg': {'code': 'dftb+', 'elements': '1,6,7,8,15,16,22', 'optimization': True, 'periodic': True, 'reactions': True}, 'trans3d': {'code': 'dftb+', 'elements': '1,6,7,8,15,16,21,22,26,27,28', 'optimization': True, 'periodic': True, 'reactions': True}, 'znorg': {'code': 'dftb+', 'elements': '1,6,7,8,15,16,30', 'optimization': True, 'periodic': True, 'reactions': True}}}, 'pbc': {'parameterizations': {'pbc': {'code': 'dftb+', 'elements': '1,6,7,8,9,14', 'optimization': True, 'periodic': True, 'reactions': True}}}, 'rare': {'parameterizations': {'rare': {'code': 'dftb+', 'elements': '7,31,63', 'optimization': True, 'periodic': True, 'reactions': True}}}, 'siband': {'parameterizations': {'siband': {'code': 'dftb+', 'elements': '1,8,14', 'optimization': True, 'periodic': True, 'reactions': True}}}}}, 'xTB': {'models': {'GFN1': {'parameterizations': {'GFN1': {'code': 'dftb+', 'elements': '1-86', 'optimization': True, 'periodic': True, 'reactions': True}}}, 'GFN2': {'parameterizations': {'GFN2': {'code': 'dftb+', 'elements': '1-86', 'optimization': True, 'periodic': True, 'reactions': True}}}, 'IPEA1': {'parameterizations': {'IPEA1': {'code': 'dftb+', 'elements': '1-86', 'optimization': True, 'periodic': True, 'reactions': True}}}}}}, 'results': {'#_primitive_cells': {'calculation': ['energy', 'optimization'], 'description': 'The number of primitive cells in the unit cell', 'dimensionality': 'scalar', 'type': 'integer'}, 'Z': {'calculation': ['energy', 'optimization'], 'description': 'The number of empirical formula u its in the system', 'dimensionality': 'scalar', 'type': 'integer'}, 'atomic_dipole_moment': {'calculation': ['energy', 'optimization'], 'description': 'The dipole moments of the atoms', 'dimensionality': [3, 'natoms'], 'type': 'float'}, 'cell_volume': {'calculation': ['energy', 'optimization'], 'description': 'The volume of the unit cell', 'dimensionality': 'scalar', 'property': 'unit cell volume', 'type': 'float', 'units': 'Å^3'}, 'dipole_moments': {'calculation': ['energy', 'optimization'], 'description': 'The dipole moments of the system', 'dimensionality': [3, 'nspins'], 'type': 'float'}, 'eigenvalues': {'calculation': ['energy', 'optimization'], 'description': 'The eigenvalues', 'dimensionality': ['norbitals'], 'type': 'float', 'units': 'E_h'}, 'empirical_formula': {'calculation': ['energy', 'optimization'], 'description': 'The empirical formula of the system', 'dimensionality': 'scalar', 'type': 'string'}, 'energy': {'description': 'electronic energy', 'dimensionality': 'scalar', 'type': 'float', 'units': 'E_h'}, 'energy of formation': {'calculation': ['energy', 'optimization'], 'description': 'The energy of formation', 'dimensionality': 'scalar', 'property': 'energy of formation#DFTB+#{model}', 'type': 'float', 'units': 'kJ/mol'}, 'energy_per_formula_unit': {'calculation': ['energy', 'optimization'], 'description': 'The energy per empirical formula unit', 'dimensionality': 'scalar', 'property': 'total energy per formula unit#DFTB+#{model}', 'type': 'float', 'units': 'E_h'}, 'extrapolated0_energy': {'calculation': ['energy', 'optimization'], 'description': 'The energy extrapolated to no smearing', 'dimensionality': 'scalar', 'type': 'float', 'units': 'E_h'}, 'fermi_level': {'calculation': ['energy', 'optimization'], 'description': 'The Fermi level', 'dimensionality': 'scalar', 'property': 'Fermi level#DFTB+#{model}', 'type': 'float', 'units': 'E_h'}, 'filling': {'calculation': ['energy', 'optimization'], 'description': 'The orbital occupancy', 'dimensionality': ['norbitals'], 'type': 'float'}, 'forcerelated_energy': {'calculation': ['energy', 'optimization'], 'description': 'The force-related energy', 'dimensionality': 'scalar', 'type': 'float', 'units': 'E_h'}, 'forces': {'calculation': ['energy', 'optimization'], 'description': 'The forces on the atoms', 'dimensionality': [3, 'natoms'], 'type': 'float', 'units': 'E_h/bohr'}, 'formula': {'calculation': ['energy', 'optimization'], 'description': 'The chemical formula of the system', 'dimensionality': 'scalar', 'type': 'string'}, 'gradients': {'description': 'gradients on the atoms', 'dimensionality': [3, 'n_atoms'], 'type': 'float', 'units': 'E_h/Å'}, 'gross_atomic_charges': {'calculation': ['energy', 'optimization'], 'description': 'The charges on the atoms', 'dimensionality': ['natoms'], 'type': 'float'}, 'gross_atomic_spins': {'calculation': ['energy', 'optimization'], 'description': 'The spins on the atoms', 'dimensionality': ['natoms'], 'type': 'float'}, 'mermin_energy': {'calculation': ['energy', 'optimization'], 'description': 'The Mermin energy', 'dimensionality': 'scalar', 'type': 'float', 'units': 'E_h'}, 'model': {'description': 'The model string', 'dimensionality': 'scalar', 'type': 'string'}, 'number_of_electrons': {'calculation': ['energy', 'optimization'], 'description': 'The number of electrons', 'dimensionality': [2], 'type': 'float'}, 'orbital_charges': {'calculation': ['energy', 'optimization'], 'description': 'The orbital charges', 'dimensionality': ['natoms', 'natoms'], 'type': 'float'}, 'scaled_dipole': {'calculation': ['energy', 'optimization'], 'description': 'The scaled dipole moments of the system', 'dimensionality': [3, 'nspins'], 'type': 'float'}, 'stress': {'calculation': ['energy', 'optimization'], 'description': 'The stress', 'dimensionality': [3, 3], 'type': 'float', 'units': 'Å^3'}, 'total_energy': {'calculation': ['energy', 'optimization'], 'description': 'The total energy', 'dimensionality': 'scalar', 'property': 'total energy#DFTB+#{model}', 'type': 'float', 'units': 'E_h'}}}#
Properties that DFTB+ produces, depending on the type of calculation.
dftbplus_step.optimization module#
Setup DFTB+
- class dftbplus_step.optimization.Optimization(flowchart=None, title='Optimization', extension=None)[source]#
Bases:
Energy
- analyze(indent='', data={}, out=[])[source]#
Parse the output and generating the text output and store the data in variables for other stages to access
- property git_revision#
The git version of this module.
- property header#
A printable header for this section of output
- property version#
The semantic version of this module.
dftbplus_step.optimization_parameters module#
Global control parameters for DFTB+
- class dftbplus_step.optimization_parameters.OptimizationParameters(defaults={}, data=None)[source]#
Bases:
EnergyParameters
The control parameters for optimization using DFTB+
- parameters = {'DiagLimit': {'default': 0.01, 'default_units': '', 'description': 'Limit for diagonal Hessian elements:', 'enumeration': (), 'format_string': '', 'help_text': 'The lower limit for the diagonal Hessian elements in the BFGS-like update step in the rational optimizer.', 'kind': 'float'}, 'LatticeOpt': {'default': 'Yes', 'default_units': '', 'description': 'Optimize the cell (if periodic):', 'enumeration': ('Yes', 'No'), 'format_string': '', 'help_text': 'Allow the lattice vectors to change during optimisation. MovedAtoms can be optionally used with lattice optimisation if the atomic coordinates are to be co-optimised with the lattice.', 'kind': 'string'}, 'MaxForceComponent': {'default': 0.0001, 'default_units': 'hartree/bohr', 'description': 'Convergence criterion:', 'enumeration': (), 'format_string': '.1f', 'help_text': 'Optimisation is stopped if the force component with the maximal absolute value goes below this threshold.', 'kind': 'float'}, 'MaxSteps': {'default': 200, 'default_units': '', 'description': 'Maximum number of steps:', 'enumeration': (), 'format_string': '', 'help_text': 'Maximum number of steps after which the optimisation should stop (unless already stopped by achieving convergence). Setting this value as -1 runs a huge() number of iterations.', 'kind': 'integer'}, 'Memory': {'default': 20, 'default_units': '', 'description': 'Number of steps to remember:', 'enumeration': (), 'format_string': '', 'help_text': 'Number of last steps which are saved and used to calculate the next step via the LBFGS algorithm. The literature recommends that Memory should between 3 and 20.', 'kind': 'integer'}, 'StepSize': {'default': 100.0, 'default_units': 'a_u_time', 'description': 'Step size:', 'enumeration': (), 'format_string': '', 'help_text': 'Step size (dt) along the forces. The displacement dxi along the ith coordinate is given for each atom as dxi = fi2mdt2, where fi is the appropriate force component and m is the mass of the atom.', 'kind': 'float'}, 'aPar': {'default': 0.1, 'default_units': '', 'description': 'Velocity update parameter:', 'enumeration': (), 'format_string': '', 'help_text': 'Parameter for the update of the velocities.', 'kind': 'float'}, 'fAlpha': {'default': 0.99, 'default_units': '', 'description': 'Alpha update on reset:', 'enumeration': (), 'format_string': '', 'help_text': 'The factor for the update the alpha parameter on reset.', 'kind': 'float'}, 'fDec': {'default': 0.5, 'default_units': '', 'description': 'Stepsize decrease factor:', 'enumeration': (), 'format_string': '', 'help_text': 'The factor to decrease the step size', 'kind': 'float'}, 'fInc': {'default': 1.1, 'default_units': '', 'description': 'Stepsize increase factor:', 'enumeration': (), 'format_string': '', 'help_text': 'The factor to increase the step size', 'kind': 'float'}, 'nMin': {'default': 5, 'default_units': '', 'description': 'Steps before increasing stepsize:', 'enumeration': (), 'format_string': '', 'help_text': 'The minimum number of steps before the step size is increased.', 'kind': 'integer'}, 'optimization method': {'default': 'Rational Function', 'default_units': '', 'description': 'Method:', 'enumeration': ('Rational Function', 'Limited-memory Broyden-Fletcher-Goldfarb-Shanno (LBFGS)', 'Fast inertial relaxation engine (FIRE)', 'Steepest descent'), 'format_string': 's', 'help_text': 'The optimization method to use.', 'kind': 'enumeration'}, 'pressure': {'default': 0.0, 'default_units': '', 'description': 'Pressure:', 'enumeration': (), 'format_string': '.1f', 'help_text': 'The applied pressure.', 'kind': 'float'}}#
dftbplus_step.optimization_step module#
Main module.
dftbplus_step.slako module#
Utility program to scan the Slater-Koster potential files and extract the metadata from them.
- dftbplus_step.slako.add_wavefunction(directory='.')[source]#
Add the wfc information to the metadata.
- dftbplus_step.slako.analyze_directory(root='data/slako')[source]#
Find all the Slater-Koster files under a given directory and analyze their metadata.
- dftbplus_step.slako.create_datafile(directory='~/SEAMM/Parameters/slako')[source]#
Parse the files and get the data needed for the metadata-file
dftbplus_step.tk_band_structure module#
The graphical part of a DFTB+ BandStructure node
- class dftbplus_step.tk_band_structure.TkBandStructure(tk_flowchart=None, node=None, canvas=None, x=120, y=20, w=200, h=50, my_logger=<Logger dftbplus_step.tk_band_structure (WARNING)>)[source]#
Bases:
TkNode
dftbplus_step.tk_choose_parameters module#
The graphical part of a DFTB+ ChooseParameters node
- class dftbplus_step.tk_choose_parameters.TkChooseParameters(tk_flowchart=None, node=None, canvas=None, x=120, y=20, w=200, h=50, my_logger=<Logger dftbplus_step.tk_choose_parameters (WARNING)>)[source]#
Bases:
TkNode
dftbplus_step.tk_dftbplus module#
The graphical part of a DFTB+ step
- class dftbplus_step.tk_dftbplus.TkDftbplus(tk_flowchart=None, node=None, namespace='org.molssi.seamm.dftbplus.tk', canvas=None, x=None, y=None, w=200, h=50)[source]#
Bases:
TkNode
The graphical part of a DFTB+ step in a flowchart.
- Parameters:
tk_flowchart (TkFlowchart = None) – The flowchart that we belong to.
node (Node = None) – The corresponding node of the non-graphical flowchart
canvas (tkCanvas = None) – The Tk Canvas to draw on
dialog (Dialog) – The Pmw dialog object
x (int = None) – The x-coordinate of the center of the picture of the node
y (int = None) – The y-coordinate of the center of the picture of the node
w (int = 200) – The width in pixels of the picture of the node
h (int = 50) – The height in pixels of the picture of the node
self[widget] (dict) – A dictionary of tk widgets built using the information contained in DFTB+_parameters.py
See also
Dftbplus
,TkDftbplus
,DftbplusParameters
- create_dialog()[source]#
Create the dialog. A set of widgets will be chosen by default based on what is specified in the DFTB+_parameters module.
- Parameters:
None
- Return type:
None
See also
TkDftbplus.reset_dialog
- edit()[source]#
Present a dialog for editing the DFTB+ input
- Parameters:
None
- Return type:
None
See also
- from_flowchart(tk_flowchart=None, flowchart=None)[source]#
Recreate the graphics from the non-graphical flowchart.
This is only used in nodes that contain sub-flowcharts.
- Parameters:
tk_flowchart (seamm.tk_Flowchart) – A graphical representation of the SEAMM Flowchart
flowchart (seamm.Flowchart) – A non-graphical representation of the SEAMM Flowchart
- Return type:
None
- handle_dialog(result)[source]#
Handle the closing of the edit dialog
What to do depends on the button used to close the dialog. If the user closes it by clicking the ‘x’ of the dialog window, None is returned, which we take as equivalent to cancel.
- Parameters:
result (None or str) – The value of this variable depends on what the button the user clicked.
- Return type:
None
- handle_help()[source]#
Shows the help to the user when click on help button.
- Parameters:
None
- Return type:
None
- right_click(event)[source]#
Handles the right click event on the node.
- Parameters:
event (Tk Event)
- Return type:
None
See also
- update_flowchart(tk_flowchart=None, flowchart=None)[source]#
Update the nongraphical flowchart.
This is only used in nodes that contain sub-flowcharts What to do depends on the button used to close the dialog. If the user closes it by clicking the ‘x’ of the dialog window, None is returned, which we take as equivalent to cancel.
- Parameters:
tk_flowchart (seamm.tk_Flowchart) – A graphical representation of the SEAMM Flowchart
flowchart (seamm.Flowchart) – A non-graphical representation of the SEAMM Flowchart
- Return type:
None
dftbplus_step.tk_dos module#
The graphical part of a DFTB+ DOS node
- class dftbplus_step.tk_dos.TkDOS(tk_flowchart=None, node=None, canvas=None, x=120, y=20, w=200, h=50, my_logger=<Logger dftbplus_step.tk_dos (WARNING)>)[source]#
Bases:
TkNode
dftbplus_step.tk_energy module#
The graphical part of a DFTB+ Energy node
- class dftbplus_step.tk_energy.TkEnergy(tk_flowchart=None, node=None, canvas=None, x=120, y=20, w=200, h=50, my_logger=<Logger dftbplus_step.tk_energy (WARNING)>)[source]#
Bases:
TkNode
dftbplus_step.tk_optimization module#
The graphical part of a DFTB+ Optimization node
- class dftbplus_step.tk_optimization.TkOptimization(tk_flowchart=None, node=None, canvas=None, x=120, y=20, w=200, h=50, my_logger=<Logger dftbplus_step.tk_optimization (WARNING)>)[source]#
Bases:
TkEnergy
Module contents#
dftbplus_step A step for DFTB+ in a SEAMM flowchart