I wand to run a random unitary circuite in so many instance (like 1000 instance) and return the averge value like :
reg = zero_state(1)
mean([expect(Z, reg |> dispatch!(Rx,:random)) for _ in 1:1000])
but I want run it in a batched way, I know 幺 has batchedarrayreg, but I don't know how to performance random circuit in each instance to a batchedreg in a batched way. I tried
reg = zero_state(1,nbatch=1000)
expect(Z, reg|>dispatch!(Rx,:random))
but it seems not work, it just will pick one random instance 1000 times. What is the correct way?