This PR adds support for a new type of observable to be used with SampledCorrelations: a NonLocalObservableOperator. 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')> where energy_grad is the gradient of the Hamiltonian with respect to the spins (component index j). 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 and energy_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.
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.