Random numbers

See the Random numbers guide for the replication contract and a full QUA + host example.

Generator

Random([seed])

Python mirror of qm.qua.Random.

Gaussian sampling

BoxMullerTables([n_lookup])

Lookup tables shared by the QUA macro and its Python replay.

box_muller_pair(rng, mean, std[, tables])

Replay one rand_gauss_box_muller() call on the host.

rand_gauss_box_muller(qua_rng, mean, std, z1, z2)

QUA macro drawing one Gaussian pair per dimension into z1 and z2.

Python counterpart of QUA’s random library.

Random reproduces the draws of a qm.qua.Random on the host, and box_muller_pair() / rand_gauss_box_muller() provide a matching pair of Gaussian samplers. Replication requires the number and order of draws to be fixed ahead of time; see the “Random numbers” guide.

This subpackage is intentionally not re-exported from qiskit_qm_provider, so it does not clash with qm.qua.Random under star-imports:

from qiskit_qm_provider.random import Random