amazon-braket / BraketSimulator.jl

Apache License 2.0
9 stars 3 forks source link

Support for `Sum` observable type in `Expectation`, `Variance`, `AdjointGradient` result types for `shots=0` #15

Open kshyatt-aws opened 2 months ago

kshyatt-aws commented 2 months ago

Describe the feature you'd like Currently, Amazon Braket's on-demand state vector simulator only supports the Sum observable type for AdjointGradient results. However, this is a natural construct for Expectation and Variance when shots=0 (for exact, non-sampled workloads).

How would this feature be used? Please describe. Users would be able to construct Sum observables and measure them in Expectation and Variance when shots=0.

Describe alternatives you've considered Right now, users have to explicitly create Expectation/Variances for each term in the sum and combine them by hand.

Additional context This is another opportunity to carefully use dynamic threading for smaller circuits for a performance improvement.