Molsys

class optking.molsys.Molsys(fragments, dimer_intcos=None)[source]

Bases: object

Attributes Summary

Z

all_fragments

atom_symbols

dimer_intcos

dimer_psuedo_frags

frag_natoms

fragments

fragments_atom_list

frozen_intco_list

Determine vector with 1 for any frozen internal coordinate

geom

cartesian geometry [a0]

intco_lbls

intcos_present

masses

natom

nfragments

num_intcos

num_intrafrag_intcos

Methods Summary

Bmat([massWeight])

Gmat([massWeight])

Calculates BuB^T (calculates B matrix)

add_cartesian_intcos()

apply_external_forces(fq, H, stepNumber)

atom2frag_index(atom_index)

atom_list2unique_frag_list(atomList)

augment_connectivity_to_single_fragment(C)

clear()

closest_atoms_between_2_frags(A, B)

consolidate_fragments()

constraint_matrix([fq])

Returns constraint matrix with 1 on diagonal for frozen coordinates

dimerfrag_1st_intco(iDI)

dimerfrag_intco_range(iDI)

dimerfrag_intco_slice(iDI)

distance_matrix()

fix_bend_axes()

See description in Fragment class.

frag_1st_atom(iF)

frag_1st_intco(iF)

frag_atom_range(iF)

frag_atom_slice(iF)

frag_geom(iF)

cartesian geometry for fragment i

frag_intco_range(iF)

frag_intco_slice(iF)

from_dict(d)

from_psi4(mol)

Creates a optking molecular system from psi4 mol.

from_schema(qc_molecule)

Creates optking molecular system from JSON input.

gradient_to_cartesians(g_q)

converts the gradient from internal into Cartesian coordinates

gradient_to_internals(g_x[, coeff, B, useMasses])

Transform cartesian gradient to internals :param g_x: (3nat, 1) cartesian gradient :type g_x: np.ndarray :param coeff: prefactor coefficient; -1 for forces :type coeff: float :param B: B matrix to use :type B: np.ndarray, optional :param useMasses: instead of identity, use u = 1/masses in transformation :type useMasses: boolean

hessian_to_cartesians(Hint[, g_q])

hessian_to_internals(H[, g_x, useMasses])

