fdtdx.metric_efficiency#
- fdtdx.metric_efficiency(detector_states, in_names, out_names, metric_name)[source]#
Calculate efficiency metrics between input and output detectors.
Computes efficiency ratios between input and output detectors by comparing their metric values (e.g. energy, power). For each input-output detector pair, calculates the ratio of output/input metric values.
- Parameters:
detector_states (dict[str, dict[str, jax.Array]]) – Dictionary mapping detector names to their state dictionaries, which contain metric values as JAX arrays
in_names (Sequence[str]) – Names of input detectors to use as reference
out_names (Sequence[str]) – Names of output detectors to compare against inputs
metric_name (str) – Name of the metric to compare between detectors (e.g. “energy”)
- Returns:
- tuple containing:
jax.Array: Mean efficiency across all input-output pairs
dict: Additional info including individual metric values and efficiencies with keys like:
”{detector}_{metric}” for raw metric values
”{out}_{by}_{in}_efficiency” for individual efficiency ratios
- Return type:
tuple[jax.Array, dict[str, Any]]