Skip to content

v8.1.17 - donate_argnums on beast-mode statevector buffer

Choose a tag to compare

@tatopenn-cell tatopenn-cell released this 21 Jul 08:38

Added

  • donate_argnums=(0,) on run_circuit_jit_beast_mode's statevector buffer — the only one of _compile_and_run_circuit_jit's four call sites where it's safe (self.sv is always rebound immediately after, verified across chunked/repeated calls and separate simulator instances). run_parametric_batch_jit (its init_sv is a vmap-broadcast closure shared across the whole batch) and circuit_to_energy_fn's VQE loop (same stato_zero reused every epoch) are deliberately left un-donated — donating there would make JAX raise on the second use instead of helping.
  • Verified with a real measurement: RSS growth on a 22-qubit/300-gate circuit drops from +89.4MB to +4.5MB on the dev machine. Independently re-verified in a second environment (direction confirmed at a smaller scale, exact numbers differ as expected across hardware — RSS benchmarks are inherently environment-dependent, documented as such in the test itself).

PyPI: https://pypi.org/project/dense-evolution/8.1.17/