MoleculeFreeQ[molecule,patt]
returns True if patt is not a substructure of molecule, and False otherwise.
MoleculeFreeQ[patt]
represents an operator form of MoleculeFreeQ that can be applied to a molecule.
MoleculeFreeQ
MoleculeFreeQ[molecule,patt]
returns True if patt is not a substructure of molecule, and False otherwise.
MoleculeFreeQ[patt]
represents an operator form of MoleculeFreeQ that can be applied to a molecule.
Details and Options
- patt should be one of the following forms:
-
MoleculePattern[…] a valid molecule pattern Atom[…] a pattern for a single atom Bond[{a1,a2}] a bond between atoms with specified patterns
Examples
Basic Examples (4)
MoleculeFreeQ[Molecule["water"], Atom["O"]]But water does not have sulfur:
MoleculeFreeQ[Molecule["water"], Atom["S"]]Select molecules without a carboxylic acid group:
Select[{Molecule[{"C", "C", "C", "C", "C", "C", "H", "H", "H", "H", "H", "H"},
{Bond[{1, 2}, "Aromatic"], Bond[{2, 3}, "Aromatic"], Bond[{3, 4}, "Aromatic"],
Bond[{4, 5}, "Aromatic"], Bond[{5, 6}, "Aromatic"], Bond[{6, 1}, "Aromatic"],
Bond[{1, 7}, "Single"], Bond[{2, 8}, "Single"], Bond[{3, 9}, "Single"], Bond[{4, 10}, "Single"],
Bond[{5, 11}, "Single"], Bond[{6, 12}, "Single"]}, {}], Molecule[{"O", "C", "C", "C", "C", "C", "C", "H", "H", "H", "H", "H", "H"},
{Bond[{1, 2}, "Single"], Bond[{2, 3}, "Aromatic"], Bond[{3, 4}, "Aromatic"],
Bond[{4, 5}, "Aromatic"], Bond[{5, 6}, "Aromatic"], Bond[{6, 7}, "Aromatic"],
Bond[{7, 2}, "Aromatic"], Bond[{1, 8}, "Single"], Bond[{3, 9}, "Single"],
Bond[{4, 10}, "Single"], Bond[{5, 11}, "Single"], Bond[{6, 12}, "Single"],
Bond[{7, 13}, "Single"]}, {}], Molecule[{"O", "C", "O", "C", "C", "C", "C", "C", "C", "H", "H", "H", "H", "H", "H"},
{Bond[{1, 2}, "Double"], Bond[{2, 3}, "Single"], Bond[{2, 4}, "Single"], Bond[{4, 5}, "Aromatic"],
Bond[{5, 6}, "Aromatic"], Bond[{6, 7}, "Aromatic"], Bond[{7, 8}, "Aromatic"],
Bond[{8, 9}, "Aromatic"], Bond[{9, 4}, "Aromatic"], Bond[{3, 10}, "Single"],
Bond[{5, 11}, "Single"], Bond[{6, 12}, "Single"], Bond[{7, 13}, "Single"],
Bond[{8, 14}, "Single"], Bond[{9, 15}, "Single"]}, {}]},
MoleculeFreeQ[MoleculePattern["[C](=[O])[OH]"]]]Benzene does not have explicit double bonds:
MoleculeFreeQ[Molecule["benzene"], Bond[_, "Double"]]The "Kekulized" form of benzene, on the other hand, contains double bonds in its representation:
MoleculeFreeQ[Molecule["benzene", IncludeAromaticBonds -> False], Bond[_, "Double"]]MoleculeFreeQ["O"] /@ {Molecule["propane"], Molecule["water"]}Related Guides
History
Text
Wolfram Research (2021), MoleculeFreeQ, Wolfram Language function, https://reference.wolfram.com/language/ref/MoleculeFreeQ.html.
CMS
Wolfram Language. 2021. "MoleculeFreeQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MoleculeFreeQ.html.
APA
Wolfram Language. (2021). MoleculeFreeQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MoleculeFreeQ.html
BibTeX
@misc{reference.wolfram_2026_moleculefreeq, author="Wolfram Research", title="{MoleculeFreeQ}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/MoleculeFreeQ.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_moleculefreeq, organization={Wolfram Research}, title={MoleculeFreeQ}, year={2021}, url={https://reference.wolfram.com/language/ref/MoleculeFreeQ.html}, note=[Accessed: 13-June-2026]}