bag of bonds
**Bag of Bonds** is a molecular descriptor for machine learning that extends the Coulomb matrix representation by decomposing it into groups of pairwise atomic interactions (bonds), sorted within each group, and concatenated into a fixed-length feature vector. By grouping interactions by atom-pair type (C-C, C-H, C-N, C-O, etc.) and sorting within groups, Bag of Bonds achieves permutation invariance while retaining more structural information than the sorted Coulomb matrix eigenspectrum.
**Why Bag of Bonds Matters in AI/ML:**
Bag of Bonds provides a **simple yet effective molecular representation** for predicting quantum chemical properties (atomization energies, HOMO-LUMO gaps, dipole moments) that respects permutation invariance while encoding pairwise atomic interaction information, serving as an important baseline in molecular ML.
• **Construction** — From the Coulomb matrix C (where C_ij = Z_i·Z_j/|R_i-R_j| for i≠j and C_ii = 0.5·Z_i^2.4), extract all pairwise elements, group by atom-pair type (e.g., all C-C interactions, all C-H interactions), sort each group in descending order, and pad to fixed length
• **Permutation invariance** — Sorting within each atom-type group ensures that the representation is invariant to the ordering of atoms of the same element; grouping by type prevents mixing of chemically distinct interactions (unlike eigenvalue-based approaches)
• **Fixed-length output** — Each atom-pair type group is padded to accommodate the maximum number of such pairs in the dataset, producing a fixed-length feature vector suitable for standard ML models (kernel ridge regression, random forests, neural networks)
• **Information retention** — Unlike the Coulomb matrix eigenspectrum (which loses off-diagonal structure), Bag of Bonds retains individual pairwise interaction values, preserving more geometric and chemical information for property prediction
• **Comparison to modern methods** — While superseded by GNNs and equivariant networks for most tasks, Bag of Bonds remains competitive for small datasets and provides an interpretable baseline that directly encodes physical atomic interactions
| Representation | Permutation Invariant | Structure Info | Dimensionality | Typical MAE (QM9) |
|---------------|----------------------|---------------|---------------|-------------------|
| Coulomb Matrix (sorted eigenvalues) | Yes | Low (eigenspectrum) | N_atoms | ~10 kcal/mol |
| Bag of Bonds | Yes | Medium (pairwise) | Σ n_pairs | ~3-5 kcal/mol |
| FCHL | Yes | High (3-body) | Higher | ~1-2 kcal/mol |
| SOAP | Yes | High (density-based) | Higher | ~1-2 kcal/mol |
| SchNet (GNN) | Yes | High (learned) | Learned | ~0.5-1 kcal/mol |
| PaiNN (equivariant) | Yes | Very high (equivariant) | Learned | ~0.3-0.5 kcal/mol |
**Bag of Bonds is the foundational molecular descriptor that introduced the principle of grouping atomic interactions by type for permutation-invariant molecular representation, providing a simple, interpretable, and physically motivated feature encoding that bridges raw Coulomb matrix representations and modern learned molecular embeddings in the molecular ML toolkit.**