MoleculeEquivalentQ
Details
- Two molecules are by default considered equivalent if there is a reordering of atom and bond lists that makes them the same, including any defined stereochemistry.
- Atoms are considered equal if their atomic number, charge and mass number are the same. Bonds are considered equal if they have the same bond order.
- For the purpose of equivalence testing, implicit and explicit hydrogen atoms are treated the same.
- MoleculeEquivalentQ[mol1,mol2,…] gives True if all of the moli are equivalent.
Examples
Basic Examples (4)
Methane and the ammonium ion have identical connectivity but different atoms, so they are not equivalent:
mol1 = Molecule["methane"]mol2 = Molecule["ammonium"]Even though the underlying graphs are isomorphic, the molecules are not equivalent:
IsomorphicGraphQ[MoleculeGraph[mol1], MoleculeGraph[mol2]]MoleculeEquivalentQ[mol1, mol2]When molecules are the same, apart from the ordering of their atoms and bonds, MoleculeEquivalentQ will return True:
mol1 = Molecule["C[C@H](Cc1c[nH]c2c1ccc(c2)O)N"]mol2 = MoleculeModify[mol1, {"RenumberAtoms", Reverse[Range[AtomCount[mol1]]]}]MoleculeEquivalentQ[mol1, mol2]If the stereochemistry is different, then the molecules are not considered equivalent:
mol3 = MoleculeModify[mol1, "RemoveStereochemistry"]MoleculeEquivalentQ[mol1, mol3]Test molecules with isotopic substitutions:
m1 = Molecule[["water"]]m2 = Molecule[["heavy water"]]MoleculeEquivalentQ[m1, m2]Implicit and explicit hydrogen atoms are treated the same by MoleculeEquivalentQ:
m1 = Molecule["benzene", IncludeHydrogens -> False]m2 = MoleculeModify[m1, "MakeHydrogensExplicit"]MoleculeEquivalentQ[m1, m2]See Also
History
Text
Wolfram Research (2019), MoleculeEquivalentQ, Wolfram Language function, https://reference.wolfram.com/language/ref/MoleculeEquivalentQ.html.
CMS
Wolfram Language. 2019. "MoleculeEquivalentQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MoleculeEquivalentQ.html.
APA
Wolfram Language. (2019). MoleculeEquivalentQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MoleculeEquivalentQ.html
BibTeX
@misc{reference.wolfram_2026_moleculeequivalentq, author="Wolfram Research", title="{MoleculeEquivalentQ}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/MoleculeEquivalentQ.html}", note=[Accessed: 16-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_moleculeequivalentq, organization={Wolfram Research}, title={MoleculeEquivalentQ}, year={2019}, url={https://reference.wolfram.com/language/ref/MoleculeEquivalentQ.html}, note=[Accessed: 16-June-2026]}