I don’t know whether this is a bug with Avogadro or Psi4 generate a wrong fchk format.
I can’t compare it with Gaussian fchk because I don’t have it.
Environment Information
Avogadro version: 1.2.0
Operating system and version:macOS 10.14(18A391)
Expected Behavior
Rendering Orbitals works well
The fchk file on this site works well in my Environment.
http://www.lct.jussieu.fr/manuels/Gaussian98/show/mogvcm001.htm
Actual Behavior
Avogadro only displays the molecule but doesn’t show orbital nor orbital energy.
Steps to Reproduce
This is the fchk file of CH4 from Psi4
Juanes
September 7, 2025, 12:14am
2
Apologies for “necrobumping” but this person never got an answer and it may help someone. Seems like for Avogadro to read the orbitals the section in the .fchk file needs to read:
Number of independent functions I 35
Alpha MO coefficients R N= 1225
In the file provided (line 78 and 332) it reads:
MO coefficients (C) R N= 1225
I’ll point out that Gaussian documented their format and the Alpha MO coefficients (or Beta) is clear (i.e., it’s a bug with Psi IMHO).
But the appropriate code in Avogadro would be here:
m_scftype = Uhf;
m_alphaOrbitalEnergy = m_orbitalEnergy;
m_orbitalEnergy = vector<double>();
m_alphaMOcoeffs = m_MOcoeffs;
m_MOcoeffs = vector<double>();
}
m_betaOrbitalEnergy =
readArrayD(in, Core::lexicalCast<int>(list[2]), 16, hartreeToEV);
} else if (key == "Alpha MO coefficients" && list.size() > 2) {
if (m_scftype == Rhf) {
m_MOcoeffs = readArrayD(in, Core::lexicalCast<int>(list[2]), 16);
} else if (m_scftype == Uhf) {
m_alphaMOcoeffs = readArrayD(in, Core::lexicalCast<int>(list[2]), 16);
} else {
cout << "Error, alpha MO coefficients, n = " << m_MOcoeffs.size() << endl;
}
} else if (key == "Beta MO coefficients" && list.size() > 2) {
m_betaMOcoeffs = readArrayD(in, Core::lexicalCast<int>(list[2]), 16);
} else if (key == "Total SCF Density" && list.size() > 2) {
1 Like
Juanes
September 7, 2025, 5:59pm
4
I’ll see if psi4 still formats the fchk this way and bring it up in their forum if it does
1 Like
I should be able to patch our code, but I’m sure we’re not the only one who coded like that based on Gaussian’s files and documentation.
Juanes
September 7, 2025, 7:16pm
6
So maybe its better for them to adjust to everyone else
I think they should definitely match the Gaussian example, since I doubt we’re the only program using those strings.
In the meantime:
master ← ghutchis:read-psi-fchk
opened 11:16PM - 07 Sep 25 UTC
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Lin… ux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.