I am encountering a strange error with the following molecule:
ClearAll[mol];
mol = Molecule[
"C=c1[nH]nc(C(=O)N2CCN(C(=O)CCCOC)CC2)c1=CC=CC",
IncludeHydrogens -> All
];
MoleculePlot[mol, {{27}, {28}}]
The orange hydrogen atom has the index 27, and the blue one the index 28.
Now I try to evaluate the following two expressions:
mol // MoleculeModify[{"DeleteAtom", 27}]
mol // MoleculeModify[{"DeleteAtom", 28}]
In the first case, I get back a molecule. But in the second case, I do not. I simply get back the unevaluated expression.
I wanted to see whether it was the bond with the nitrogen atom that was causing the problem. Evidently, it was not.
ClearAll[nh3];
nh3 = Molecule["ammonia", IncludeHydrogens -> All];
nh3 // MoleculeModify[{"DeleteAtom", 2}]
Question. Why does deleting atom 28 in mol
not work? I could find nothing in the documentation of MoleculeModify to indicate that deleting that hydrogen should not work.
EDIT
Mathematica Version 13.0.1, Windows 11 Pro
MoleculeModify[mol, {"SetUnpairedElectronCount", 3 -> 1}]
works for this molecule. $\endgroup$