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

Add general gradient estimator to SampledObs class. #65

Merged
merged 5 commits into from
Jun 3, 2024

Conversation

markusschmitt
Copy link
Owner

For an expectation value

$\langle O\rangle_\theta=\sum_s\frac{|\psi_\theta(s)|}{\langle\psi_\theta|\psi_\theta\rangle}O_\theta(s)$

the general form of the gradient is

$\partial_\theta\langle O\rangle_\theta=2\langle\text{Re}[\Gamma_\theta] O_\theta\rangle_\theta-2\langle\text{Re}[\Gamma_\theta]\rangle_\theta \langle O_\theta\rangle_\theta+\langle\partial_\theta O_\theta\rangle_\theta$

where $\Gamma_\theta(s)=\partial_\theta\log\psi_\theta(s)$.

This PR implements a mean_and_grad member function of the SampledObs class that computes the gradient of the expectation value as given above.

@markusschmitt markusschmitt merged commit d17d618 into master Jun 3, 2024
1 check passed
@markusschmitt markusschmitt deleted the general_mc_estimator branch June 3, 2024 16:13
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.

1 participant