1
$\begingroup$

Im trying to Create a molecule using a condensed formula as input.I tried some other condensed formulas but it always get an unevaluated Result:

Molecule["(CH3)2CHOH"]

Where did i go wrong?

$\endgroup$
  • $\begingroup$ How would it know whether you meant isopropanol or methoxyethane? Maybe it is refusing to evaluate because of this ambiguity. $\endgroup$ – Roman Apr 26 at 11:32
  • $\begingroup$ @Roman:Isnt ethyl methyl ether condensed formula CH3OCH2CH3? $\endgroup$ – Arman Apr 26 at 11:45
  • $\begingroup$ @Arman, that's correct. Still, the fact remains that Molecule[] is not equipped to interpret those. If you wish, send a suggestion to WRI. $\endgroup$ – J. M.'s technical difficulties Apr 26 at 12:18
2
$\begingroup$

Have you tried SMILES or Canonical SMILES? They are defined much more rigorously, and allow the distinction between isopropanol and methoxyethane:

Molecule["C(C(C([H])([H])[H])(O[H])[H])([H])([H])[H]"]
(*    isopropanol    *)

Molecule["CC(C)O"]
(*    isopropanol    *)

Molecule["C(C(OC([H])([H])[H])([H])[H])([H])([H])[H]"]
(*    methoxyethane    *)

Molecule["CCOC"]
(*    methoxyethane    *)
| improve this answer | |
$\endgroup$
  • $\begingroup$ Apart from SMILES, Molecule[] can also interpret InChI (Molecule["InChI=1S/C3H8O/c1-3(2)4/h3-4H,1-2H3"]). It uses OPSIN for this, so any format that can't be parsed by OPSIN will likely fail. $\endgroup$ – J. M.'s technical difficulties Apr 26 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.