Measurements create entropy as we all know. But computers themselves are deterministic machines. Most devices use processor heat as a source for random number generation as far as I know - which has lead to problems in the past. Any cryptographic key is only as good as the entropy source from which its content originate. When I try to collect binary entropy as results from a quantum measurement it is still a simulation - yet for huge numbers it converges well to the distribution I should obtain. So how does the simulator collect the entropy for the measurement outcomes?
Asked
Active
Viewed 253 times
1 Answers
5
Cirq uses numpy's pseudo random number generator to pick measurement results, e.g. here is code from XmonStepper.simulate_measurement:
def simulate_measurement(self, index: int) -> bool:
[...]
prob_one = np.sum(self._pool.map(_one_prob_per_shard, args))
result = bool(np.random.random() <= prob_one)
[...]
Cirq simulations are not intended to be a source of cryptographically secure entropy.
Craig Gidney
- 44,299
- 1
- 41
- 116