Open Roger-luo opened 4 years ago
suggested by @GiggleLiu , a better way to support this is via a primitive expect
, which is equivalent to
ob = 0
for _ in 1:nshots
ob += @measure 1:3 op
end
ob/nshots
in concept, but will be handled specially under different contexts.
expectation semantic can be useful in compiling differentiable programs
the
@expect
should be semantically equivalent to multiple@measure
statements