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" ?
random.random()
uses a pseudorandom number generator (PRNG), 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.
A seed is a value that initializes the PRNG, and the number of possible sequences a PRNG can generate depends on the PRNG's state size and the size of the seed. For example, if the seed or the state is only 32 bits long, at most 232 different pseudorandom number sequences are possible with that PRNG, regardless of where the seed came from.
See also these questions:
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:
secrets
module or random.SystemRandom
.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).
By contrast, pseudorandom generators designed for information security often involve cryptographic hash functions, block ciphers, or stream ciphers — especially because one goal is to make future pseudorandom numbers hard to guess, even if the generator's outputs are known.