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

Module mecp_mod

Classes and functions for finding MECPs.

Copyright Schrodinger, LLC. All rights reserved.

Classes [hide private]
  ParserWrapper
Manages the argparse module to parse user command line arguments.
  InputError
  CheckInput
Manages checking input.
  JaguarJob
Manages a Jaguar job.
  JaguarError
  JaguarJobs
Manages Jaguar jobs.
  TerminateException
  IterationError
  MECPStep
Manage an MECP step, which can be an iteration or a line search iteration.
  MinimizerError
  BFGS
Manage a BFGS optimization.
  EnergyAndGradients
Manage energy and gradient calls.
  MECP
Manages finding MECPs.
Functions [hide private]
float, numpy.array
rosen(x_vec)
The Rosenbrock function.
float, numpy.array
quadratic_1(x_vec)
The x**2 + y**2 + 2*x function.
float, numpy.array
quadratic_2(x_vec)
The x**2 + y**2 + 2*y function.
float, numpy.array
quadratic_3(x_vec)
The x**2 + y**2 + 6*x function.
numpy.array
get_guess(nvar=33, amp=5, seed=123)
Return a guess solution.
 
set_e_and_g(astructure, jobs)
Set the energies and gradients for a debug run.
int or None
get_final_state(state, scf_gs, multiplicity)
Return the final state.
numpy.array
vector_to_matrix(vector)
Convert vector to matrix.
numpy.array
matrix_to_vector(matrix)
Convert matrix to vector.
float, float, float
get_max_and_rms_and_len(matrix)
Return the max, RMS, and length of the given matrix.
 
log_vector(vector, header=None, log_sums=False, logger=None)
Log or print the given vector in a natoms X 3 format.
 
log_geometry(geometry, header='Geometry / Ang.', logger=None)
Log or print the geometry in a natoms X 3 format.
 
log_displacements(displacements, max_displacement, rms_displacement, len_displacement, header='Displacements / Ang.', logger=None)
Log or print the displacements in a natoms X 3 format.
 
log_energy_and_forces(energy, forces, max_force, rms_force, len_force, energy_header='Energy / Hartree', forces_header='Forces / Hartree/Ang.', logger=None)
Log or print the energy and forces in a natoms X 3 format.
numpy.array
reciprocal_bohr_to_angstrom(array)
Return the given array converted from units of reciprocal Bohr to reciprocal Angstrom.
float
ev_to_hartree(energy)
Return the given energy converted from eV to Hartree.
float
hartree_to_kcal_per_mol(in_hartree)
Return the given energy converted from Hartree to kcal/mol.
 
set_properties_and_write_structure(astructure, properties, writer)
Set the given properties on the structure and write it using the given writer.
float
get_angle_in_degrees(vec_1, vec_2)
Return the angle in units of degrees between the given two vectors.
Variables [hide private]
  __doc__ = ...
  DEFAULT_CHARGE_1 = 0
hash(x)
  DEFAULT_CHARGE_2 = 0
hash(x)
  DEFAULT_MULTIP_1 = 3
hash(x)
  DEFAULT_MULTIP_2 = 1
  DEFAULT_STATE_1 = 0
hash(x)
  DEFAULT_STATE_2 = 1
  DEFAULT_DATA = [(0, 3, 0), (0, 1, 1)]
  DEFAULT_SCF_GS = False
