v2.2.0
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 gainsthickness_depletion,thickness_substrate, andwidth_pixelparameters plus adiffusiontoggle alongsideshot/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. Previouslyvmr_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.uncertaintyandAbstractImagingSensor.uncertaintygainwidth_pixel, soexpose(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-photonelectrons_measured()call drops from 1.71 s to 0.11 s, which also speeds upquantum_yield_ideal()andfano_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.