qiskit_qm_provider.random.box_muller_pair¶
- box_muller_pair(rng: Random, mean: Sequence[FixedPoint | float], std: Sequence[FixedPoint | float], tables: BoxMullerTables | None = None) tuple[list[FixedPoint], list[FixedPoint]][source][source]¶
Replay one
rand_gauss_box_muller()call on the host.Draws one
Random.rand_fixed()per dimension, in order, exactly as the QUA macro does.- Parameters:
rng – Host generator mirroring the QUA
Randompassed to the macro.mean – Per-dimension means; floats are quantized with
FixedPoint(...)(round to nearest, as QUA’sdeclare(fixed, value=...)).std – Per-dimension standard deviations, same length as
mean.tables – Lookup tables; defaults to
BoxMullerTables.get()(512 entries).
Note
Fixed-point arithmetic wraps around on overflow, as on the controller, and
FixedPointOverflowWarningis emitted when that happens. The replay stays exact, but the samples are rarely meaningful: keepstd * r_max < 8and|mean| + std * r_max < 8(r_maxis about 3.54 for 512 table entries).- Returns:
Tuple
(z1, z2)of per-dimension samples asFixedPoint.- Raises:
ValueError – If
meanandstdhave different lengths.