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

Move operator expectations to QuantumInference #179

Closed zaqqwerty closed 2 years ago

zaqqwerty commented 2 years ago

Let QuantumInference expectation accept the Hamiltonian class.

Getting some code duplication in VQT and QHBM, due to both needing to accept cirq.PauliSum and Hamiltonian. Instead, the QuantumInference expectation method should accept both. As well, need to move these before allowing QuantumCircuit to be a constructor argument to QuantumInference is possible. Part of #147.

farice commented 2 years ago

feel free to submit once tests pass