Skip to content

v2.2.0

Choose a tag to compare

@roytsmart roytsmart released this 17 Aug 21:22
· 31 commits to main since this release
05f161c

Adds charge diffusion to the analytic VMR, and makes the charge-diffusion Monte Carlo substantially faster.

Added

  • optika.sensors.vmr_signal() now models charge diffusion (#195). It gains thickness_depletion, thickness_substrate, and width_pixel parameters plus a diffusion toggle alongside shot/fano/pcc. Diffusion weakens the photon-correlated component of the variance, since it reduces the probability that two electrons from the same photon are measured in the same pixel. Previously vmr_signal() ignored diffusion entirely and overestimated the VMR by roughly 50% at EUV wavelengths for a sensor with a field-free region.
  • The correction is threaded through the uncertainty stack: AbstractSensorMaterial.uncertainty and AbstractImagingSensor.uncertainty gain width_pixel, so expose(uncertainty=True) is consistent with its own diffused signal.

Performance

  • The charge-diffusion sampler in electrons_measured() gained a multinomial fast path (#196). Electrons from one photon are i.i.d. on integer pixel offsets, so for large electron counts they are partitioned across a bounded offset window via conditional binomials in O(window) rather than O(m). 3.2x faster at 1.5 A and 1.6x at 5 A, with no regression at longer wavelengths; the per-electron path is retained and selected per photon.
  • probability_of_n_pairs() is roughly 600x faster (#197), from 1.6 s to 3 ms. The tabulated PMF is now cached rather than re-parsed on every call, and its temperature interpolation is vectorized instead of looping in Python over the non-interpolated axes. A zero-photon electrons_measured() call drops from 1.71 s to 0.11 s, which also speeds up quantum_yield_ideal() and fano_factor().

Compatibility

No public API removals. vmr_signal()'s new parameters default so that diffusion is a no-op unless a field-free region is specified, so existing calls are unaffected.