Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable complex coefficients for SelfHealingOverlap estimator #5291

Merged
merged 11 commits into from
Jan 31, 2025

Conversation

jtkrogel
Copy link
Contributor

Proposed changes

Small update to handle complex wavefunctions in SelfHealingOverlap estimator. Resolves #5229 (fixes the "plaid scarf" pattern seen in the coefficients for complex runs).

Includes light scaffolding to later include rotated Slater determinants as well (commented out).

What type(s) of changes does this code introduce?

  • Bugfix

Does this introduce a breaking change?

  • No

What systems has this change been tested on?

Laptop. Inti at ORNL

Checklist

  • Yes. This PR is up to date with current the current state of 'develop'

src/Estimators/SelfHealingOverlap.h Outdated Show resolved Hide resolved
src/Estimators/SelfHealingOverlapInput.h Outdated Show resolved Hide resolved
src/QMCWaveFunctions/Fermion/MultiSlaterDetTableMethod.h Outdated Show resolved Hide resolved
src/QMCWaveFunctions/TrialWaveFunction.h Show resolved Hide resolved
src/Estimators/SelfHealingOverlap.cpp Outdated Show resolved Hide resolved
src/Estimators/SelfHealingOverlap.cpp Outdated Show resolved Hide resolved
@jtkrogel
Copy link
Contributor Author

Review comments addressed.

@ye-luo
Copy link
Contributor

ye-luo commented Jan 29, 2025

134617d
also fixes the real compilation issue.

ye-luo
ye-luo previously approved these changes Jan 29, 2025
@ye-luo ye-luo enabled auto-merge January 29, 2025 22:01
@ye-luo
Copy link
Contributor

ye-luo commented Jan 29, 2025

Test this please

{
RefVector<SlaterDet> refs;
for (auto& component : Z)
if (auto* comp_ptr = dynamic_cast<SlaterDet*>(component.get()); comp_ptr)
Copy link
Contributor

@PDoakORNL PDoakORNL Jan 30, 2025

Choose a reason for hiding this comment

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

findSD is seems too brief, this is now part of the public API and it would be nice if it was recognizable as what it is from that. Imagine I want to search the codebase for SlaterDet definitions

auto my_det = twf.findSD()

SD is not a character combination of much specificity.

This smells a bit, dynamic_casts aren't zero cost

Copy link
Contributor

Choose a reason for hiding this comment

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

Don't worry about that. I'd like to addressed it separately.
findSD/findMSD are too specific. I'd like to change them as mentioned #5291 (comment)

Copy link
Contributor

@PDoakORNL PDoakORNL left a comment

Choose a reason for hiding this comment

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

New code should follow coding specification.

auto nmsd = msd_refvec.size();

size_t nparams;
if (nmsd == 1 and nsd == 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

fixed.

@PDoakORNL
Copy link
Contributor

For the tests to matter, tests need to exist. As far as I can tell the CI is only checking this compiles.

@ye-luo
Copy link
Contributor

ye-luo commented Jan 31, 2025

For the tests to matter, tests need to exist. As far as I can tell the CI is only checking this compiles.

deterministic-LiH_ae_msdj_legacy-vmc-estimator-sh_coeff tests does run in real builds in CI.

@ye-luo
Copy link
Contributor

ye-luo commented Jan 31, 2025

Test this please

@ye-luo ye-luo merged commit 41caa93 into QMCPACK:develop Jan 31, 2025
35 of 37 checks passed
@PDoakORNL
Copy link
Contributor

Ok but application level testing is only indirect testing, and not of these changes. It also implies that development is being done with unknown input and validated against unknown data to an unknown degree. Instead of developing that testing already owed for previously committed code features are being expanded with unclear testing. We have to eventually have a uniform set of standards and we can't expect anyone to follow them if some can get code committed while ignoring them.

@prckent
Copy link
Contributor

prckent commented Feb 3, 2025

Some comments where we can do better. I am disappointed this PR was merged without better test coverage or at least comments to say that these are coming. I hope the latter since we are where we are.

  1. A simple 1-1 deterministic integration test is missing -- something that works without threads or MPI. This needs to be added. Fortunately this should be an easy add. I will create an issue if needed. Let me know.

The need for 1-1 is not obviously documented, so I'll state it here: besides ease of future debugging, we only do sanitizer builds without MPI, so this code could have an off-by one indexing error in it that we would otherwise have caught automatically (Hopefully not). Additionally another critical reason is that many of the nightly builds do not have MPI. This is due to the limited testing resources we have. e.g. There are currently no nightly builds on AMD MI210 GPUs with MPI. This code could break on MI200 series e.g. Frontier., and we would not have a chance to catch it without a 1-1 test in the nightlies.

  1. The APIs clearly need more work describing &/or refactoring them, as commented. I look forward to seeing those updates in due course.

  2. Going back to the original self-healing operator implementation, ideally this code would have unit tests. Please don't write additional new code without writing matching unit tests! i.e. a non-integration test that covers an individual part of the application. Given the many areas of the code exist where help is needed, it will be hard to get much help porting or debugging code that does not have decent testing. In contrast, getting help with designing/setting up tests at the time of beginning to plan to write new features is straightforward due to the large payback. Hopefully this code will be trouble free.

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.

Spin asymmetric results from a spin symmetric wavefunction
4 participants