Skip to content

Conversation

@marco-2023
Copy link

Summary

This PR adds step-awareness to the SHCI RDM save/load functions, enabling proper handling of "variational" and "perturbative" stages in the workflow.

Problem

Previously:

  • RDM file naming was inconsistent between the saving and loading steps.
  • As a result, SHCI computations with perturbative corrections could fail to locate or load the correct RDM files.
  • There was no mechanism to prevent variational RDMs from being overwritten by perturbative ones.

Fixes Introduced

This PR modifies the RDM handling logic to:

  • Add a step label ("variational" or "perturbative") to both saving and loading paths.
  • Adopt a consistent naming scheme for RDM files in the format prefix/root1-root2-RDMName-step.ext, where step indicates the calculation phase (e.g., variational or perturbative), and ext specifies the file extension (either txt or bkp).
  • The workflow was updated for using these functions

Missing

  • Apply the same step-aware RDM save/load logic to the ZSHCI module.

Added a `const std::string& step` parameter to the RDMs save and load
functions. This affects the file names used allowing to store the RDMs
for the variational and perturbative steps in different files.
This updates the statements employing save/load rdm functions in
SHCI.cpp and SHCIbasics.cpp. This fixes issues when using
DoRDMs, DoOneRDM, DoSpinOneRDM or DoSpinRDM flags for a deterministic
perturbation SHCI computation. The correct file now is loaded for each
step and the RDMs for each step are saved in different files.
@marco-2023
Copy link
Author

Here is an example of an affected input.

# Reference determinant
nocc 16
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 16
end
orbitals o2_ccpvdz_pyscf.fcidump
nroots 1

# Variational calculation parameters
schedule
0 0.0001
end
dE 1e-08
maxiter 20

# Perturbative calculation parameters
epsilon2 0.0001
deterministic
# Additional parameters for output and control
prefix tmp/
DoOneRDM
DoRDM
DoSpinOneRDM
DoSpinRDM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant