Wolfram Chemistry | Things to Try

Make edits and run any piece of code by clicking inside the code and pressing
+
.
Molecular and Chemical Modeling & Analysis. For students, engineers and researchers—visualize, analyze and model molecular structures, chemical reactions and more with specialized functions tightly integrated with built-in or publicly available data.

Specify Molecules

Specify a molecule using curated data:
Run
In[]:=
Molecule
caffeine
CHEMICAL
Specify common molecules by their common names:
Run
In[]:=
Molecule["caffeine"]
Specify a molecule using systematic chemical names:
Run
In[]:=
MoleculeName["caffeine"]Molecule["1,3,7-trimethylpurine-2,6-dione"]
Specify a molecule using a SMILES string:
Run
In[]:=
caffeine
CHEMICAL
["SMILES"]Molecule["CN1C=NC2=C1C(=O)N(C(=O)N2C)C"]
Import molecular data from standard file formats:
Run
In[]:=
Import["ExampleData/caffeine.xyz"]
Specify a molecule using lists of atoms and bonds:
Run
In[]:=
Molecule[{"H","O","H"},{Bond[{1,2},"Single"],Bond[{2,3},"Single"]}]

Find Properties of Molecules

Use
MoleculeValue
to obtain properties of specific molecules:
Run
In[]:=
MoleculeValue[Molecule["caffeine"],"ElementMassFraction"]
You can directly extract properties of molecules as well:
Run
In[]:=
Molecule["caffeine"]["MolarMass"]
Obtain properties that depend on specific atoms or bonds in a molecule:
Run
In[]:=
Molecule["water"][{"BondLength",{2,1}}]Molecule["water"][{"BondAngle",{2,1,3}}]
Obtain a list of isomers in a specified form:
Run
In[]:=
FindIsomers
C
8
H
10
N
4
O
2
,"Entity"

Visualize Molecules

Create a 2D representation of a molecule:
Run
In[]:=
MoleculePlot[Molecule["caffeine"]]
Highlight and label specified molecular patterns:
Run
In[]:=
MoleculePlot[Molecule["caffeine"],<|"aromatic bonds"->Bond[_,"Aromatic"],"double bonds"->Bond[_,"Double"],"carbon atoms"->Atom["C"]|>]
Create a rotatable 3D representation of a molecule:
Run
In[]:=
MoleculePlot3D[Molecule["caffeine"],PlotLegends->Automatic]

Balance a Chemical Reaction

Balance an unbalanced chemical reaction:
Run
In[]:=
ReactionBalanceChemicalReaction
H
2
+
O
2
H
2
O
Interpret a string as a chemical formula:
Run
In[]:=
ReactionBalance["H2 + O2 -> H2O"]
Interpret common names of compounds to generate a balanced reaction:
Run
In[]:=
ReactionBalance["Hydrogen + Oxygen -> Water"]

Specify a Pattern for a Reaction

A
PatternReaction
is used to apply chemical reactions to a collection of reactants. Specify a molecule pattern in much the same way you would specify a molecule:
Run
In[]:=
reactantpatterns={MoleculePattern[{"H","H"},{Bond[{1,2},"Single"]}],MoleculePattern[{"H","H"},{Bond[{1,2},"Single"]}],MoleculePattern[{"O","O"},{Bond[{1,2},"Double"]}]};productpatterns={MoleculePattern[{"H","O","H"},{Bond[{1,2},"Single"],Bond[{2,3},"Single"]}],MoleculePattern[{"H","O","H"},{Bond[{1,2},"Single"],Bond[{2,3},"Single"]}]};
Represent a chemical reaction using a rule for lists of patterns:
Run
In[]:=
PatternReaction[reactantpatterns->productpatterns]
You can also specify a chemical reaction using a SMARTS string:
Run
In[]:=
PatternReaction["[H][H].[H][H].[O]=[O]>>[H][O][H].[H][O][H]"]

Apply a Reaction

Specify a
PatternReaction
:
Run
In[]:=
reaction=PatternReaction["[H][H].[H][H].[O]=[O]>>[H][O][H].[H][O][H]"]
Create a list of molecules to be the reactants (each molecule must be explicitly present in the list):
Run
In[]:=
reactants=Molecule
Formula:
H
2
Atoms: 2 Bonds: 1
,Molecule
Formula:
H
2
Atoms: 2 Bonds: 1
,Molecule
Formula:
O
2
Atoms: 2 Bonds: 1
;
Find the molecules produced by applying a reaction to a list of reactants:
Run
In[]:=
products=ApplyReaction[reaction,reactants]
Quickly visualize the products and reactants in 3D:
Run
In[]:=
GraphicsColumn[MoleculePlot3D/@reactants]->GraphicsColumn[MoleculePlot3D/@products]
Wolfram Cloud

You are using a browser not supported by the Wolfram Cloud

Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.


I understand and wish to continue anyway »

You are using a browser not supported by the Wolfram Cloud. Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.