ChemicalReactionQ[rxn]
returns True if rxn is a valid ChemicalReaction object and False otherwise.
ChemicalReactionQ
ChemicalReactionQ[rxn]
returns True if rxn is a valid ChemicalReaction object and False otherwise.
Examples
open all close allBasic Examples (2)
Test a valid chemical reaction:
ChemicalReactionQ[ChemicalReaction[Association[ChemicalFormula[{"Al" -> 1, "P" -> 1, "O" -> 4}] -> 1,
ChemicalFormula[{"Ca" -> 1, {"N" -> 1, "O" -> 3} -> 2}] -> 1] ->
Association[ChemicalFormula[{"Al" -> 1, {"N" -> 1, "O" -> 3} -> 3}] -> 1,
ChemicalFormula[{"Ca" -> 3, {"P" -> 1, "O" -> 4} -> 2}] -> 1]]]A string is not a chemical reaction:
ChemicalReactionQ["AlPO4 + Ca(NO3)2 -> Al(NO3)3 + Ca3(PO4)2"]Convert the string to a ChemicalReaction before testing:
ChemicalReactionQ[ChemicalReaction["AlPO4 + Ca(NO3)2 -> Al(NO3)3 + Ca3(PO4)2"]]Scope (1)
When given invalid input, ChemicalReaction will return unevaluated:
ChemicalReaction[junk]This will still match a simple pattern:
MatchQ[%, _ChemicalReaction]Use a PatternTest to make a more discerning pattern:
MatchQ[%%, _ ? ChemicalReactionQ]Related Guides
History
Text
Wolfram Research (2025), ChemicalReactionQ, Wolfram Language function, https://reference.wolfram.com/language/ref/ChemicalReactionQ.html.
CMS
Wolfram Language. 2025. "ChemicalReactionQ." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ChemicalReactionQ.html.
APA
Wolfram Language. (2025). ChemicalReactionQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ChemicalReactionQ.html
BibTeX
@misc{reference.wolfram_2026_chemicalreactionq, author="Wolfram Research", title="{ChemicalReactionQ}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/ChemicalReactionQ.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_chemicalreactionq, organization={Wolfram Research}, title={ChemicalReactionQ}, year={2025}, url={https://reference.wolfram.com/language/ref/ChemicalReactionQ.html}, note=[Accessed: 12-June-2026]}