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

One Body Spin dependent Jastrow #3257

Merged
merged 6 commits into from
Aug 30, 2021
Merged

One Body Spin dependent Jastrow #3257

merged 6 commits into from
Aug 30, 2021

Conversation

shivupa
Copy link
Contributor

@shivupa shivupa commented Jun 24, 2021

Proposed changes

This adds (re-adds) spin dependent one-body Jastrow factors. This builds upon #3243 #3256 (This will need to be rebased after those go in so no need to look at until those are addressed.).
Closes #3138.

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

  • New(?) feature
  • Testing changes (e.g. new unit/integration/performance tests)

Does this introduce a breaking change?

  • No

What systems has this change been tested on?

Ryzen Workstation

Checklist

  • Yes. This PR is up to date with current the current state of 'develop'
  • Yes. Code added or changed in the PR has been clang-formatted
  • Yes. This PR adds tests to cover any new code, or to catch a bug that is being fixed
  • No. Documentation has been added (if appropriate)

@qmc-robot
Copy link

Can one of the admins verify this patch?

@shivupa
Copy link
Contributor Author

shivupa commented Jul 15, 2021

A test that I still want to add is a short run with the regular 1 body Jastrow and a 1 body Jastrow with separate up and down channels with the same parameters and make sure they agree. I am not sure how to write a test like that yet, but I will try to add something shortly.

@@ -513,12 +599,26 @@ std::unique_ptr<WaveFunctionComponent> RadialJastrowBuilder::buildComponent(xmlN
// it's a one body jastrow factor
if (Jastfunction == "bspline")
{
return createJ1<BsplineFunctor<RealType>>(cur);
if (SpinOpt.find("yes") < SpinOpt.size())
Copy link
Contributor

Choose a reason for hiding this comment

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

This would be more straightforward as if (SpinOpt == "yes")
(Unless I'm missing something about the values of SpinOpt - it is just "yes" or "no"?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks I agree it will be just yes or no. I will update this accordingly

Copy link
Contributor

Choose a reason for hiding this comment

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

*@param candidate_values candidate values to be checked against, the first element is the default value

Use the third argument to restrict input options.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated. Thanks didn't know about that

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the default should be no. So {"no", "yes"}. Don't do the change now. I'm putting up a lot of review comments. I think we we should take the chance to do our best as the old one is intended to be deleted.

@shivupa shivupa marked this pull request as ready for review July 24, 2021 21:15
Copy link
Contributor

@ye-luo ye-luo left a comment

Choose a reason for hiding this comment

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

My first round of comment.

src/QMCWaveFunctions/Jastrow/J1Spin.h Outdated Show resolved Hide resolved
src/QMCWaveFunctions/Jastrow/J1Spin.h Outdated Show resolved Hide resolved
src/QMCWaveFunctions/Jastrow/J1Spin.h Outdated Show resolved Hide resolved
src/QMCWaveFunctions/Jastrow/J1Spin.h Outdated Show resolved Hide resolved
src/QMCWaveFunctions/Jastrow/J1Spin.h Outdated Show resolved Hide resolved
// if target type is not specified J1UniqueFunctors["i"] is assigned
// if target type is specified J1UniqueFunctors["ij"] is assigned
//
app_log() << " source" << source_type << " target type " << target_type << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

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

If the electron species is not give, we can populate every target species with clones of the same unique_ptr.
I hope we only need J1UniqueFunctors and never need J1Functors.
I think Unique is with respect to particle groups. Spin symmetry generally should be handled in the builder not inside this function.

For example, if you have spin-up, down electrons and positrons, you would like to populate up/down electron with the same Jastrow but positrons with a different one, I don't see the symmetry can be well recorded in J1UniqueFunctors.
For this reason, my assessment on J1UniqueFunctors is that it is to represent groups.

Inside unique J1 functor, it should carry shared_ptr for optimization info. The symmetry can be linked there and builder should handle this.

Copy link
Contributor Author

@shivupa shivupa Jul 30, 2021

Choose a reason for hiding this comment

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

I hope we only need J1UniqueFunctors and never need J1Functors.

I think this might be possible. I need more time

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Inside unique J1 functor, it should carry shared_ptr for optimization info. The symmetry can be linked there and builder should handle this.

Let me know if the current iteration of this is similar to what you are expecting.

src/QMCWaveFunctions/Jastrow/J1Spin.h Outdated Show resolved Hide resolved
src/QMCWaveFunctions/Jastrow/J1Spin.h Outdated Show resolved Hide resolved
src/QMCWaveFunctions/Jastrow/J1Spin.h Outdated Show resolved Hide resolved
src/QMCWaveFunctions/Jastrow/J1Spin.h Outdated Show resolved Hide resolved
@ye-luo
Copy link
Contributor

ye-luo commented Jul 31, 2021

Old files with J1SpinOrbitalSoA in the name reappear. Could you just squash all the commits? The current commits are not clean and will be difficult to continue being rebased.

@shivupa
Copy link
Contributor Author

shivupa commented Jul 31, 2021

Yeah oops sorry about that. The rebase was getting complicated

@ye-luo
Copy link
Contributor

ye-luo commented Aug 30, 2021

Start testing in-house

ye-luo
ye-luo previously approved these changes Aug 30, 2021
@ye-luo
Copy link
Contributor

ye-luo commented Aug 30, 2021

Test this please

@ye-luo ye-luo enabled auto-merge August 30, 2021 03:19
@ye-luo
Copy link
Contributor

ye-luo commented Aug 30, 2021

Test this please

@ye-luo ye-luo merged commit 6161091 into QMCPACK:develop Aug 30, 2021
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 dependent One body Jastrow factor is needed
4 participants