Skip to content
This repository has been archived by the owner on Aug 18, 2023. It is now read-only.

Refactor QNN #225

Open
zaqqwerty opened this issue Mar 29, 2022 · 0 comments
Open

Refactor QNN #225

zaqqwerty opened this issue Mar 29, 2022 · 0 comments
Assignees
Milestone

Comments

@zaqqwerty
Copy link
Contributor

zaqqwerty commented Mar 29, 2022

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

  • Specifying alternative differentiators for the 'noiseless' backend, such as ParameterShift, only has the effect of increasing computational overhead, since the expectation values are exact irrespective of the chosen differentiator
  • Arguments like 'expectation_samples' do not apply when the simulator is analytic
  • The method of expectation computation depends on the type of the input operator, rather than on the inference engine.
    For example, PauliMixin diagonals get analytic treatment, while more general diagonals use sampled expectations. We would like that PauliMixins could be set to use sampled expectations instead (currently not available).

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant