BondCount

BondCount[mol]

gives the number of bonds in the molecule mol.

BondCount[mol,patt]

gives the number of bonds in the molecule mol matching the bond pattern patt.

Examples

Basic Examples  (2)

Count the bonds in a molecule:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Count the number of double bonds:

In[3]:=
Click for copyable input
Out[3]=

Count the number of double bonds involving oxygen:

In[4]:=
Click for copyable input
Out[4]=

Count the number of cyclic bonds involving a nitrogen atom:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
Introduced in 2019
(12.0)