rdkit.ForceField.rdForceField module — The RDKit 2025.09.6 documentation

# rdkit.ForceField.rdForceField module

Exposes the ForceField class

class rdkit.ForceField.rdForceField.ForceField

  Bases: `instance`

  A force field

  Raises an exception This class cannot be instantiated from Python

  AddDistanceConstraint((ForceField)self, (int)idx1, (int)idx2, (float)minLen, (float)maxLen, (float)forceConstant) → None :

    Adds a distance constraint to the UFF force field (deprecated, use UFFAddDistanceConstraint instead).

    C++ signature :

      void AddDistanceConstraint(ForceFields::PyForceField*,unsigned int,unsigned int,double,double,double)

  AddExtraPoint((ForceField)self, (float)x, (float)y, (float)z[, (bool)fixed=True]) → int :

    Adds an extra point, this can be useful for adding constraints.

    C++ signature :

      int AddExtraPoint(ForceFields::PyForceField {lvalue},double,double,double [,bool=True])

  AddFixedPoint((ForceField)self, (int)idx) → None :

    Adds a fixed point to the force field.

    C++ signature :

      void AddFixedPoint(ForceFields::PyForceField*,unsigned int)

  CalcEnergy((ForceField)self[, (rdkit.Chem.rdMolDescriptors.AtomPairsParameters)pos=None]) → float :

    Returns the energy (in kcal/mol) of the current arrangement or of the supplied coordinate list (if non-empty)

    C++ signature :

      double CalcEnergy(ForceFields::PyForceField {lvalue} [,boost::python::api::object=None])

  CalcGrad((ForceField)self[, (rdkit.Chem.rdMolDescriptors.AtomPairsParameters)pos=None]) → object :

    Returns a tuple filled with the per-coordinate gradients of the current arrangement or of the supplied coordinate list (if non-empty)

    C++ signature :

      _object* CalcGrad(ForceFields::PyForceField {lvalue} [,boost::python::api::object=None])

  Dimension((ForceField)self) → int :

    Returns the dimension of the ForceField

    C++ signature :

      unsigned int Dimension(ForceFields::PyForceField {lvalue})

  GetExtraPointPos((ForceField)self, (int)idx) → object :

    returns the location of an extra point as a tuple

    C++ signature :

      _object* GetExtraPointPos(ForceFields::PyForceField*,unsigned int)

  Initialize((ForceField)self) → None :

    initializes the force field (call this before minimizing)

    C++ signature :

      void Initialize(ForceFields::PyForceField {lvalue})

  MMFFAddAngleConstraint((ForceField)self, (int)idx1, (int)idx2, (int)idx3, (bool)relative, (float)minAngleDeg, (float)maxAngleDeg, (float)forceConstant) → None :

    Adds an angle constraint to the MMFF force field; if relative == True, then minAngleDeg and maxAngleDeg are intended as relative to the current angle.

    C++ signature :

      void MMFFAddAngleConstraint(ForceFields::PyForceField*,unsigned int,unsigned int,unsigned int,bool,double,double,double)

  MMFFAddDistanceConstraint((ForceField)self, (int)idx1, (int)idx2, (bool)relative, (float)minLen, (float)maxLen, (float)forceConstant) → None :

    Adds a distance constraint to the MMFF force field; if relative == True, then minLen and maxLen are intended as relative to the current distance.

    C++ signature :

      void MMFFAddDistanceConstraint(ForceFields::PyForceField*,unsigned int,unsigned int,bool,double,double,double)

  MMFFAddPositionConstraint((ForceField)self, (int)idx, (float)maxDispl, (float)forceConstant) → None :

    Adds a position constraint to the MMFF force field.

    C++ signature :

      void MMFFAddPositionConstraint(ForceFields::PyForceField*,unsigned int,double,double)

  MMFFAddTorsionConstraint((ForceField)self, (int)idx1, (int)idx2, (int)idx3, (int)idx4, (bool)relative, (float)minDihedralDeg, (float)maxDihedralDeg, (float)forceConstant) → None :

    Adds a dihedral angle constraint to the MMFF force field; if relative == True, then minDihedralDeg and maxDihedralDeg are intended as relative to the current dihedral angle.

    C++ signature :

      void MMFFAddTorsionConstraint(ForceFields::PyForceField*,unsigned int,unsigned int,unsigned int,unsigned int,bool,double,double,double)

  Minimize((ForceField)self[, (int)maxIts=200[, (float)forceTol=0.0001[, (float)energyTol=1e-06]]]) → int :

    Runs some minimization iterations.

    > Returns 0 if the minimization succeeded.

    C++ signature :

      int Minimize(ForceFields::PyForceField {lvalue} [,int=200 [,double=0.0001 [,double=1e-06]]])

  MinimizeTrajectory((ForceField)self, (int)snapshotFreq[, (int)maxIts=200[, (float)forceTol=0.0001[, (float)energyTol=1e-06]]]) → tuple :

    Runs some minimization iterations, recording the minimization trajectory every snapshotFreq steps.

    Returns a (int, []) tuple; the int is 0 if the minimization succeeded, while the list contains Snapshot objects.

    C++ signature :

      boost::python::tuple MinimizeTrajectory(ForceFields::PyForceField {lvalue},unsigned int [,int=200 [,double=0.0001 [,double=1e-06]]])

  NumPoints((ForceField)self) → int :

    Returns the number of points the ForceField is handling

    C++ signature :

      unsigned int NumPoints(ForceFields::PyForceField {lvalue})

  Positions((ForceField)self) → object :

    Returns a tuple filled with the coordinates of the points the ForceField is handling

    C++ signature :

      _object* Positions(ForceFields::PyForceField {lvalue})

  UFFAddAngleConstraint((ForceField)self, (int)idx1, (int)idx2, (int)idx3, (bool)relative, (float)minAngleDeg, (float)maxAngleDeg, (float)forceConstant) → None :

    Adds an angle constraint to the UFF force field; if relative == True, then minAngleDeg and maxAngleDeg are intended as relative to the current angle.

    C++ signature :

      void UFFAddAngleConstraint(ForceFields::PyForceField*,unsigned int,unsigned int,unsigned int,bool,double,double,double)

  UFFAddDistanceConstraint((ForceField)self, (int)idx1, (int)idx2, (bool)relative, (float)minLen, (float)maxLen, (float)forceConstant) → None :

    Adds a distance constraint to the UFF force field; if relative == True, then minLen and maxLen are intended as relative to the current distance.

    C++ signature :

      void UFFAddDistanceConstraint(ForceFields::PyForceField*,unsigned int,unsigned int,bool,double,double,double)

  UFFAddPositionConstraint((ForceField)self, (int)idx, (float)maxDispl, (float)forceConstant) → None :

    Adds a position constraint to the UFF force field.

    C++ signature :

      void UFFAddPositionConstraint(ForceFields::PyForceField*,unsigned int,double,double)

  UFFAddTorsionConstraint((ForceField)self, (int)idx1, (int)idx2, (int)idx3, (int)idx4, (bool)relative, (float)minDihedralDeg, (float)maxDihedralDeg, (float)forceConstant) → None :

    Adds a dihedral angle constraint to the UFF force field; if relative == True, then minDihedralDeg and maxDihedralDeg are intended as relative to the current dihedral angle.

    C++ signature :

      void UFFAddTorsionConstraint(ForceFields::PyForceField*,unsigned int,unsigned int,unsigned int,unsigned int,bool,double,double,double)

class rdkit.ForceField.rdForceField.MMFFMolProperties

  Bases: `instance`

  MMFF molecular properties

  Raises an exception This class cannot be instantiated from Python

  GetMMFFAngleBendParams((MMFFMolProperties)self, (rdkit.Chem.rdchem.Mol)mol, (int)idx1, (int)idx2, (int)idx3) → object :

    Retrieves MMFF angle bend parameters for atoms with indexes idx1, idx2, idx3 as a (angleType, ka, theta0) tuple, or None if no parameters could be found

    C++ signature :

      _object* GetMMFFAngleBendParams(ForceFields::PyMMFFMolProperties {lvalue},RDKit::ROMol,unsigned int,unsigned int,unsigned int)

  GetMMFFAtomType((MMFFMolProperties)self, (int)idx) → int :

    Retrieves MMFF atom type for atom with index idx

    C++ signature :

      unsigned int GetMMFFAtomType(ForceFields::PyMMFFMolProperties {lvalue},unsigned int)

  GetMMFFBondStretchParams((MMFFMolProperties)self, (rdkit.Chem.rdchem.Mol)mol, (int)idx1, (int)idx2) → object :

    Retrieves MMFF bond stretch parameters for atoms with indexes idx1, idx2 as a (bondType, kb, r0) tuple, or None if no parameters could be found

    C++ signature :

      _object* GetMMFFBondStretchParams(ForceFields::PyMMFFMolProperties {lvalue},RDKit::ROMol,unsigned int,unsigned int)

  GetMMFFFormalCharge((MMFFMolProperties)self, (int)idx) → float :

    Retrieves MMFF formal charge for atom with index idx

    C++ signature :

      double GetMMFFFormalCharge(ForceFields::PyMMFFMolProperties {lvalue},unsigned int)

  GetMMFFOopBendParams((MMFFMolProperties)self, (rdkit.Chem.rdchem.Mol)mol, (int)idx1, (int)idx2, (int)idx3, (int)idx4) → object :

    Retrieves MMFF out-of-plane bending force constant for atoms with indexes idx1, idx2, idx3, idx4 as a koop float value

    C++ signature :

      _object* GetMMFFOopBendParams(ForceFields::PyMMFFMolProperties {lvalue},RDKit::ROMol,unsigned int,unsigned int,unsigned int,unsigned int)

  GetMMFFPartialCharge((MMFFMolProperties)self, (int)idx) → float :

    Retrieves MMFF partial charge for atom with index idx

    C++ signature :

      double GetMMFFPartialCharge(ForceFields::PyMMFFMolProperties {lvalue},unsigned int)

  GetMMFFStretchBendParams((MMFFMolProperties)self, (rdkit.Chem.rdchem.Mol)mol, (int)idx1, (int)idx2, (int)idx3) → object :

    Retrieves MMFF stretch-bend parameters for atoms with indexes idx1, idx2, idx3 as a (stretchBendType, kbaIJK, kbaKJI) tuple, or None if no parameters could be found

    C++ signature :

      _object* GetMMFFStretchBendParams(ForceFields::PyMMFFMolProperties {lvalue},RDKit::ROMol,unsigned int,unsigned int,unsigned int)

  GetMMFFTorsionParams((MMFFMolProperties)self, (rdkit.Chem.rdchem.Mol)mol, (int)idx1, (int)idx2, (int)idx3, (int)idx4) → object :

    Retrieves MMFF torsion parameters for atoms with indexes idx1, idx2, idx3, idx4 as a (torsionType, V1, V2, V3) tuple, or None if no parameters could be found

    C++ signature :

      _object* GetMMFFTorsionParams(ForceFields::PyMMFFMolProperties {lvalue},RDKit::ROMol,unsigned int,unsigned int,unsigned int,unsigned int)

  GetMMFFVdWParams((MMFFMolProperties)self, (int)idx1, (int)idx2) → object :

    Retrieves MMFF van der Waals parameters for atoms with indexes idx1, idx2 as a (R_ij_starUnscaled, epsilonUnscaled, R_ij_star, epsilon) tuple, or None if no parameters could be found

    C++ signature :

      _object* GetMMFFVdWParams(ForceFields::PyMMFFMolProperties {lvalue},unsigned int,unsigned int)

  SetMMFFAngleTerm((MMFFMolProperties)self[, (bool)state=True]) → None :

    Sets the angle term to be included in the MMFF equation (defaults to True)

    C++ signature :

      void SetMMFFAngleTerm(ForceFields::PyMMFFMolProperties {lvalue} [,bool=True])

  SetMMFFBondTerm((MMFFMolProperties)self[, (bool)state=True]) → None :

    Sets the bond term to be included in the MMFF equation (defaults to True)

    C++ signature :

      void SetMMFFBondTerm(ForceFields::PyMMFFMolProperties {lvalue} [,bool=True])

  SetMMFFDielectricConstant((MMFFMolProperties)self[, (float)dielConst=1.0]) → None :

    Sets the DielConst MMFF property (defaults to 1.0)

    C++ signature :

      void SetMMFFDielectricConstant(ForceFields::PyMMFFMolProperties {lvalue} [,double=1.0])

  SetMMFFDielectricModel((MMFFMolProperties)self[, (int)dielModel=1]) → None :

    Sets the DielModel MMFF property (1: constant; 2: distance-dependent; defaults to constant)

    C++ signature :

      void SetMMFFDielectricModel(ForceFields::PyMMFFMolProperties {lvalue} [,unsigned char=1])

  SetMMFFEleTerm((MMFFMolProperties)self[, (bool)state=True]) → None :

    Sets the electrostatic term to be included in the MMFF equation (defaults to True)

    C++ signature :

      void SetMMFFEleTerm(ForceFields::PyMMFFMolProperties {lvalue} [,bool=True])

  SetMMFFOopTerm((MMFFMolProperties)self[, (bool)state=True]) → None :

    Sets the out-of-plane bend term to be included in the MMFF equation (defaults to True)

    C++ signature :

      void SetMMFFOopTerm(ForceFields::PyMMFFMolProperties {lvalue} [,bool=True])

  SetMMFFStretchBendTerm((MMFFMolProperties)self[, (bool)state=True]) → None :

    Sets the stretch-bend term to be included in the MMFF equation (defaults to True)

    C++ signature :

      void SetMMFFStretchBendTerm(ForceFields::PyMMFFMolProperties {lvalue} [,bool=True])

  SetMMFFTorsionTerm((MMFFMolProperties)self[, (bool)state=True]) → None :

    Sets the torsional term to be included in the MMFF equation (defaults to True)

    C++ signature :

      void SetMMFFTorsionTerm(ForceFields::PyMMFFMolProperties {lvalue} [,bool=True])

  SetMMFFVariant((MMFFMolProperties)self[, (str)mmffVariant='MMFF94']) → None :

    Sets the MMFF variant to be used (“MMFF94” or “MMFF94s”; defaults to “MMFF94”)

    C++ signature :

      void SetMMFFVariant(ForceFields::PyMMFFMolProperties {lvalue} [,std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >=’MMFF94’])

  SetMMFFVdWTerm((MMFFMolProperties)self[, (bool)state=True]) → None :

    Sets the Van der Waals term to be included in the MMFF equation (defaults to True)

    C++ signature :

      void SetMMFFVdWTerm(ForceFields::PyMMFFMolProperties {lvalue} [,bool=True])

  SetMMFFVerbosity((MMFFMolProperties)self[, (int)verbosity=0]) → None :

    Sets the MMFF verbosity (0: none; 1: low; 2: high; defaults to 0)

    C++ signature :

      void SetMMFFVerbosity(ForceFields::PyMMFFMolProperties {lvalue} [,unsigned int=0])