converts the hessian from cartesian coordinates into internal coordinates Hq = A^t (Hxy - Kxy) A, where K_xy = sum_q ( grad_q[I] d^2(q_I)/(dx dy) and A = (BuB^t)^-1 Bu

interfrag_dq_discontinuity_correction(dq)

print_geom()

Returns a string of the geometry for logging in [a0]

print_intcos()

project_redundancies_and_constraints(fq, H)

Project redundancies and constraints out of forces and Hessian

purge_interfragment_connectivity(C)

q()

Returns internal coordinate values in au as list.

q_array()

Returns internal coordinate values in au as array.

q_show()

returns internal coordinates values in Angstroms/degrees as list.

q_show_array()

returns internal coordinates values in Angstroms/degrees as array.

q_show_forces(forces)

Returns scaled forces as array.

ranged_frozen_intco_list(fq)

Determine vector with 1 for any ranged intco that is at its limit

show_geom()

Return a string of the geometry in [A]

split_fragments_by_connectivity()

Split any fragment not connected by bond connectivity.

test_Bmat()

Test the analytic B matrix (dq/dx) via finite differences.

test_derivative_Bmat()

Test the analytic derivative B matrix (d2q/dx2) via finite differences.

to_dict()

unfix_bend_axes()

See description in Fragment class.

update_dihedral_orientations()

See description in Fragment class.

update_dimer_intco_reference_points()

Attributes Documentation

Z
all_fragments
atom_symbols
dimer_intcos
dimer_psuedo_frags
frag_natoms
fragments
fragments_atom_list
frozen_intco_list

Determine vector with 1 for any frozen internal coordinate

geom

cartesian geometry [a0]

intco_lbls
intcos_present
masses
natom
nfragments
num_intcos
num_intrafrag_intcos

Methods Documentation

Bmat(massWeight=False)[source]
Gmat(massWeight=False)[source]

Calculates BuB^T (calculates B matrix)

Parameters

masses (List, optional) –

add_cartesian_intcos()[source]
apply_external_forces(fq, H, stepNumber)[source]
atom2frag_index(atom_index)[source]
atom_list2unique_frag_list(atomList)[source]
augment_connectivity_to_single_fragment(C)[source]
clear()[source]
closest_atoms_between_2_frags(A, B)[source]
consolidate_fragments()[source]
constraint_matrix(fq=None)[source]

Returns constraint matrix with 1 on diagonal for frozen coordinates

dimerfrag_1st_intco(iDI)[source]
dimerfrag_intco_range(iDI)[source]
dimerfrag_intco_slice(iDI)[source]
distance_matrix()[source]
fix_bend_axes()[source]

See description in Fragment class.

frag_1st_atom(iF)[source]
frag_1st_intco(iF)[source]
frag_atom_range(iF)[source]
frag_atom_slice(iF)[source]
frag_geom(iF)[source]

cartesian geometry for fragment i

frag_intco_range(iF)[source]
frag_intco_slice(iF)[source]
classmethod from_dict(d)[source]
static from_psi4(mol)[source]

Creates a optking molecular system from psi4 mol. Note that not all information is preserved. :param mol: psi4 mol :type mol: object

Returns

optking molecular system: list of fragments

Return type

cls

classmethod from_schema(qc_molecule)[source]

Creates optking molecular system from JSON input.

Parameters

qc_molecule (dict) – molecule key in MOLSSI QCSchema see http://molssi-qc-schema.readthedocs.io/en/latest/auto_topology.html

Returns

molsys cls consists of list of Frags

Return type

cls

gradient_to_cartesians(g_q)[source]

converts the gradient from internal into Cartesian coordinates

Parameters

g_q (ndarray) – internal coordinate gradient

Returns

g_x – Cartesian coordinate gradient

Return type

ndarray

gradient_to_internals(g_x, coeff=1.0, B=None, useMasses=False)[source]

Transform cartesian gradient to internals :param g_x: (3nat, 1) cartesian gradient :type g_x: np.ndarray :param coeff: prefactor coefficient; -1 for forces :type coeff: float :param B: B matrix to use :type B: np.ndarray, optional :param useMasses: instead of identity, use u = 1/masses in transformation :type useMasses: boolean

Returns

gradient in internal coordinates (coeff==1)

Return type

ndarray

Notes

g_q = (BuB^T)^(-1)*B*g_x

hessian_to_cartesians(Hint, g_q=None)[source]
hessian_to_internals(H, g_x=None, useMasses=False)[source]

converts the hessian from cartesian coordinates into internal coordinates Hq = A^t (Hxy - Kxy) A, where K_xy = sum_q ( grad_q[I] d^2(q_I)/(dx dy) and A = (BuB^t)^-1 Bu

Parameters
  • H (np.ndarray) – Hessian in cartesians

  • g_x (np.ndarray) – (nat, 3) gradient in cartesians (optional)

  • massWeight (boolean) – whether to keep arbitrary transformation matrix u=I or use 1/mass_i as in spectroscopy or cases where rotations/translations matter.

Returns

Hq – hessian in internal coordinates

Return type

np.ndarray

interfrag_dq_discontinuity_correction(dq)[source]
print_geom()[source]

Returns a string of the geometry for logging in [a0]

print_intcos()[source]
project_redundancies_and_constraints(fq, H)[source]

Project redundancies and constraints out of forces and Hessian

purge_interfragment_connectivity(C)[source]
q()[source]

Returns internal coordinate values in au as list.

q_array()[source]

Returns internal coordinate values in au as array.

q_show()[source]

returns internal coordinates values in Angstroms/degrees as list.

q_show_array()[source]

returns internal coordinates values in Angstroms/degrees as array.

q_show_forces(forces)[source]

Returns scaled forces as array.

ranged_frozen_intco_list(fq)[source]

Determine vector with 1 for any ranged intco that is at its limit

show_geom()[source]

Return a string of the geometry in [A]

split_fragments_by_connectivity()[source]

Split any fragment not connected by bond connectivity.

test_Bmat()[source]

Test the analytic B matrix (dq/dx) via finite differences. The 5-point formula should be good to DISP_SIZE^4 - a few unfortunates will be slightly worse.

Returns

passes – Returns True or False, doesn’t raise exceptions

Return type

boolean

test_derivative_Bmat()[source]

Test the analytic derivative B matrix (d2q/dx2) via finite differences. The 5-point formula should be good to DISP_SIZE^4 - a few unfortunates will be slightly worse.

Returns

passes – Returns True or False, doesn’t raise exceptions

Return type

boolean

to_dict()[source]
unfix_bend_axes()[source]

See description in Fragment class.

update_dihedral_orientations()[source]

See description in Fragment class.

update_dimer_intco_reference_points()[source]