Skip to Content
Back

Nested sweeps: who is on top?

Parameter Sweeps

Sweeps are expanded into a single flat list over the full Cartesian product, not nested lists. The sweep listed first in your config is the outer loop and changes slowest; the sweep listed last is the inner loop and varies fastest as you walk the results. Every result also carries its sweep_values dict, so you can always recover the (ε,r)(\varepsilon, r) coordinate that produced it without relying on index math.

Explorer
nested-sweeps/
nested_sweep.py
1from blaze import BulkDriver
2
3# Two [[sweeps]] are declared in sweep.toml. The driver expands them into a
4# FLAT list over the full grid. The sweep listed LAST in the file is the
5# INNER loop, it varies fastest as you walk the results list.
6driver = BulkDriver("sweep.toml")
7results = list(driver.run_streaming())
8
9print("sweep order:", results[0]["sweep_order"])
10for i, r in enumerate(results):
11    # Each result also carries the exact sweep coordinate that produced it.
12    print(f"[{i}] eps_atom={r['sweep_values']['atom0.eps_inside']}"
13          f"  radius={r['sweep_values']['atom0.radius']}")

Band diagram

Run the example to see the band diagram.

Result · list[BandResult] (0)

Result
results:list[BandResult] (0)