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

Bitstring energy builder is flaky #209

Open zaqqwerty opened 2 years ago

zaqqwerty commented 2 years ago

While working on #208 I encountered .build of MLP BitstringEnergy did not actually create the variables, and I needed to call the energy on some bitstrings to create them. Investigate this so .build will work here.

zaqqwerty commented 2 years ago

Encountered this bug again when computing the log partition function. The .build method of the input energy function did not create the layer variables, so BitstringEnergy tracked no variables. Then the value of the log partition function was never recomputed, just returned from cache