问题
I always hear that random numbers produced by quantum computers are considered "truly random" while random numbers generated from a classical computer are considered "pseudo-random".
If one were to generate random numbers using a quantum integer as the seed, would the numbers generated from that seed be considered "pseudo-random" or truly random? Cannot find this clarification anywhere, any explanation welcome.
import random
random.seed(get_my_quantum_number()) #Some quantum integer generated from an API.
random.random() #Is this "pseudo-random" or "truly random" ?
回答1:
random.random()
uses a pseudorandom number generator, which uses a deterministic algorithm by definition and mathematically expands its input. Thus, the numbers it generates are pseudorandom, even if it was seeded by the output of a quantum random number generator or some other nondeterministic source. See also these questions:
- Is Random function (in any programming language) biased?
- How to get truly random data, not random data fed into a PRNG seed like CSRNG's do?
In any case, the distinction between "pseudorandom" and "truly random" numbers is not what applications care about (and you didn't really specify what kind of application you have in mind). Instead, in general:
- Security applications care whether the numbers are hard to guess; in this case, only a cryptographic RNG can achieve this requirement (even one that relies on a pseudorandom number generator). A Python example is the
secrets
module orrandom.SystemRandom
. - Scientific simulations care whether the numbers behave like independent uniform random numbers, and often care whether the numbers are reproducible at a later time. A Python example is
numpy.random.Generator
.
For example, the pseudorandom number generator used by random.random()
, Mersenne Twister, is not suitable for cryptography or information security; the numbers it produces are not designed to be hard to guess, and this is the case no matter how that generator was seeded (whether by a quantum random number generator or otherwise).
来源:https://stackoverflow.com/questions/63609099/are-random-numbers-generated-using-a-quantum-integer-as-its-seed-considered-pseu