qiskit_qm_provider.random.rand_gauss_box_muller

rand_gauss_box_muller(qua_rng: QuaRandom, mean, std, z1, z2, tables_qua=None, n_lookup: int = 512)[source][source]

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

Loops over mean.length() and draws one qua_rng.rand_fixed() per dimension; box_muller_pair() replays the same call on the host.

Parameters:
  • qua_rng – QUA Random, typically from Random.declare_qua().

  • mean – QUA fixed array of means.

  • std – QUA fixed array of standard deviations, same length as mean.

  • z1 – QUA fixed array receiving the first sample of each pair.

  • z2 – QUA fixed array receiving the second sample of each pair.

  • tables_qua – (cos_array, ln_array) from BoxMullerTables.declare_qua(). Pass them when calling the macro several times to declare the tables once; when None they are declared on each call.

  • n_lookup – Table length; must match the tables passed in tables_qua.

Returns:

Tuple (z1, z2).