metafalcon.cvs package¶
Submodules¶
metafalcon.cvs.angle module¶
Contains a class for using the angle between three atoms as a CV.
-
class
metafalcon.cvs.angle.
cv_angle
(idx, symbols, **kwargs)[source]¶ Bases:
metafalcon.cvs.cv.cv
Angle between three atoms as collective variable, inherits from metafalcon.cvs.cv.cv.
Parameters: - idx (int) – index of collective variable in the input file
- symbols (list of str) – atomic symbols of the molecule
- **kwargs – See below
Keyword Arguments: atoms (list of int) – list of three atom indices for the calculation of the angle
metafalcon.cvs.balaban module¶
Contains a class for using the 3D Balaban index as a CV.
-
class
metafalcon.cvs.balaban.
cv_balaban
(idx, symbols, **kwargs)[source]¶ Bases:
metafalcon.cvs.cv.cv
Balaban index as collective variable, inherits from metafalcon.cvs.cv.cv.
Parameters: - idx (int) – index of collective variable in the input file
- symbols (list of str) – atomic symbols of the molecule
- **kwargs – See below
Keyword Arguments: -
get_adjacencymatrix
(coords)[source]¶ Calculate the adjacency matrix for the given coordinates.
Parameters: coords (np.2darray (shape: (N, 3))) – atomic xyz-coordinates of the molecule (bohr) Returns: am – adjacency matrix Return type: np.2darray (shape: (N, N))
-
get_edges
(am)[source]¶ Return edges from the adjacency matrix.
Parameters: am (np.2darray (shape: (N, N))) – adjacency matrix Returns: edges – pairs of connected atoms Return type: np.2darray (shape: (Nedges, 2))
-
get_distancematrix
(coords)[source]¶ Return the geometrical distance matrix.
Parameters: coords (np.2darray (shape: (N, 3))) – atomic xyz-coordinates of the molecule (bohr) Returns: dm – geometrical distance matrix Return type: np.2darray (shape: (N, N))
-
get_ddistancematrix
(coords)[source]¶ Return the gradient of the geometrical distance matrix.
Parameters: coords (np.2darray (shape: (N, 3))) – atomic xyz-coordinates of the molecule (bohr) Returns: ddm – gradient of the geometrical distance matrix Return type: np.2darray (shape: (N, N, N, 3))
-
get_balaban
(dm, edges)[source]¶ Return Balaban index.
Parameters: - dm (np.2darray (shape: (N, N))) – geometrical distance matrix
- edges (np.2darray (shape: (Nedges, 2))) – pairs of connected atoms
Returns: balaban – 3D Balaban index
Return type:
-
get_dbalaban
(dm, ddm, edges)[source]¶ Return the gradient of the Balaban index.
Parameters: - dm (np.2darray (shape: (N, N))) – geometrical distance matrix
- ddm (np.2darray (shape: (N, N, N, 3))) – gradient of the geometrical distance matrix
- edges (np.2darray (shape: (Nedges, 2))) – pairs of connected atoms
Returns: dbalaban – gradient of the 3D Balaban index
Return type: np.2darray (shape: (N, 3))
metafalcon.cvs.bond module¶
Contains a class for using the bond length between two atoms as a CV.
-
class
metafalcon.cvs.bond.
cv_bond
(idx, symbols, **kwargs)[source]¶ Bases:
metafalcon.cvs.cv.cv
Bond length between two atoms as collective variable, inherits from metafalcon.cvs.cv.cv.
Parameters: - idx (int) – index of collective variable in the input file
- symbols (list of str) – atomic symbols of the molecule
- **kwargs – See below
Keyword Arguments: atoms (list of int) – list of two atom indices for the calculation of the bond length
metafalcon.cvs.cn module¶
Contains a class for using the coordination number of an atom as a CV.
-
class
metafalcon.cvs.cn.
cv_cn
(idx, symbols, **kwargs)[source]¶ Bases:
metafalcon.cvs.cv.cv
Coordination number as a collective variable, inherits from metafalcon.cvs.cv.cv.
Parameters: - idx (int) – index of collective variable in the input file
- symbols (list of str) – atomic symbols of the molecule
- **kwargs – See below
Keyword Arguments: - atom (int) – atom index for the calculation of the coordination number
- reference (list of int) – indices of reference atoms to be included (default: all atoms other than atom)
- n (int) – first exponent
- m (int) – second exponent
- d ("auto" or float or list of float) – single distance or list of distances for all atoms in reference (default: ‘auto’)
metafalcon.cvs.cremerpople module¶
Functions for the calculation of Cremer-Pople parameters and their gradients.
@author: Karina Sultangaleeva
metafalcon.cvs.cremerpople_phi module¶
Contains a class for using Cremer Pople angle phi as a CV.
-
class
metafalcon.cvs.cremerpople_phi.
cv_cremerpople_phi
(idx, symbols, **kwargs)[source]¶ Bases:
metafalcon.cvs.cv.cv
Cremer-Pople angle phi as collective variable, inherits from metafalcon.cvs.cv.cv.
Parameters: - idx (int) – index of collective variable in the input file
- symbols (list of str) – atomic symbols of the molecule
- **kwargs – See below
Keyword Arguments: atoms (list of int) – list of ring atoms to be used for the Cremer-Pople calculation in correct ordering
metafalcon.cvs.cremerpople_q module¶
Contains a class for using Cremer Pople total amplitude Q as a CV.
-
class
metafalcon.cvs.cremerpople_q.
cv_cremerpople_q
(idx, symbols, **kwargs)[source]¶ Bases:
metafalcon.cvs.cv.cv
Cremer-Pople total ampltiude Q as collective variable, inherits from metafalcon.cvs.cv.cv.
Parameters: - idx (int) – index of collective variable in the input file
- symbols (list of str) – atomic symbols of the molecule
- **kwargs – See below
Keyword Arguments: atoms (list of int) – list of ring atoms to be used for the Cremer-Pople calculation in correct ordering
metafalcon.cvs.cremerpople_theta module¶
Contains a class for using Cremer Pople angle theta as a CV.
-
class
metafalcon.cvs.cremerpople_theta.
cv_cremerpople_theta
(idx, symbols, **kwargs)[source]¶ Bases:
metafalcon.cvs.cv.cv
Cremer-Pople angle theta as collective variable, inherits from metafalcon.cvs.cv.cv.
Parameters: - idx (int) – index of collective variable in the input file
- symbols (list of str) – atomic symbols of the molecule
- **kwargs – See below
Keyword Arguments: atoms (list of int) – list of ring atoms to be used for the Cremer-Pople calculation in correct ordering
metafalcon.cvs.custom module¶
Contains a class for embedding own CV implementations.
-
class
metafalcon.cvs.custom.
cv_custom
(idx, symbols, **kwargs)[source]¶ Bases:
metafalcon.cvs.cv.cv
User-defined collective variable, inherits from metafalcon.cvs.cv.cv.
Parameters: - idx (int) – index of collective variable in the input file
- symbols (list of str) – atomic symbols of the molecule
- **kwargs – See below
Keyword Arguments:
metafalcon.cvs.cv module¶
Contains a general collective variable class that is inherited by individual CVs.
-
class
metafalcon.cvs.cv.
cv
(idx, symbols, **kwargs)[source]¶ Collective variable class.
Parameters: - idx (int) – index of the cv, used for filename-numbering
- symbols (list of str) – atomic symbols of the molecule
- kwargs – See below
Keyword Arguments: - name (str) – name of the collective variable
- type (str) – type of the collective variable
- width (float) – width of the added Gaussians
- active (bool) – whether CV is used for metadynamics
- thresh (bool) – whether to use threshold to switch off / on the addition of Gaussians
- thresh_type (str) – type of threshold to be used (upper | lower)
- thresh_value (float) – value of the CV to switch off / on the addition of Gaussians
- periodic (bool) – whether to use periodic boundaries for the CV
- periodic_type (str) – type of periodic boundaries for the CV (mirror | continue)
- periodic_start (float) – start value of the periodic range
- periodic_end (float) – end value of the periodic range
Variables: - idx –
- symbols –
- kwargs –
- tmp –
- name –
- type –
- width –
- active –
- thresh –
- thresh_type –
- thresh_value –
- update –
- use_wall –
- s –
- ds_dr –
- step –
- shift –
- ticks –
- periodic –
- periodic_type –
- periodic_start –
- periodic_end –
- au2unit –
metafalcon.cvs.cv_template module¶
Contains a class for using TEMPLATE as a CV.
-
class
metafalcon.cvs.cv_template.
cv_template
(idx, symbols, **kwargs)[source]¶ Bases:
metafalcon.cvs.cv.cv
TEMPLATE as collective variable, inherits from metafalcon.cvs.cv.cv.
Parameters: - idx (int) – index of collective variable in the input file
- symbols (list of str) – atomic symbols of the molecule
- **kwargs – See below
Keyword Arguments: arg (int) – argument corresponding to TEMPLATE CV
metafalcon.cvs.cvfunctions module¶
Contains useful functions for the determination of CV values and gradients.
-
metafalcon.cvs.cvfunctions.
dtorsion
(coord)[source]¶ Implementation according to van Schalk et al, J. Mol. Biol. 234, 751 / https://salilab.org/modeller/9v6/manual/node436.html
metafalcon.cvs.energygap module¶
Contains a class for using the energy gap between two electronic states as a CV.
-
class
metafalcon.cvs.energygap.
cv_energygap
(idx, symbols, **kwargs)[source]¶ Bases:
metafalcon.cvs.cv.cv
Energy gap between two states as collective variable, inherits from metafalcon.cvs.cv.cv.
Parameters: - idx (int) – index of collective variable in the input file
- symbols (list of str) – atomic symbols of the molecule
- **kwargs – See below
Keyword Arguments:
metafalcon.cvs.firsteigenvalue module¶
Contains a class for using the lowest eigenvalue of the geometric distance matrix as a CV.
-
class
metafalcon.cvs.firsteigenvalue.
cv_firsteigenvalue
(idx, symbols, **kwargs)[source]¶ Bases:
metafalcon.cvs.cv.cv
Lowest eigenvalue of the distance matrix as CV, inherits from metafalcon.cvs.cv.cv.
Parameters: - idx (int) – index of collective variable in the input file
- symbols (list of str) – atomic symbols of the molecule
- **kwargs – See below
Keyword Arguments: exclude_h (bool) – do not include distances to hydrogen atoms (default: False)
-
get_distancematrix
(coords)[source]¶ Return the geometrical distance matrix.
Parameters: coords (np.2darray (shape: (N, 3))) – atomic xyz-coordinates of the molecule (bohr) Returns: dm – geometrical distance matrix Return type: np.2darray (shape: (N, N))
-
get_derivative_eigenvalue
(e, v, k)[source]¶ Return the derivative of the k-th eigenvalue with respect to distance matrix.
Parameters: - e (np.array) – eigenvalues (shape: (N))
- v (np.2darray) – eigenvectors (shape: (N, N))
- k (int) – index of the eigenvalue to by differentiated
Returns: de_dd – derivative of eigenvalue k wrt distance matrix (shape: (N, N))
Return type: np.2darray
metafalcon.cvs.mullcharge module¶
Contains a class for using the Mulliken charge as a CV.
-
class
metafalcon.cvs.mullcharge.
cv_mullcharge
(idx, symbols, **kwargs)[source]¶ Bases:
metafalcon.cvs.cv.cv
Mulliken charge as collective variable, inherits from metafalcon.cvs.cv.cv.
Parameters: - idx (int) – index of collective variable in the input file
- symbols (list of str) – atomic symbols of the molecule
- **kwargs – See below
Keyword Arguments:
metafalcon.cvs.mulliken module¶
Contains a class for calculation of Mulliken charges from Turbomole oder DFTBaby outputs.
-
metafalcon.cvs.mulliken.
get_charges
(symbols=None)[source]¶ Calculate Mulliken charges from Turbomole ridft calculations.
Files mos (alpha, beta) and tm.out are needed in the execution directory. Please include the keyword “$intsdebug cao” in the control file to print out the overlap matrix. “$scfconv” should be increased to raise the accuracy of MO coefficients. With the default $scfconv=6, charges can be obtained much faster directly from Turbomole in similar accuracy.
Parameters: symbols (list of strings (optional)) – if symbols are not passed, they are extracted from the coord file Returns: charges – Mulliken charges, shape (nat) Return type: numpy array Note
This program does not work with Turbomole 6.4, because the overlap matrix is not printed.
metafalcon.cvs.noon module¶
Contains a class for using a Natural Orbital Occupation Number (NOON) as a CV.
-
class
metafalcon.cvs.noon.
cv_noon
(idx, symbols, **kwargs)[source]¶ Bases:
metafalcon.cvs.cv.cv
NOON as collective variable, inherits from metafalcon.cvs.cv.cv.
Parameters: - idx (int) – index of collective variable in the input file
- symbols (list of str) – atomic symbols of the molecule
- **kwargs – See below
Keyword Arguments: - no_index (int) – index of natural orbital (sorted by rising occupation number (0 = lowest occupation)
- nstates (int) – number of electronic states -(default: 1)
- state (int) – electronic state index (default: 0)
- nproc (int) – number of parallel processes for the calculation of numerical derivatives (default: 1)
- iface (str) – interface to QC code
metafalcon.cvs.noongap module¶
Contains a class for using the energy gap between two electronic states as a CV.
-
class
metafalcon.cvs.noongap.
cv_noongap
(idx, symbols, **kwargs)[source]¶ Bases:
metafalcon.cvs.cv.cv
NOON gap as collective variable, inherits from metafalcon.cvs.cv.cv.
Parameters: - idx (int) – index of collective variable in the input file
- symbols (list of str) – atomic symbols of the molecule
- **kwargs – See below
Keyword Arguments: - no_index1 (int) – index of first NOON (close to 0)
- no_index2 (int) – index of second NOON (close to 2)
- nstates (int) – number of electronic states -(default: 1)
- state (int) – electronic state index (default: 0)
- nproc (int) – number of parallel processes for the calculation of numerical derivatives (default: 1)
- do_multistate (bool) – whether to use this CV for multistate metadynamics (default: False)
metafalcon.cvs.shortestbond module¶
Contains a class for using the shortest bond length to a group of atoms as a CV.
-
class
metafalcon.cvs.shortestbond.
cv_shortestbond
(idx, symbols, **kwargs)[source]¶ Bases:
metafalcon.cvs.cv.cv
Shortest bond length between pairs of atoms as collective variable, inherits from metafalcon.cvs.cv.cv.
Parameters: - idx (int) – index of collective variable in the input file
- symbols (list of str) – atomic symbols of the molecule
- **kwargs – See below
Keyword Arguments: - atom1 (int) – fixed atom index for the calculation of the bond length
- atom2 (list of int) – list of atom indices to be used as second atoms for the calculation of the bond length
metafalcon.cvs.torsion module¶
Contains a class for using the torsion angle between four atoms as a CV.
-
class
metafalcon.cvs.torsion.
cv_torsion
(idx, symbols, **kwargs)[source]¶ Bases:
metafalcon.cvs.cv.cv
Torsion angle between four atoms as collective variable, inherits from metafalcon.cvs.cv.cv.
Parameters: - idx (int) – index of collective variable in the input file
- symbols (list of str) – atomic symbols of the molecule
- **kwargs – See below
Keyword Arguments: atoms (list of int) – list of four atom indices for the calculation of the torsion angle
metafalcon.cvs.types module¶
Definition of CV types. For the registration of a new CV, import it and append it to the dict.
metafalcon.cvs.wiener module¶
Contains a class for using the 3D Wiener number as a CV.
-
class
metafalcon.cvs.wiener.
cv_wiener
(idx, symbols, **kwargs)[source]¶ Bases:
metafalcon.cvs.cv.cv
3D Wiener number as collective variable, inherits from metafalcon.cvs.cv.cv.
Parameters: - idx (int) – index of collective variable in the input file
- symbols (list of str) – atomic symbols of the molecule
- **kwargs – See below
Keyword Arguments: exclude_h (bool) – do not include distances to hydrogen atoms (default: False)
-
metafalcon.cvs.wiener.
get_wiener
(symbols, coords, exclude_h=True)[source]¶ Return Wiener number.
Parameters: - coords (np.2darray) – cartesian coordinates of the molecule (shape: (N, 3))
- exclude_h (bool) – do not include distances to hydrogen atoms (default: False)
Returns: wiener – Wiener number
Return type:
Module contents¶
Subpackage of metafalcon that contains a number of CVs to be used in metadynamics simulations.