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

Refactor QNN #225

Open zaqqwerty opened 2 years ago

zaqqwerty commented 2 years ago

Right now, the way to specify options for quantum inference is quite convoluted. For example:

Instead, I propose to have a QuantumInference base class, whose only public method is expectation. Two subclasses implementing the interface will be: AnalyticQuantumInference, which uses analytic expectations and the adjoint differentiator; SampledQuantumInference, which uses sampled expectations and parameter shift gradients.