Splitting one Sobol stream across two quotas leaves holes in the grid
Routing a broad space-filling sample and a focused region sample from the same Sobol sequence breaks its low-discrepancy prefix and clusters overflow points elsewhere.
Simulation datasets often combine two budgets: broad space-filling coverage across the full domain, plus extra samples inside a specific region of interest. Pulling both from a single Sobol sequence and routing each point into whichever bucket still needs quota looks clean (it avoids wasting broad points that already land inside the target corner), yet it breaks the low-discrepancy property you chose Sobol for.
A Sobol sequence stratifies evenly only over contiguous power-of-two prefixes. In 2D, the first 64 points place exactly one sample in every cell of an 8 × 8 grid. Diverting points inside [0.7, 1.0]² into the target bucket punches holes in that prefix; to finish its quota of 64, the broad bucket pulls overflow indices that land in already-occupied cells while leaving empty patches behind. Giving each bucket its own independent Sobol stream keeps the 64-point broad prefix intact.
Minimal example
Digitally shifted 2D Sobol sequence in NumPy for 128 samples (64 broad, 64 in [0.7, 1.0]²). scipy.stats.qmc.Sobol(d=2, scramble=True) exhibits the same gap.
import numpy as np
# Minimal 2D Sobol generator (scipy.stats.qmc.Sobol shows the same effect)
def sobol_2d(n: int, seed: int) -> np.ndarray:
bits = 30
v0 = np.array([1 << (bits - 1 - k) for k in range(bits)], np.uint32)
m1 = [1]
for _ in range(1, bits):
m1.append((2 * m1[-1]) ^ m1[-1])
v1 = np.array([m1[k] << (bits - 1 - k) for k in range(bits)], np.uint32)
idx = np.arange(n, dtype=np.uint32)
gray = idx ^ (idx >> 1)
x0 = np.zeros(n, dtype=np.uint32)
x1 = np.zeros(n, dtype=np.uint32)
for k in range(bits):
bit = (gray >> k) & 1
x0 ^= bit * v0[k]
x1 ^= bit * v1[k]
rng = np.random.default_rng(seed)
s0, s1 = rng.integers(0, 1 << bits, size=2, dtype=np.uint32)
return np.column_stack([x0 ^ s0, x1 ^ s1]) / float(1 << bits)
def occupied_8x8(pts: np.ndarray) -> tuple[int, int]:
ix = np.minimum((pts[:, 0] * 8).astype(int), 7)
iy = np.minimum((pts[:, 1] * 8).astype(int), 7)
grid = np.zeros((8, 8), dtype=int)
np.add.at(grid, (ix, iy), 1)
return int(np.count_nonzero(grid)), int(np.sum(grid >= 2))
# Shared stream: route target corner [0.7, 1.0]^2 and broad together
stream = sobol_2d(2048, seed=7)
broad_shared, target_shared = [], []
for p in stream:
if p[0] >= 0.7 and p[1] >= 0.7 and len(target_shared) < 64:
target_shared.append(p)
elif len(broad_shared) < 64:
broad_shared.append(p)
if len(broad_shared) == 64 and len(target_shared) == 64:
break
# Separate streams: one intact prefix for broad, one stream for target
broad_sep = sobol_2d(64, seed=7)
ts = sobol_2d(2048, seed=8)
in_corner = (ts[:, 0] >= 0.7) & (ts[:, 1] >= 0.7)
target_sep = ts[in_corner][:64]
print("shared:", occupied_8x8(np.array(broad_shared)))
print("separate:", occupied_8x8(broad_sep))
Verification
Python 3.14.7, NumPy 2.4.3, 128 2D samples (64 broad, 64 in [0.7, 1.0]², shared/broad seed 7, target seed 8):
| Strategy | Occupied | Empty | 2+ pts | L2* |
|---|---|---|---|---|
| Shared Sobol stream (baseline) | 58 / 64 | 6 | 6 | 0.0410 |
| Separate Sobol streams | 64 / 64 | 0 | 0 | 0.0099 |
Caveat
Downstream importance weights or quadrature rules must treat the combined sample as a mixture of two known proposal distributions rather than a single sequential stream, or unweighted empirical means will overweight the [0.7, 1.0]² corner.