DimerFrag
- class optking.dimerfrag.DimerFrag(A_idx, A_atoms, B_idx, B_atoms, A_weights=None, B_weights=None, A_lbl='A', B_lbl='B', frozen=None)[source]
Bases:
object
Set of (up to 6) coordinates between two distinct fragments. The fragments ‘A’ and ‘B’ have up to 3 reference atoms each (dA[3] and dB[3]). The reference atoms are defined in one of two ways: 1. If interfrag_mode == FIXED, then fixed, linear combinations of atoms
in A and B are used.
(NOT YET IMPLEMENTED) If interfrag_mode == PRINCIPAL_AXES, then the references points are
the center of mass
a point a unit distance along the principal axis corresponding to the largest moment.
a point a unit distance along the principal axis corresponding to the 2nd largest moment.
# For simplicity, we sort the atoms in the reference point structure according to the assumed connectivity of the coordinates. ref_geom[0] = dA[2]; ref_geom[1] = dA[1]; ref_geom[2] = dA[0]; ref_geom[3] = dB[0]; ref_geom[4] = dB[1]; ref_geom[5] = dB[2]; # The six coordinates, if present, formed from the d{A-B}{0-2} sets are assumed to be the following in this canonical order: pos sym type atom-definition present, if ——————————————————————————— 0 RAB distance dA[0]-dB[0] always 1 theta_A angle dA[1]-dA[0]-dB[0] A has > 1 atom 2 theta_B angle dA[0]-dB[0]-dB[1] B has > 1 atom 3 tau dihedral dA[1]-dA[0]-dB[0]-dB[1] A and B have > 1 atom 4 phi_A dihedral dA[2]-dA[1]-dA[0]-dB[0] A has > 2 atoms and is not linear 5 phi_B dihedral dA[0]-dB[0]-dB[1]-dB[2] B has > 2 atoms and is not linear # :param A_idx: index of fragment in molecule list :type A_idx: int :param A_atoms: index of atoms used to define each reference point on A :type A_atoms: list of (up to 3) lists of ints :param B_idx: index of fragment in molecule list :type B_idx: int :param B_atoms: index of atoms used to define each reference point on B :type B_atoms: list of (up to 3) lists of ints :param A_weights (optional): weights of atoms used to define each reference point of A :type A_weights (optional): list of (up to 3) lists of floats :param B_weights (optional): weights of atoms used to define each reference point of B :type B_weights (optional): list of (up to 3) lists of floats :param A_lbl: name for fragment A :type A_lbl: string :param B_lbl: name for fragment B :type B_lbl: string :param The arguments are potentially confusing: :param so we’ll do a lot of checking.:
Attributes Summary
Methods Summary
Bmat
(A_geom, B_geom, Bmat_in[, A_xyz_off, ...])This function adds interfragment rows into an existing B matrix.
d_on
(i)freeze
([coords_to_freeze])fromUserDict
(userDict)from_dict
(D)label2index
(label_in)orient_fragment
(Ageom_in, Bgeom_in, q_target_in)orient_fragment() moves the geometry of fragment B so that the
q
()q_array
()q_show
()set_ref_geom
(ArefGeom, BrefGeom)test_B
(Axyz, Bxyz[, printInfo])to_dict
()update_reference_geometry
(Ageom, Bgeom)validate_intcos
(Ageom_in, Bgeom_in)Attributes Documentation
- A_idx
- B_idx
- frozen_list
- n_arefs
- n_brefs
- num_intcos
- pseudo_frag
Methods Documentation
- Bmat(A_geom, B_geom, Bmat_in, A_xyz_off=None, B_xyz_off=None)[source]
- This function adds interfragment rows into an existing B matrix.
B is (internals, Cartesians). Often, 6 x 3*(Natoms).
- Parameters
A_geom (numpy array) – geometry of fragment A, array is (A atoms,3)
B_geom (numpy array that is (B atoms,3)) – geometry of fragment B, array is (B atoms,3)
Bmat_int (numpy array) – provided B matrix
intco_off (int) – index of first row of Bmatrix to start writing the interfragment rows.
A_off (int) – Column of B matrix at which the cartesian coordinates of atoms in fragment A begin. Needed since columns may span full molecular system.
B_off (int) – Column of B matrix at which the cartesian coordinates of atoms in fragment B begin.
given (If A_off and B_off are not) –
returned. (then the minimal (dimer-only) B-matrix is) –
- orient_fragment(Ageom_in, Bgeom_in, q_target_in, printCoords=False, unit_length='bohr', unit_angle='rad')[source]
- orient_fragment() moves the geometry of fragment B so that the
interfragment coordinates have the given values
- Parameters
Ageom_in (array) – Cartesian geometry of fragment A
Bgeom_in (array) – Cartesian geometry of fragment B
q_target (array float[6]) – Target values of 6 interfragment coordinates after moving fragment B
printCoords (boolean) – whether to print the starting and final values of the q’s
unit_length (string ; default 'bohr') – indicate unit of length, q[0]
unit_angle (string ; default 'rad') – indicate unit of angles, q[1-5]
------------ –
- Returns
new Cartesian geometry for B
- Return type
array