You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Plugins can support this new feature by subclassing the Device.sample() method, returning the requested number of samples for a given observable.
Note: some of the observables (qml.X, qml.P, qml.Homodyne) correspond directly to Measure operators in Strawberry Fields. This should be the proper way to support sampling in PennyLane-SF.
However, there are some SF Measurements that currently don't correspond to a PL observable, namely MeasureFock() for PNR measurements. Perhaps we could utilize qml.FockStateProjector(), and make n an optional argument?
Another issue is that there are some PL observables that don't correspond to a SF Measurement - qml.NumberOperator, qml.PolyXP. Since these are Gaussian observables, we should be able to support them in simulator backends (since we have access to the Gaussian state).
The text was updated successfully, but these errors were encountered:
With the latest development version of PennyLane, we now support returning
samples
from the QNode, as well as expectation values and variance:Plugins can support this new feature by subclassing the
Device.sample()
method, returning the requested number of samples for a given observable.Note: some of the observables (
qml.X
,qml.P
,qml.Homodyne
) correspond directly toMeasure
operators in Strawberry Fields. This should be the proper way to support sampling in PennyLane-SF.However, there are some SF Measurements that currently don't correspond to a PL observable, namely
MeasureFock()
for PNR measurements. Perhaps we could utilizeqml.FockStateProjector()
, and maken
an optional argument?Another issue is that there are some PL observables that don't correspond to a SF Measurement -
qml.NumberOperator
,qml.PolyXP
. Since these are Gaussian observables, we should be able to support them in simulator backends (since we have access to the Gaussian state).The text was updated successfully, but these errors were encountered: