Package schrodinger :: Package application :: Package matsci :: Module mecp_mod :: Class EnergyAndGradients
[hide private]
[frames] | no frames]

Class EnergyAndGradients

object --+
         |
        EnergyAndGradients

Manage energy and gradient calls.

Instance Methods [hide private]
 
__init__(self, astructure, data=[(0, 3, 0), (0, 1, 1)], scf_gs=False, kwargs=OrderedDict([('iuhf', 2), ('dftname', 'B3LYP'), ('basis', 'MID..., base_name='mecp', all_results=False, convergence_dict=OrderedDict([('delta_energy', -1e-06), ('max_force', 0.0001), ..., max_iterations=50, method='projection', perp_factor=100.0, para_factor=1.0, all_geometries=False, host='localhost', nproc=2, tpp=1, verbose=False, logger=None, bfgs_obj=None)
Create an instance.
 
setUpMaeWriter(self)
Set up the Maestro output writer.
 
tearDownMaeWriter(self, exception)
Tear down the Maestro output writer and then raise an exception.
 
resetCallNumber(self)
Reset the call number.
 
setUpJaguarJobs(self)
Set up for the Jaguar jobs.
 
logHeader(self)
Log a header.
bool
newIteration(self)
Return True if this is a new iteration.
str
setUpIterationLaunchDir(self)
Set up the launch directory for this MECP iteration.
str
getLaunchSubDir(self)
Return the name of the launch subdirectory for the current job.
list
runJobs(self, launch_dir)
Run the jobs.
 
logSummary(self)
Log a summary.
 
handleStructure(self, x_to_use, step=None)
Handle setting and writing the structure.
 
finishPrevStep(self, next_x)
Finish the previous step.
float, numpy.array
handleFiniteDifferences(self, next_x, finite_diff_call)
Handle finite difference calls.
float, numpy.array
getEnergyAndGradients(self, next_x)
Return the energy and gradients that drive the MECP geometry optimization.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, astructure, data=[(0, 3, 0), (0, 1, 1)], scf_gs=False, kwargs=OrderedDict([('iuhf', 2), ('dftname', 'B3LYP'), ('basis', 'MID..., base_name='mecp', all_results=False, convergence_dict=OrderedDict([('delta_energy', -1e-06), ('max_force', 0.0001), ..., max_iterations=50, method='projection', perp_factor=100.0, para_factor=1.0, all_geometries=False, host='localhost', nproc=2, tpp=1, verbose=False, logger=None, bfgs_obj=None)
(Constructor)

 

Create an instance.

Parameters:
  • astructure (schrodinger.structure.Structure) - the structure for which the energy and gradients are needed
  • data (list) - contains (charge, multiplicity, state) tuples for the jobs for the two MECP states, for electronic state 0 is the ground state and <N> is the N-th excited state
  • scf_gs (bool) - specify whether ground states should be determined using an SCF
  • kwargs (dict) - dictionary of Jaguar &gen section key-value pairs
  • base_name (str) - a base name used to name the jobs and their related files
  • all_results (bool) - use this option to copy all subdirectories containing results from intermediate Jaguar force, etc. calculations back to the launch host
  • convergence_dict (dict) - contains various convergence thresholds
  • max_iterations (int) - the maximum number of MECP geometry optimization iterations
  • method (str) - the method to use to determine the MECP
  • perp_factor (float) - prefactor for the energy term whose gradient lies perpendicular to the crossing seam
  • para_factor (float) - prefactor for the energy term whose gradient lies parallel to the crossing seam
  • all_geometries (bool) - use this option to report all geometries, i.e. the geometries from all MECP geometries iterations will be reported in the output
  • host (str) - the host on which to run the jobs
  • nproc (int) - the number of processors to use for running the jobs, i.e. the number of simultaneous jobs
  • tpp (int) - the number of threads to use for the jobs, i.e. -TPP (threads-per-process)
  • verbose (bool) - specifies verbose logging
  • logger (logging.Logger or None) - output logger or None if there isn't one
  • bfgs_obj (BFGS) - a BFGS object that manages the optimization
Overrides: object.__init__

tearDownMaeWriter(self, exception)

 

Tear down the Maestro output writer and then raise an exception.

Parameters:
  • exception (Exception) - the exception to raise after tear down

newIteration(self)

 

Return True if this is a new iteration.

Returns: bool
True if this is a new iteration, False otherwise

setUpIterationLaunchDir(self)

 

Set up the launch directory for this MECP iteration.

Returns: str
the launch directory for this MECP iteration

getLaunchSubDir(self)

 

Return the name of the launch subdirectory for the current job.

Returns: str
the launch subdirectory for the current job

runJobs(self, launch_dir)

 

Run the jobs.

Parameters:
  • launch_dir (str) - the launch directory for the jobs
Returns: list
contains the JaguarJob instances for the two jobs

handleStructure(self, x_to_use, step=None)

 

Handle setting and writing the structure.

Parameters:
  • x_to_use (numpy.array) - the geometry vector to use (N X 1)
  • step (MECPStep or None) - the step from which to obtain the energy to use or None if there is no energy

finishPrevStep(self, next_x)

 

Finish the previous step.

Parameters:
  • next_x (numpy.array) - the next geometry vector (N X 1)

handleFiniteDifferences(self, next_x, finite_diff_call)

 

Handle finite difference calls.

Parameters:
  • next_x (numpy.array) - the next geometry vector (N X 1)
  • finite_diff_call (int) - the index of a finite difference call
Returns: float, numpy.array
the energy and gradients (N X 1)

getEnergyAndGradients(self, next_x)

 

Return the energy and gradients that drive the MECP geometry optimization.

Parameters:
  • next_x (numpy.array) - the next geometry vector (N X 1)
Returns: float, numpy.array
the energy and gradients (N X 1)