pasqal-io/qadence-protocols

request to compute expectation values from samples

Closed this issue · 2 comments

Qadence allows you to compute expectation values from the model with an observable attached to the model from measurements using a protocol you can specify.
estimated_values_tomo = model.expectation(
values=values,
measurement=Measurements(protocol=Measurements.TOMOGRAPHY, options=tomo_options),noise = noise)

I have samples generated from some experiment that are modified according to some protocol after regular sampling. I would like to use the same set of samples to compute expectation values for different observables.

It would be nice to include a feature where the expectation values are computed from samples for observables expressed exclusively in the Z basis (makes sense only there)

I hope we've clarified this point @rajaiitp. A possible solution is to pass your samples in the options arg.
Assigning to you.

Implemented in samples.py under qadence/measurements