dielectric_constant_step package#

Submodules#

dielectric_constant_step.dielectric_constant module#

Non-graphical part of the Dielectric Constant step in a SEAMM flowchart

The static dielectric constant from the fluctuations of the dipole of the cell in equilibrium MD with fixed charges and Ewald or PPPM electrostatics: ε = 1 + (⟨M²⟩ − ⟨M⟩²) / (3 V ε0 kB T). For an electrolyte, M is the dipole of the neutral molecules: the ions carry a current, not a bounded dipole. The analysis is in seamm_md_analysis.electric.

The MD is run before this step – in a Loop for independent runs – or read from files; the step analyzes it.

dielectric_constant_step.dielectric_constant.DEBYE = 4.80320471#

e·Å in debye

class dielectric_constant_step.dielectric_constant.DielectricConstant(flowchart=None, title='Dielectric Constant', extension=None, logger=<Logger dielectric_constant_step.dielectric_constant (WARNING)>)[source]#

Bases: Node

The non-graphical part of a Dielectric Constant step in a flowchart.

parameters#

The control parameters for Dielectric Constant.

Type:

DielectricConstantParameters

analyze(indent='', P=None, configuration=None, **kwargs)[source]#

Analyze, print, plot and store the dielectric constant.

check_configuration(configuration)[source]#

Called by an MD step before it runs MD that this step will analyze.

Returns:

Warnings about the structure, e.g. that it is small.

Return type:

[str]

check_flowchart(preceding)[source]#

Check, before the job runs, that the MD will sample what is needed and is set up for the analysis.

create_parser()[source]#

Setup the command-line / config file parser

description_text(P=None, short=False)[source]#

Create the text description of what this step will do.

property git_revision#

The git version of this module.

md_requirements(P=None)[source]#

What the analysis needs from the MD: positions every 0.5 ps or so, in a periodic cell. It analyzes fluctuations, not the dynamics.

run()[source]#

Run a Dielectric Constant step.

property version#

The semantic version of this module.

dielectric_constant_step.dielectric_constant.EWALD_STYLES = ('ewald', 'pppm')#

The kspace styles with conducting boundaries, for which the formula holds

dielectric_constant_step.dielectric_constant.MAX_DIPOLE_FRAMES = 200#

The most frames used for the mean molecular dipole

dielectric_constant_step.dielectric_constant.hill_formula(symbols)[source]#

The formula of a molecule in Hill order.

dielectric_constant_step.dielectric_constant_parameters module#

Control parameters for the Dielectric Constant step in a SEAMM flowchart

class dielectric_constant_step.dielectric_constant_parameters.DielectricConstantParameters(defaults={}, data=None)[source]#

Bases: Parameters

The control parameters for Dielectric Constant.

The MD to analyze is run earlier in the flowchart – in a Loop for independent runs – or in other jobs (see seamm_md_analysis.step_support.source_parameters).

parameters = {'dipole of': {'default': 'automatic', 'default_units': '', 'description': 'Dipole of:', 'enumeration': ('automatic', 'the neutral molecules', 'every molecule'), 'format_string': 's', 'help_text': "The molecules whose dipole fluctuations give the dielectric constant. 'automatic' takes every molecule of a neutral liquid and the neutral molecules of an electrolyte: the ions carry a current, not a bounded dipole.", 'kind': 'enumeration'}, 'frame interval': {'default': 0.5, 'default_units': 'ps', 'description': 'Longest interval between frames:', 'enumeration': (), 'format_string': '.2f', 'help_text': 'The positions must be sampled at least this often.', 'kind': 'float'}, 'md files': {'applies_when': {'md source': 'files'}, 'default': '', 'default_units': '', 'description': 'H5MD files:', 'enumeration': (), 'format_string': 's', 'help_text': 'The md.h5md files to analyze, separated by spaces or commas. Each is an independent run. A relative path is in this job; job://<n>/<path> is in job n.', 'kind': 'string'}, 'md source': {'default': 'the last MD run of each loop iteration', 'default_units': '', 'description': 'MD to analyze:', 'enumeration': ('the last MD run', 'the last MD run of each loop iteration', 'files'), 'format_string': 's', 'help_text': "Where the MD for the dielectric constant comes from: the last MD run of each iteration of the loop around the MD, as independent runs (or the one run, without a loop); the last MD run earlier in the flowchart; or the H5MD files (md.h5md) of earlier runs, including other jobs' (job://<n>/<path>).", 'kind': 'enum'}, 'number of blocks': {'default': 5, 'default_units': '', 'description': 'Blocks for errors from one run:', 'enumeration': (), 'format_string': 'd', 'help_text': 'When a single MD run is analyzed, it is divided into this many consecutive blocks, which are analyzed separately to estimate the errors. Each block must be much longer than the correlation time.', 'kind': 'integer'}}#
retired = ('nruns', 'errors')#

an older flowchart that stores them can still be read, and they are ignored. Any other unknown parameter is an error. A plug-in’s Parameters class sets this.

Type:

Parameters the step had once and has dropped

dielectric_constant_step.dielectric_constant_step module#

class dielectric_constant_step.dielectric_constant_step.DielectricConstantStep(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.

The dictionary for the description is the class variable just below these comments. The felds are as follows:

my_description{str, str}

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 Dielectric Constant 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”, “Control”, “Custom”, “Data”, and “Simulations”.

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 (keyword arguments) – Various keyword 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:

DielectricConstant

create_tk_node(canvas=None, **kwargs)[source]#

Create and return the graphical Tk node object.

Parameters:
  • canvas (tk.Canvas) – The Tk Canvas widget

  • **kwargs (keyword arguments) – Various keyword 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:

TkDielectricConstant

description()[source]#

Return a description of what this step does.

Returns:

description

Return type:

dict(str, str)

my_description = {'description': 'The static dielectric constant of liquids and of the solvent of electrolytes, from the fluctuations of the dipole in MD', 'group': 'Analysis', 'name': 'Dielectric Constant'}#

dielectric_constant_step.metadata module#

This file contains metadata describing the results from DielectricConstant

dielectric_constant_step.metadata.metadata = {'results': {'Kirkwood factor': {'description': 'The Kirkwood factor g_K = (⟨M²⟩ − ⟨M⟩²) / (N μ²)', 'dimensionality': 'scalar', 'type': 'float', 'units': ''}, 'Kirkwood factor,stderr': {'description': 'The standard error of the Kirkwood factor', 'dimensionality': 'scalar', 'type': 'float', 'units': ''}, 'P': {'description': 'The mean pressure', 'dimensionality': 'scalar', 'type': 'float', 'units': 'atm'}, 'P,stderr': {'description': 'The standard error of the pressure', 'dimensionality': 'scalar', 'type': 'float', 'units': 'atm'}, 'T': {'description': 'The mean temperature', 'dimensionality': 'scalar', 'type': 'float', 'units': 'K'}, 'T,stderr': {'description': 'The standard error of the temperature', 'dimensionality': 'scalar', 'type': 'float', 'units': 'K'}, 'V': {'description': 'The mean volume', 'dimensionality': 'scalar', 'type': 'float', 'units': 'Å^3'}, 'bulk modulus': {'description': 'The bulk modulus used for the equilibrium density, from an NPT run', 'dimensionality': 'scalar', 'type': 'float', 'units': 'atm'}, 'density': {'description': 'The mean density', 'dimensionality': 'scalar', 'type': 'float', 'units': 'g/mL'}, 'density,stderr': {'description': 'The standard error of the density', 'dimensionality': 'scalar', 'type': 'float', 'units': 'g/mL'}, 'dipole correlation time': {'description': 'The correlation time of the dipole of the cell', 'dimensionality': 'scalar', 'type': 'float', 'units': 'ps'}, 'dipole moment': {'description': 'The mean dipole moment of a molecule', 'dimensionality': 'scalar', 'type': 'float', 'units': 'debye'}, 'epsilon': {'description': 'The static dielectric constant', 'dimensionality': 'scalar', 'property': 'dielectric constant#Dielectric Constant#{model}', 'type': 'float', 'units': ''}, 'epsilon,stderr': {'description': 'The standard error of the static dielectric constant', 'dimensionality': 'scalar', 'property': 'dielectric constant,stderr#Dielectric Constant#{model}', 'type': 'float', 'units': ''}, 'equilibrium density': {'description': 'The estimated density at the target pressure of runs at constant volume', 'dimensionality': 'scalar', 'type': 'float', 'units': 'g/mL'}, 'equilibrium density,stderr': {'description': 'The standard error of the estimated equilibrium density', 'dimensionality': 'scalar', 'type': 'float', 'units': 'g/mL'}, 'n_frames': {'description': 'The number of frames analyzed', 'dimensionality': 'scalar', 'type': 'integer'}, 'nruns': {'description': 'The number of MD runs analyzed', 'dimensionality': 'scalar', 'type': 'integer'}}}#

Description of the computational models for DielectricConstant.

Hamiltonians, approximations, and basis set or parameterizations, only if appropriate for this code. For example:

metadata["computational models"] = {
    "Hartree-Fock": {
        "models": {
            "PM7": {
                "parameterizations": {
                    "PM7": {
                        "elements": "1-60,62-83",
                        "periodic": True,
                        "reactions": True,
                        "optimization": True,
                        "code": "mopac",
                    },
                    "PM7-TS": {
                        "elements": "1-60,62-83",
                        "periodic": True,
                        "reactions": True,
                        "optimization": False,
                        "code": "mopac",
                    },
                },
            },
        },
    },
}

dielectric_constant_step.tk_dielectric_constant module#

The graphical part of a DielectricConstant step

class dielectric_constant_step.tk_dielectric_constant.TkDielectricConstant(tk_flowchart=None, node=None, namespace='org.molssi.seamm.tk', canvas=None, x=None, y=None, w=200, h=50)[source]#

Bases: TkNode

The graphical part of a DielectricConstant step in a flowchart.

tk_flowchart#

The flowchart that we belong to.

Type:

TkFlowchart = None

node#

The corresponding node of the non-graphical flowchart

Type:

Node = None

canvas#

The Tk Canvas to draw on

Type:

tkCanvas = None

dialog#

The Pmw dialog object

Type:

Dialog

x#

The x-coordinate of the center of the picture of the node

Type:

int = None

y#

The y-coordinate of the center of the picture of the node

Type:

int = None

w#

The width in pixels of the picture of the node

Type:

int = 200

h#

The height in pixels of the picture of the node

Type:

int = 50

self[widget]#

A dictionary of tk widgets built using the information contained in DielectricConstant parameterss.py

Type:

dict

See also

DielectricConstant, TkDielectricConstant, DielectricConstantParameters

create_dialog()[source]#

Create the dialog, with the widgets for the parameters.

reset_dialog(widget=None)[source]#

Lay out the widgets that apply, given the choices made.

Parameters:

widget (Tk Widget = None)

right_click(event)[source]#

Handles the right click event on the node.

Parameters:

event (Tk Event)

Return type:

None

See also

TkDielectricConstant.edit

Module contents#

dielectric_constant_step A SEAMM plug-in for Dielectric Constant