Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for a new type of observable to be used with
SampledCorrelations
: aNonLocalObservableOperator
. There should probably be error handling and/or support added for the spin wave theory case, where I'm not sure that this type of observable can be used. (This PR implements the functionality only)The reason for this is to support computing correlations of the form
<s_i(t) energy_grad_j(t')>
whereenergy_grad
is the gradient of the Hamiltonian with respect to the spins (component indexj
). This observable is non-site-local because it depends on exchanges with distant sites along bonds. This type of correlation is important for computing classical response functions.For such non-local observable, the (only) fast way to generally support it is to let the observable be a callback which computes the value on every site at once.
Currently, the
NonLocalObservableOperator
constructor andenergy_gradient_dipole_observable
are not exported, but it can be used like this:which results in the usual x,y,z spin (not magnetization) observables, plus the three components of the energy gradient, plus the dipole sector norm being available to compute correlations between.