Skip to content

Conversation

JonathonMisiewicz
Copy link
Contributor

@JonathonMisiewicz JonathonMisiewicz commented Apr 29, 2025

Description

This PR removes some deprecated code, especially regarding molden.

User API & Changelog headlines

  • Fixed a bug that would cause a crash when calling wfn.write_molden on a non-HF wavefunction without marking natural orbitals.
  • The deprcated dcft keyword is no longer recognized.
  • dfocc's molden_write is now deprecated. Just call the molden_write method of the associated wavefunction.
  • Matrix::Full is removed in favor of Matrix::SubBlocks, as the deprecation notice foretold.
  • Changes to CheMPS2 to allow working with new Molden code.
  • Behavior Change: In psi4.molden, if densities are not provided, if occupation_a and occupation_b are not found, these will be pulled from reference_wavefunction instead of set to zero.
  • Behavior Change: wfn.write_molden will only check that the orbital energies agree if the molden writing actually calls for orbital energies.

Dev notes & details

  • psi4.molden is now a wrapper on wfn.write_molden.
  • Migrated dfocc and dmrg from using C-Molden writer to the Python wavefunction method.
  • C-Molden writer (buggy, deprecated several versions ago) is deleted.
  • DMRGSolver is now a wavefunction.
  • DMRGSolver is equipped with occupation_a and occupation_b that store the diagonal of the MO RDM in the current orbitals, mimicking SCF.
  • DMRGSolver's build_rdm_ao has been re-organized
  • DMRG with pseudocanonical orbitals now updates epsilon_a_ and epsilon_b_ accordingly.
  • The MO basis MS-AVERAGED DMRG density is added to the density map.
  • Compiler warnings in libmints are silenced.
  • Some deprecated miscellanea are removed.

Questions

  • Tests wanted?

Checklist

  • molden and CheMPS2 tests pass

Status

  • Ready for review
  • Ready for merge

@JonathonMisiewicz
Copy link
Contributor Author

I'll deal with this in the morning...
Note to self: there appear to be two issues. One is with GauXC (not sure what to do about that one), but the other is symbols not being found... Probably, the missing symbols are due to missing ifdef USING_CheMPS2 - we ought never to go searching for those symbols.

Copy link
Member

@loriab loriab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to read it through again, but overall lgtm. lmk if you need any advice with the #ifdef USING_CheMPS2 etc. or if CI turns up anything odd.

@loriab loriab added this to the Psi4 1.10 milestone Apr 29, 2025
@JonathonMisiewicz
Copy link
Contributor Author

I need to read it through again, but overall lgtm. lmk if you need any advice with the #ifdef USING_CheMPS2 etc. or if CI turns up anything odd.

The ifdef cures the build problems, locally. It remains to be seen if CI turns up anything else odd... I will let you know when I've pushed my local changes. I have one last thing to investigate.

@JonathonMisiewicz
Copy link
Contributor Author

JonathonMisiewicz commented Apr 29, 2025

Behavior Change: In psi4.molden, if densities are not provided, if occupation_a and occupation_b are not found, these will be pulled from reference_wavefunction instead of set to zero.
Behavior Change: wfn.write_molden will only check that the orbital energies agree if the molden writing actually calls for orbital energies.

Copy link
Member

@loriab loriab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have to go to a mtg, but I've read most.

{0, 3, 4, 1, 5, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0}, // d
{0, 4, 5, 3, 9, 6, 1, 8, 7, 2, 0, 0, 0, 0, 0}, // f
{0, 3, 4, 9, 12, 10, 5, 13, 14, 7, 1, 6, 11, 8, 2} // g
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For other reviewers' reassurance, these good notes are also in the new loc at p4util/writer.py

Reordering expected by Molden

@loriab loriab added external-interface For issues about interfaces with external programs: ADCC, CheMPS2, GDMA, MRCC... wavefunction For issues that are on the wavefunction itself. cleanup For issues where the goal is to make Psi4 a little cleaner. labels May 6, 2025
Copy link
Member

@loriab loriab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the great cleanup and consolidation

@loriab loriab moved this to LAB Done in LAB's v1.10 Release May 7, 2025
@JonathonMisiewicz
Copy link
Contributor Author

After talking with Lori, we decided not to deprecate psi4.molden. I removed a wrong deprecation warning and updated the PR overview accordingly. Sorry for the confusion.

Copy link
Member

@jturney jturney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Nice to get rid of some of the deprecated stuff.

@JonathonMisiewicz JonathonMisiewicz added this pull request to the merge queue May 7, 2025
Merged via the queue into psi4:master with commit 2b9265a May 7, 2025
6 checks passed
@github-project-automation github-project-automation bot moved this from LAB Done to Done in LAB's v1.10 Release May 7, 2025
@JonathonMisiewicz JonathonMisiewicz deleted the deprecate-rip branch May 7, 2025 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup For issues where the goal is to make Psi4 a little cleaner. external-interface For issues about interfaces with external programs: ADCC, CheMPS2, GDMA, MRCC... wavefunction For issues that are on the wavefunction itself.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants