-
Notifications
You must be signed in to change notification settings - Fork 31
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
Density Matrix Improvements and Observables #100
Conversation
Codecov Report
@@ Coverage Diff @@
## master #100 +/- ##
=========================================
+ Coverage 72.55% 80.3% +7.75%
=========================================
Files 28 29 +1
Lines 1778 1559 -219
Branches 256 216 -40
=========================================
- Hits 1290 1252 -38
+ Misses 451 257 -194
- Partials 37 50 +13
Continue to review full report at Codecov.
|
This reverts commit 121d5dd.
The scope of this PR ended up being a lot more than just improving the One major improvement (besides the two mentioned above) was properly vectorizing gradient rotations for batches of data. Prior to this PR, we were looping over every element of the batch to compute rotated gradients. In terms of computational efficiency, this was equivalent to doing SGD with a batch size of 1—we were still averaging the gradients over the batch before performing an update step, so the trajectory in parameter space should be the same before and after this update is applied. Slightly less important improvements include:
|
Vectorized Density Matrix Gradients
pytest -k "density and not gpu"
) from about7m46s
(running current state of master) down to about37s
9s
on my laptop.density_matrix.py
), but this should be fine for now. EDIT: now that I think about it, should probably go through with this, as the density matrix tutorial takes a painfully long time.Created new base class
NeuralStateBase
, and moved a lot of code into there. Also removed some code that was duplicated across the wavefunctions and density matrix classes.Refactor observables to work with the new DensityMatrix object.
Todo: more testing, basically
\rho
, while in the paper they'd weight by the purified state.