-
Notifications
You must be signed in to change notification settings - Fork 141
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
Spin asymmetric results from a spin symmetric wavefunction #5229
Comments
Checking in on the status of this since there were quite a few conversations and there are at least 4 areas that need investigating to narrow this down. While the patterns in the output strongly suggest some plumbing issues, there could also be numerical issues or API issues at play.
It is worth noting that a lot of changes were made to the multi-determinant code in the last year. Multideterminant molecular runs are supposedly OK per conversations with @anbenali , as well as usage and testing. These code paths are well tested and well used even for PBC LCAO ground state runs, e.g. the recent multideterminant lithium cobaltate runs would presumably show issues. However, there are some issues #5172 that could indicate bugs or numerical stability issues for excited states. Are there any other possibilities to consider? To address (2), if the tooling makes it easy enough, it would be good to run one of both of (1) Guassian AFM CoO (2) graphene with splines. If any of these runs were mixed precision it would be good to verify that double precision does not change anything. |
I think I now know what is causing this behavior. I will have full confirmation after the Thanksgiving holidays. Please no one put any time into this until I get back with the results. |
The issue is related to preprocessing QMCPACK performs on orbitals during the planewave to B-spline conversion (C2C). The system in question is run at the Gamma point. Each planewave orbital (approximately) has a single global phase, consistent with the gamma point. The phases are essentially arbitrary/random. In QMCPACK (complex, C2C Bspline), the orbital phases are rotated into two groups (approximately 50/50 split). One group has phase The product of up and down determinants in this case has a phase of 0. Single particle excitations between orbitals with like phases also results in a determinant with phase 0 (real valued). Excitations between orbitals with differing phases results in a phase of The real-valued determinants comprise one color in the checkerboard pattern shown above, and the imaginary valued ones the other. Fully accounting for the real and imaginary valued determinant subsets resolves this issue for the self-healing estimator, but it is really strange to have precisely 50% real determinants and 50% imaginary determinants for a Gamma-point wavefunction. I would prefer to be able to disable the strange bipartite phase rotation of the orbitals (keep the input and internal orbital phases identical). I also suspect this behavior is related to a worse problem seen in C2R: QMCPACK performs a non-unitary operation on the orbitals (see my last comment in #4673 ). Following the operation, the orbitals are composed of 50/50 mixtures (sqrt(2)/2 components) of two input orbitals and are no longer orthogonal. It probably isn't a coincidence that the sqrt(2)/2 components match the projections of |
The presenting problem for this issue (apparent spin asymmetry) is resolved. |
I think there is a bug using qmcpack/src/Estimators/SelfHealingOverlap.cpp Line 113 in 80a9b57
Even using QE orbitals bypassing rotation, we should not assume phase 0 even if the calculation is done at the gamma point. This requirement applies to all the computation using complex TWF which is the case of C2C. |
Yes, this is correct. I have a branch (yet to be PR'ed) where this is fixed. That branch is the one I used to confirm the lack of spin asymmetry with the complex code. No physical problem with C2C. The only remaining issue I have with C2C is that it performs a phase rotation unnecessarily. Still checking out whether your recommended 1 line change turns off the rotation fully. |
Describe the bug
QMCPACK produces spin-asymmetric results (as seen in the self-healing estimator) from a spin-symmetric wavefunction.
The system is AFM CoO (4 atom cell). A multideterminant wavefunction file with singles excitations in both up and down spins is being used. The coefficients are set with 1.0 on the ground state determinant and 1e-18 on all others to make the wavefunction equivalent to a single determinant run. In this case B-spline orbitals are used.
In other runs on graphene with gaussian orbitals, no issues have been observed.
Details of the estimator implementation$\Phi_i$ ),
$\Psi =\sum_ic_i\Psi_i = e^J\sum_ic_i\Phi_i$
For a multideterminant wavefunction with orthogonal deteriminants (
The self-healing estimator of coefficient$i$ is:
$c_i\propto\frac{\langle\Phi_i\vert e^{-J}\rvert \Psi\rangle}{\langle\Psi\lvert\Psi\rangle}$ $J=0$ , proportionality is replaced by equality)
(When
For a VMC run this can be rewritten as
$c_i\propto\frac{\langle\Psi\lvert e^{-2J}\frac{\Psi_i}{\Psi}\rvert\Psi\rangle}{\langle\Psi\lvert\Psi\rangle}$
The ratio$\Psi_i/\Psi$ can be found using a parameter derivative of the wavefunction as $\frac{\partial}{\partial c_i}\log\Psi$ , so in general the estimator for VMC or DMC is
$c_i\propto\langle e^{-2J}\frac{\partial}{\partial c_i}\log\Psi\rangle$
This estimator is very simple, and for$J=0$ it only requires the parameter derivative to be correct.
Observed correctness of the estimator
For$J=0$ and $J\ne0$ this estimator has been tested in this case (CoO) and others, and the expectation value of the estimator in VMC always returns results statisically consistent with the inputted coefficients in the multideterimant.
Observed anomalous behavior
The measured coefficients from a DMC run break spin symmetry (note the large coefficients for up excitations at low index):
Only a subset of the coefficients with (4 sigma significance) are shown.
In addition, half of the estimated coefficients have miniscule stastitical fluctuations (5 orders of magnitude smaller than the other half) and have values near zero. This aspect (analyzed in more detail below) is the same in DMC or VMC, with or without a Jastrow.
The plot below shows the estimated coefficients from a VMC run, sorted in order of errorbar magnitude. The coefficients on the right have normal fluctuations, while those on the left are 5 orders of magnitude smaller. The vertical line marks 50%.
In an AFM state, like the one we use for CoO, each singles excitation in the up channel is equivalent to another in the down channel (also explicitly verified by exact matching of up and down Kohn-Sham eigenvalues in DFT).
Each such pair should produce identical sampling for the coefficient. However, many such pairs exist (roughly half of them) where the estimated coefficient for the up excitation has a finite fluctuation (errorbar) while for the down one a minute fluctuation is observed.
The plot below shows the statistical errorbar of up excitations (x-axis) with their corresponding down spin pairs (y-axis):
The normal and minute fluctuation coefficients show a highly structured pattern when organized by particle and hole indices (23 occupied orbitals in each spin channel, 207 virtuals in each):
The pattern is checkerboard-like in particle and hole indices. Here dark rectangles mark particle/hole (i,j) pairs having normal fluctuation in the estimated coefficient with those with miniscule fluctuations shown in yellow.
When similarly organized for the down excitations, a different checkerboard-like pattern emerges, again showing the spin asymmetry:
The source(s) of the anomalous spin asymmetry and the patterned minute fluctuations is unknown.
To Reproduce
File location: OLCF Frontier at
/lustre/orion/mat151/proj-shared/qmcpack_bug_issue_5229
Files:
The estimated coefficients are in the stat.h5 file:
QMCPACK version:
QMCPACK build: CPU complex (SplineC2C for orbitals)
QMCPACK drivers: batched (legacy shows same issue)
Expected behavior
Spin symmetric results.
System:
Inti. AMD CPU machine at ORNL, 128 core nodes.
The text was updated successfully, but these errors were encountered: