BoxMullerTables¶
- class BoxMullerTables(n_lookup: int = 512)[source][source]¶
Bases:
objectLookup tables shared by the QUA macro and its Python replay.
cos[k] = cos(2*pi*k/n)andln[k] = sqrt(-2 ln((k+1)/(n+1)))fork = 0..n-1. Useget()to reuse cached instances.- Parameters:
n_lookup – Table length; a power of two between 4 and
2**14so thelnandcosindices come from disjoint bits of the 28-bit draw.- Raises:
ValueError – If
n_lookupis not a supported power of two.
- classmethod get(n_lookup: int = 512) BoxMullerTables[source][source]¶
Return a cached
BoxMullerTablesforn_lookup.