Differentiable circuit with sampling

Thanks, i see there is an advantage when running on the hardware because we only have to submit one job. However, it does not make any difference on the simulator, right?

@Oriel it’s a difficult question to answer, as it depends on the simulator!

On some simulators, the computational cost of the simulation may scale with the number of shots required, in which case, you are right — shot batching would lead to no improvement.

On other simulators, including default.qubit, this is not the case. By combining the circuits into a single job with shot-batching, you should see an improvement, since default.qubit only simulates the circuit once, and then generates samples from the resulting statevector.