petitjean_index#

skfp.descriptors.petitjean_index(mol: Mol, distance_matrix: ndarray | None = None) float#

Petitjean Index.

Calculates the Petitjean Index [1], defined as a measure of molecular shape based on graph topology. It is derived from two fundamental properties of molecular graphs: radius (R) and diameter (D). The formula for calculating the Petitjean Index is given as:

\[I_2 = \frac{D - R}{R}\]

where:

  • :math:D is the graph diameter

  • :math:R is the graph radius

Parameters:
  • mol (RDKit Mol object) – The molecule for which the Petitjean index is to be calculated.

  • distance_matrix (np.ndarray, optional) – Precomputed distance matrix. If not provided, it will be calculated.

References

Examples

>>> from rdkit.Chem import MolFromSmiles
>>> from skfp.descriptors import petitjean_index
>>> mol = MolFromSmiles("C1=CC=CC=C1")  # Benzene
>>> petitjean_index(mol)
0.0