B
    3RcU                 @   s:   d Z ddlZddlmZ ddlmZ ddlZdddZdS )z Python functions for manipulating molecular graphs

In theory much of the functionality in here should be migrating into the
C/C++ codebase.

    N)Chem)DataStructsc       	      C   s   |   }|dkrn|}dt| }|}t|d tj}d|d< xHtd|d D ]6}d| t| ||< ||| |  }t||}qRW |dd  d9  < |S )aN   calculates the characteristic polynomial for a molecular graph

      if mat is not passed in, the molecule's Weighted Adjacency Matrix will
      be used.

      The approach used is the Le Verrier-Faddeev-Frame method described
      in _Chemical Graph Theory, 2nd Edition_ by Nenad Trinajstic (CRC Press,
      1992), pg 76.

    Ng      ?   r   )ZGetNumAtomsnumpyZidentityZzerosfloatrangeZtracedot)	ZmolZmatZnAtomsAIZAnZresnZBn r   0lib/python3.7/site-packages/rdkit/Chem/Graphs.pyCharacteristicPolynomial   s    r   )N)__doc__r   Zrdkitr   r   typesr   r   r   r   r   <module>   s
   