Motivation
QMCPy provides Lattice (CBC-constructed generating vectors) but does not appear to provide the classical Korobov lattice construction, where the generating vector reduces to a single integer parameter $a$.
The Korobov construction restricts the generating vector $z\in\mathbb{Z}^d$ of a rank-1 lattice rule to $z(a) = (1, a, a^2, \dots, a^{d-1}) \bmod n$, with $\gcd(a,n)=1$. This collapses the search for a good generating vector from $\sim n^d$ candidates to at most $n-1$, making an exhaustive search over $a$ tractable for a given $(n,d)$.
Proposed feature
Add a KorobovLattice discrete distribution following the existing QMCPy distribution interfaces and conventions.
The construction is based on
$$X_i = \left(\frac{i \cdot z(a)}{n}\right) \bmod 1, \qquad i = 0,\dots,n-1,$$
optionally randomized via an independent Cranley-Patterson shift per replication, exactly as Lattice already does.
Rather than searching for $a$ at runtime, the parameter $a$ is looked up in a precomputed table mapping $(n, d)$ to the value of $a$ that minimizes the weighted $P_2$ figure of merit — the squared worst-case integration error in the weighted Korobov space of smoothness 2 (Sloan & Joe, 1994; Dick, Kuo & Sloan, 2013), with product weights $\gamma_j = 1/j^2$. The table covers $d=1,\dots,250$ and $n$ up to $131072$, and is generated by an exhaustive (or, for the largest $n$, a validated two-stage) search, fully reproducible and documented.
Benefits over an unoptimized choice of $a$:
- Substantially lower integration error at equal $n$ (empirically 20×–280× better than plain Monte Carlo across the tested range).
- Retains the standard lattice-rule guarantees (fast convergence for smooth/periodic integrands) without any per-call search cost.
Proposed implementation
- Add the new distribution to the appropriate QMCPy module.
- Follow the existing distribution API (including the Cranley-Patterson shift randomization already used by
Lattice).
- Add unit tests for the mathematical construction and edge cases.
- Add documentation and examples.
- Add references to the relevant literature.
I would be interested in implementing this feature.
Motivation
QMCPy provides$a$ .
Lattice(CBC-constructed generating vectors) but does not appear to provide the classical Korobov lattice construction, where the generating vector reduces to a single integer parameterThe Korobov construction restricts the generating vector$z\in\mathbb{Z}^d$ of a rank-1 lattice rule to $z(a) = (1, a, a^2, \dots, a^{d-1}) \bmod n$ , with $\gcd(a,n)=1$ . This collapses the search for a good generating vector from $\sim n^d$ candidates to at most $n-1$ , making an exhaustive search over $a$ tractable for a given $(n,d)$ .
Proposed feature
Add a
KorobovLatticediscrete distribution following the existing QMCPy distribution interfaces and conventions.The construction is based on
$$X_i = \left(\frac{i \cdot z(a)}{n}\right) \bmod 1, \qquad i = 0,\dots,n-1,$$
optionally randomized via an independent Cranley-Patterson shift per replication, exactly as
Latticealready does.Rather than searching for$a$ at runtime, the parameter $a$ is looked up in a precomputed table mapping $(n, d)$ to the value of $a$ that minimizes the weighted $P_2$ figure of merit — the squared worst-case integration error in the weighted Korobov space of smoothness 2 (Sloan & Joe, 1994; Dick, Kuo & Sloan, 2013), with product weights $\gamma_j = 1/j^2$ . The table covers $d=1,\dots,250$ and $n$ up to $131072$ , and is generated by an exhaustive (or, for the largest $n$ , a validated two-stage) search, fully reproducible and documented.
Benefits over an unoptimized choice of$a$ :
Proposed implementation
Lattice).I would be interested in implementing this feature.