CQCL / qujax

Simulating quantum circuits with JAX
https://cqcl.github.io/qujax/
Apache License 2.0
58 stars 10 forks source link

Add get_statetensor_to_sampled_expectation_func #24

Closed SamDuffield closed 2 years ago

SamDuffield commented 2 years ago

Currently only exact statetensor -> expectations are supported for quantum Hamiltonians.

We can implement the sampled (shots) version naively by

  1. sample bitstrings
  2. convert each bitstring to a statetensor (with all zeros except at the indices of the bitstrings)
  3. apply statetensor_to_expectation_func to each of these padded statetensors and average
SamDuffield commented 2 years ago

Added in 0.2.6 #29