google / qhbm-library

Quantum Hamiltonian-Based Models built on TensorFlow Quantum
https://qhbm-library.readthedocs.io/en/latest/
Apache License 2.0
40 stars 15 forks source link

Add Gibbs with Gradients #204

Closed zaqqwerty closed 2 years ago

zaqqwerty commented 2 years ago

Resolves #200

zaqqwerty commented 2 years ago

@farice wanted to get your opinion on this before I finish up the tests. Had couple particular questions:

zaqqwerty commented 2 years ago

@farice accidentally requested your review, this one is not ready yet

farice commented 2 years ago

To clarify how to get the partition function estimator (11.43):

image Screen Shot 2022-03-15 at 10 00 54 AM

q(x) would be the histogram distribution (observed frequencies)

While (11.38) is biased, because it's a ratio of estimates, each of these estimates are unbiased (one being the partition function, which is all that we care about here). On the other hand, the formula (C1) in the redux appendix is biased. One way to see this is that you sample to draw a set of bitstrings and then unique-ify them (discarding repeats). Discarding repeats introduces bias.

zaqqwerty commented 2 years ago

Superceded by #217

zaqqwerty commented 2 years ago

Realized it's more important to keep review history than get cleaner commits, reopening

zaqqwerty commented 2 years ago

Got the initial tracing time for the same conditions down to under 1 second