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

Noncollinear and spin-orbit implementation for k-point Hamiltonian in AFQMC #2734

Merged
merged 14 commits into from
Oct 2, 2020

Conversation

mmorale3
Copy link
Contributor

@mmorale3 mmorale3 commented Oct 2, 2020

Please review the developer documentation
on the wiki of this project that contains help and requirements.

The non-collinear implementation of AFQMC is completed in this PR.
In non-collinear calculations, a spin-orbit hamiltonian is now allowed.
Propagation and energy evaluation are implemented.
Only the k-point hamiltonian (both CPU and GPU) works with non-collinear.
Observables (other than the energy) are not yet enabled with non-collinear.
Future PRs will complete the missing features.

Describe what this PR changes and why. If it closes an issue, link to it here
with a supported keyword.

New feature: Noncollinear and spin-orbit interactions in AFQMC.

Does this introduce a breaking change?

No

What systems has this change been tested on?

Quartz, Lassen. GCC and Clang compilers.

Checklist

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

@mmorale3 mmorale3 requested a review from fdmalone October 2, 2020 16:12
fdmalone
fdmalone previously approved these changes Oct 2, 2020
Copy link
Contributor

@fdmalone fdmalone left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -49,7 +49,8 @@ class allocator{
bool operator!=(allocator const& o) const{return mp_ != o.mp_;}
using void_pointer = typename std::pointer_traits<decltype(std::declval<memory_type*>()->allocate(0, 0))>::template rebind<void>;
pointer allocate(size_type n){
return static_cast<pointer>(static_cast<void_pointer>(mp_->allocate(n*sizeof(value_type), alignof(T))));
return static_cast<pointer>(static_cast<void_pointer>(mp_->allocate(n*sizeof(value_type), 16)));
Copy link
Contributor

Choose a reason for hiding this comment

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

why 16?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a temporary fix until we update multi.
Cuda is incompatible with alignof() for std::complex, so using alignof(T) in general
causes alignment issues when compiled in double precision for gpus.
With 16 all the regular types work fine. (Notice that cudamalloc aligns to 256).

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we update multi?

@fdmalone
Copy link
Contributor

fdmalone commented Oct 2, 2020

This only allows for spin dependent one-body Hamiltonian for k-point calculations right? What format is expected in the input wavefunction / hamiltonian.

@mmorale3
Copy link
Contributor Author

mmorale3 commented Oct 2, 2020

The one body hamiltonian as to be 2M*2M in non-collinear calculations.
Only the kpoint hamiltonian works now. For any other hamiltonian, the code should abort at some point
when it realizes the calculation is non-collinear. I will complete the missing parts soon.

@fdmalone
Copy link
Contributor

fdmalone commented Oct 2, 2020

For the kpoint code this is 2m x 2m right? The HDF5 format doesn't change?

@fdmalone fdmalone changed the title Noncollinear and spin-orbit implementation in AFQMC Noncollinear and spin-orbit implementation for k-point Hamiltonian in AFQMC Oct 2, 2020
@@ -49,7 +49,8 @@ class allocator{
bool operator!=(allocator const& o) const{return mp_ != o.mp_;}
using void_pointer = typename std::pointer_traits<decltype(std::declval<memory_type*>()->allocate(0, 0))>::template rebind<void>;
pointer allocate(size_type n){
return static_cast<pointer>(static_cast<void_pointer>(mp_->allocate(n*sizeof(value_type), alignof(T))));
return static_cast<pointer>(static_cast<void_pointer>(mp_->allocate(n*sizeof(value_type), 16)));
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we update multi?

@mmorale3
Copy link
Contributor Author

mmorale3 commented Oct 2, 2020

Updating multi is possibly a lot of work.
I prefer to push this first and update multi after.

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.

Preferably, we should update multi and then update our code. I tried updating multi but found an internal conflict in multi. So let us use the workaround from @mmorale3 at the moment.

@ye-luo ye-luo merged commit 5e7dc1f into QMCPACK:develop Oct 2, 2020
@mmorale3 mmorale3 deleted the spinorbit branch October 19, 2020 20:06
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.

3 participants