set_platform
- static Config.set_platform(platform, device_id=0)
Set the simulation platform of
jaxto'cpu'or'gpu'.Note
'cpu'is the safest default for small and medium-sized simulations, quick debugging, and workloads where JAX compilation overhead would dominate the actual runtime.'gpu'is typically preferable for larger simulations, batched propagations, and repeated time-evolution workloads where the higher arithmetic throughput of JAX on GPU can outweigh compilation and data-transfer costs.In practice,
'gpu'tends to be most useful when the Hilbert-space dimension is large, many propagators must be evaluated, or the same computation is executed repeatedly after JIT compilation. For one-off calculations or small models,'cpu'may still be faster overall.If the requested GPU backend is unavailable, Simphony falls back to
'cpu'.- Parameters:
platform (
str) – Simulation platform ofjax. Accepted case-insensitive values are'cpu'and'gpu'.device_id (
int|None) – GPU device id to expose viaCUDA_VISIBLE_DEVICES. Defaults to0so a process only ever touches a single GPU by default – important resource hygiene on shared multi-GPU machines. PassNoneto leave all GPUs visible instead (e.g. to place work on multiple devices from within the same process).