iqm.qrisp_iqm.passes.routing.core.sabre_workflow.lcg_next

Contents

iqm.qrisp_iqm.passes.routing.core.sabre_workflow.lcg_next#

iqm.qrisp_iqm.passes.routing.core.sabre_workflow.lcg_next(seed: int) → int#

Linear Congruential Generator for stochastic swap selection.

Returns a value in [0, 65536] with approximately uniform distribution. Used with threshold comparison: skip candidate when seed < 65537 / greediness.

The parameters a=75, c=74, m=65537 are chosen for good distribution properties; m=65537 is a prime modulus (2^16 + 1) ensuring full period.

Parameters:

seed (int) – Current RNG seed value.

Returns:

Next value in the LCG sequence.

Return type:

int