Molden file from QChem does not display the orbitals

I am at a loss as to why this .molden file I generated with QChem is not displaying the MOs. I tried to compare it with one I generated from CFour that does display the MOs and I cannot see what is different in their formatting. (I deleted all the MOs but the first for debugging)

CFour.molden (48.3 KB)

QChem.molden (3.2 KB)

I think it’s because the QChem file has “Occup = 1.0” instead of “Occup=” and since we split on spaces, it’s a different number of items in the list.

Can you send me the whole file? I think the problem is that

QChem.molden (12.8 KB)

Sure thing, here is the original, original file.

This is the reason. I went through with a debugger and hit line 229 in molden.cpp, then stepping into the lexical cast operation it is getting stream = "=" because on line 229 it’s pulling

m_electrons += Core::lexicalCast<int>(list[1]).value_or(0);

which gets the second item in the list. Maybe it could be switched to use std::vector::back to get the last item?

Edit: Also, getting rid of the space fixes it :slight_smile:

It also seems that the orbital angular momentum of the basis functions needs to be in lower case for that original one to work for me.

This does seem to be true as well. All of the comparisons are against lowercase letters in the source. It should probably be changed to use std::lower with std::transform

std::transform(shell.begin(), shell.end(), shell.begin(), tolower);

I’ll try to get to that tonight along with the spacing issue.

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.