6
$\begingroup$

Consider the following:

cacl = Molecule[{Atom["Ca"], Atom["Cl"]}, {Bond[{1, 2}, "Single"]}];
MoleculeValue[cacl, "CanonicalSMILES"]
(* Cl[CaH] *)

Notice the artificial insertion of the hydrogen atom to fill the valency of the calcium atom. I understand that this behaviour is mentioned in the official documentation:

"Hydrogen atoms may be omitted from the atom list if their presence can be inferred from the valence and bonding of the atoms present."

But is there a way to suppress this default behaviour? I want the SMILES representation of the molecule above to be Cl[Ca+], not Cl[CaH].

$\endgroup$
  • $\begingroup$ Unfortunately, there seems to be no way. I think this choice of default behaviour was a very short-sighted decision on the part of Wolfram Research. $\endgroup$ – Shredderroy Oct 8 at 16:34
4
$\begingroup$

I imagine it's because CaCl is not a valid compound. If you want CaCl+, you can do:

cacl = Molecule[{Atom["Ca+"], Atom["Cl"]}, {Bond[{1, 2}, "Single"]}]

enter image description here

MoleculeValue[cacl, "CanonicalSMILES"]

"Cl[Ca+]"

For CaCl2:

cacl2 = Molecule[{Atom["Ca"], Atom["Cl"], Atom["Cl"]}, {Bond[{1, 2}, "Single"], Bond[{1, 3}, "Single"]}];
MoleculeValue[cacl2, "CanonicalSMILES"]

"Cl[Ca]Cl"

$\endgroup$

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.