hash(x)
  DEFAULT_GS_KWARGS = OrderedDict([('iuhf', 2), ('dftname', 'B3L...
  DEFAULT_ES_KWARGS = OrderedDict([('itddft', 1), ('itda', 1)])
  DEFAULT_KWARGS = OrderedDict([('iuhf', 2), ('dftname', 'B3LYP'...
  RESERVED_JAGUAR_KEYS = ['multip', 'molchg', 'igeopt', 'itddft'...
  DEFAULT_JAGUAR_OPTIONS = ['iuhf=2', 'dftname=B3LYP', 'basis=MI...
  DEFAULT_ITERATIONS = 50
  DEFAULT_EPS = 0.0001
  IDENTITY_HESS = 'identity'
  DIAG_FWD_FIN_DIFF_GRAD_HESS = 'diag_fwd_fin_diff_grad'
  HESS_CHOICES = ['identity', 'diag_fwd_fin_diff_grad']
  DEFAULT_HESS = 'identity'
  PROJECTION = 'projection'
  UPDATING = 'updating'
  METHOD_CHOICES = ['projection', 'updating']
  DEFAULT_METHOD = 'projection'
  DEFAULT_PERP_FACTOR = 100.0
  DEFAULT_PARA_FACTOR = 1.0
  DELTA_ENERGY = 'delta_energy'
  MAX_FORCE = 'max_force'
  RMS_FORCE = 'rms_force'
  MAX_DISPLACEMENT = 'max_displacement'
  RMS_DISPLACEMENT = 'rms_displacement'
  DEFAULT_DELTA_ENERGY = -1e-06
  DEFAULT_MAX_FORCE = 0.0001
  DEFAULT_RMS_FORCE = 0.0001
  DEFAULT_MAX_DISPLACEMENT = 1e-05
  DEFAULT_RMS_DISPLACEMENT = 1e-05
  DEFAULT_CONVERGENCE_PAIRS = [('delta_energy', -1e-06), ('max_f...
  DEFAULT_CONVERGENCE_DICT = OrderedDict([('delta_energy', -1e-0...
  DEFAULT_CONVERGENCE = ['delta_energy=-1e-06', 'max_force=0.000...
  INPUT = 'input'
  OPT_1 = 'opt_1'
  OPT_2 = 'opt_2'
  GUESS_GEOM_CHOICES = ['input', 'opt_1', 'opt_2']
  DEFAULT_GUESS_GEOM = 'input'
  DEFAULT_ALL_GEOMETRIES = False
hash(x)
  DEFAULT_ALL_RESULTS = False
hash(x)
  DEFAULT_PROPERTIES = False
hash(x)
  DEFAULT_BASE_NAME = 'mecp'
  DEFAULT_VERBOSE = False
hash(x)
  LOCAL_HOST = 'localhost'
hash(x)
  DEFAULT_HOST = 'localhost'
hash(x)
  DEFAULT_TPP = 1
  DEFAULT_NPROC = 2
  DEFAULT_NRESOURCES = 2
  JOB_DJ_RETRIES = 0
hash(x)
  MAE_EXT = '.mae'
  IN_EXT = '.in'
  OUT_EXT = '.out'
  ALL_FILE_SUFFIX = '_out_all.mae'
  OUT_FILE_SUFFIX = '_out.mae'
  STATE_OPTIMIZATIONS = 'state_optimizations'
  MSG_WIDTH = 100
  DEFAULT_GEOMETRY_HEADER = 'Geometry / Ang.'
  DEFAULT_DISPLACEMENTS_HEADER = 'Displacements / Ang.'
  DEFAULT_ENERGY_HEADER = 'Energy / Hartree'
  DEFAULT_FORCES_HEADER = 'Forces / Hartree/Ang.'
  TITLE_KEY = 's_m_title'
  MECP_ENERGY_1_KEY = 'r_matsci_E_MECP(State_1)/Hartree'
  MECP_ENERGY_2_KEY = 'r_matsci_E_MECP(State_2)/Hartree'
  BARRIER_KEY = 'r_matsci_%s_barrier(State_%s)/kcal/mol'
  BARRIER_1_KEY = 'r_matsci_Forward_barrier(State_1)/kcal/mol'
  BARRIER_2_KEY = 'r_matsci_Reverse_barrier(State_2)/kcal/mol'
  DEFAULT_C1 = 0.0001
  DEFAULT_C2 = 0.9
  DEFAULT_MAX_STEP_SIZE = 50.0
  DEFAULT_MIN_STEP_SIZE = 1e-08
  DEFAULT_XTOL = 1e-14
  DEBUG = None
hash(x)
  __package__ = 'schrodinger.application.matsci'
  pair = ('itda', 1)
Function Details [hide private]

rosen(x_vec)

 

The Rosenbrock function. The target solution should be all ones and the function value here should be zero.

Parameters:
  • x_vec (numpy.array) - the solution vector (N X 1)
Returns: float, numpy.array
the function value and Jacobian (N X 1)

quadratic_1(x_vec)

 

The x**2 + y**2 + 2*x function. The target solution is (x = -1, y = 0) with f = -1. The minimum crossing point with quadratic_2 is (x = -1/2, y = -1/2).

Parameters:
  • x_vec (numpy.array) - the solution vector (N X 1)
Returns: float, numpy.array
the function value and Jacobian (N X 1)

quadratic_2(x_vec)

 

The x**2 + y**2 + 2*y function. The target solution is (x = 0, y = -1) with f = -1. The minimum crossing point with quadratic_1 is (x = -1/2, y = -1/2).

Parameters:
  • x_vec (numpy.array) - the solution vector (N X 1)
Returns: float, numpy.array
the function value and Jacobian (N X 1)

quadratic_3(x_vec)

 

The x**2 + y**2 + 6*x function. The target solution is (x = -3, y = 0) with f = -9. The minimum crossing point with quadratic_2 is (x = -3/10, y = -9/10).

Parameters:
  • x_vec (numpy.array) - the solution vector (N X 1)
Returns: float, numpy.array
the function value and Jacobian (N X 1)

get_guess(nvar=33, amp=5, seed=123)

 

Return a guess solution.

Parameters:
  • nvar (int) - the number of variables
  • amp (int) - the amplitude of the set of random numbers used in generating the guess solution
  • seed (int) - seed for random
Returns: numpy.array
the guess geometry (N X 1)

set_e_and_g(astructure, jobs)

 

Set the energies and gradients for a debug run.

Parameters:

get_final_state(state, scf_gs, multiplicity)

 

Return the final state.

Parameters:
  • state (int) - the 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
  • multiplicity (int) - molecular multiplicity
Returns: int or None
the final state or None if there isn't one

vector_to_matrix(vector)

 

Convert vector to matrix.

Parameters:
  • vector (numpy.array) - N X 1 array
Returns: numpy.array
N/3 X 3 array

matrix_to_vector(matrix)

 

Convert matrix to vector.

Parameters:
  • matrix (numpy.array) - N/3 X 3 array
Returns: numpy.array
N X 1 array

get_max_and_rms_and_len(matrix)

 

Return the max, RMS, and length of the given matrix.

Parameters:
  • matrix (numpy.array) - the matrix
Returns: float, float, float
the max, RMS, and length of the given matrix

log_vector(vector, header=None, log_sums=False, logger=None)

 

Log or print the given vector in a natoms X 3 format.

Parameters:
  • vector (numpy.array) - the vector to log (N X 1)
  • header (str or None) - a header or None if there isn't one
  • log_sums (bool) - whether to log the sums of x, y, and z over atoms
  • logger (logging.Logger or None) - output logger or None if there isn't one

log_geometry(geometry, header='Geometry / Ang.', logger=None)

 

Log or print the geometry in a natoms X 3 format.

Parameters:
  • geometry (numpy.array) - the geometry to log (N X 1)
  • header (str) - a header
  • logger (logging.Logger or None) - output logger or None if there isn't one

log_displacements(displacements, max_displacement, rms_displacement, len_displacement, header='Displacements / Ang.', logger=None)

 

Log or print the displacements in a natoms X 3 format.

Parameters:
  • displacements (numpy.array) - the displacements to log (N X 1)
  • max_displacement (float) - the magnitude of the largest displacements element
  • rms_displacement (float) - the RMS of displacements
  • len_displacement (float) - the length of displacements
  • header (str) - a header
  • logger (logging.Logger or None) - output logger or None if there isn't one

log_energy_and_forces(energy, forces, max_force, rms_force, len_force, energy_header='Energy / Hartree', forces_header='Forces / Hartree/Ang.', logger=None)

 

Log or print the energy and forces in a natoms X 3 format.

Parameters:
  • energy (float or None) - the energy or None if there isn't one
  • forces (numpy.array) - the forces to log (N X 1)
  • max_force (float) - the magnitude of the largest forces element
  • rms_force (float) - the RMS of forces
  • len_force (float) - the length of forces
  • energy_header (str) - an energy header
  • forces_header (str) - a forces header
  • logger (logging.Logger or None) - output logger or None if there isn't one

reciprocal_bohr_to_angstrom(array)

 

Return the given array converted from units of reciprocal Bohr to reciprocal Angstrom.

Parameters:
  • array (numpy.array) - the array to convert
Returns: numpy.array
the converted array

ev_to_hartree(energy)

 

Return the given energy converted from eV to Hartree.

Returns: float
energy in Hartree

hartree_to_kcal_per_mol(in_hartree)

 

Return the given energy converted from Hartree to kcal/mol.

Parameters:
  • in_hartree (float) - energy in Hartree
Returns: float
energy in kcal/mol

set_properties_and_write_structure(astructure, properties, writer)

 

Set the given properties on the structure and write it using the given writer.

Parameters:
  • astructure (schrodinger.structure.Structure) - the structure to write
  • properties (dict) - key/value pairs of properties to write
  • writer (structure.MaestroWriter) - the writer

get_angle_in_degrees(vec_1, vec_2)

 

Return the angle in units of degrees between the given two vectors.

Parameters:
  • vec_1 (numpy.array) - the first vector
  • vec_2 (numpy.array) - the second vector
Returns: float
the angle in degrees

Variables Details [hide private]

__doc__

Value:
"""
Classes and functions for finding MECPs.

Copyright Schrodinger, LLC. All rights reserved."""

DEFAULT_GS_KWARGS

Value:
OrderedDict([('iuhf', 2), ('dftname', 'B3LYP'), ('basis', 'MIDIX'), ('\
isymm', 0), ('maxit', 100), ('nofail', 0), ('nops', 1), ('iacc', 1)])

DEFAULT_KWARGS

Value:
OrderedDict([('iuhf', 2), ('dftname', 'B3LYP'), ('basis', 'MIDIX'), ('\
isymm', 0), ('maxit', 100), ('nofail', 0), ('nops', 1), ('iacc', 1), (\
'itddft', 1), ('itda', 1)])

RESERVED_JAGUAR_KEYS

Value:
['multip',
 'molchg',
 'igeopt',
 'itddft',
 'nroot',
 'target',
 'rsinglet',
 'rtriplet']

DEFAULT_JAGUAR_OPTIONS

Value:
['iuhf=2',
 'dftname=B3LYP',
 'basis=MIDIX',
 'isymm=0',
 'maxit=100',
 'nofail=0',
 'nops=1',
 'iacc=1',
...

DEFAULT_CONVERGENCE_PAIRS

Value:
[('delta_energy', -1e-06),
 ('max_force', 0.0001),
 ('rms_force', 0.0001),
 ('max_displacement', 1e-05),
 ('rms_displacement', 1e-05)]

DEFAULT_CONVERGENCE_DICT

Value:
OrderedDict([('delta_energy', -1e-06), ('max_force', 0.0001), ('rms_fo\
rce', 0.0001), ('max_displacement', 1e-05), ('rms_displacement', 1e-05\
)])

DEFAULT_CONVERGENCE

Value:
['delta_energy=-1e-06',
 'max_force=0.0001',
 'rms_force=0.0001',
 'max_displacement=1e-05',
 'rms_displacement=1e-05']