cana.function_properties.sensitivity module

Sensitivity

Average sensitivity and edge activities of a Boolean node.

Two equivalent routes:

The two formulations are bit-exactly equal on the full state space.

High-k sampling reuses the shared exact/sampled two-track (exact_k_max / n_samples) from sampling. Percentile bootstrap CIs are available via bootstrap_activities() and bootstrap_sensitivity().

cana.function_properties.sensitivity.activities_from_bit_lut(bit_lut)[source]

Activity of each input from a dense LUT: fraction of states where flipping it changes the output.

Parameters:

bit_lut (BitLut) – Dense truth table; k is taken from bit_lut.k.

Returns:

The activity of each input.

Return type:

(list)

cana.function_properties.sensitivity.sensitivity_from_bit_lut(bit_lut, norm=False)[source]

Average sensitivity from a dense LUT: sum of activities_from_bit_lut().

Parameters:
  • bit_lut (BitLut) – Dense truth table; k is taken from bit_lut.k.

  • norm (bool) – Normalize by the number of inputs k.

Returns:

(float)

Return type:

float

cana.function_properties.sensitivity.activities_from_schemata(schemata, k=None, *, exact_k_max=14, n_samples=None, rng=None, minterms=None)[source]

Edge activities from one-symbol schemata: upper edge effectiveness.

Equivalent to 1 - r_i with bound="upper" (see cana.function_properties.redundancy.edge_redundancy()). Use when prime implicants are available, or when k exceeds the dense-LUT limit.

Parameters:
Returns:

The activity of each input.

Return type:

(list)

cana.function_properties.sensitivity.sensitivity_from_schemata(schemata, k=None, *, norm=False, exact_k_max=14, n_samples=None, rng=None, minterms=None)[source]

Average sensitivity from one-symbol schemata: sum of activities_from_schemata().

Parameters:
Returns:

(float)

Return type:

float

cana.function_properties.sensitivity.bootstrap_activities(sampled_or_schemata=None, *, schemata=None, n_samples=None, n_boot=1000, ci=0.95, rng=None, minterms=None)[source]

Estimate per-input activities with percentile bootstrap CIs.

Activities are upper edge effectiveness (\(a_i = 1 - r_i\) with bound="upper"). Prefer a preserved SampledPiCoverage so primes are not re-matched.

Parameters:
  • sampled_or_schemata (SampledPiCoverage | Mapping[int, Set[str]] | None)

  • schemata (Mapping[int, Set[str]] | None)

  • n_samples (int | None)

  • n_boot (int)

  • ci (float)

  • rng (Generator | None)

  • minterms (Sequence[str] | None)

Return type:

List[BootstrapResult]

cana.function_properties.sensitivity.bootstrap_sensitivity(sampled_or_schemata=None, *, schemata=None, n_samples=None, n_boot=1000, ci=0.95, norm=False, rng=None, minterms=None)[source]

Estimate average sensitivity with a percentile bootstrap CI.

Bootstraps the sum of per-minterm activities (\(s_t = \sum_i (1 - r_{t,i})\) with upper-bound edge contributions), not the sum of per-input CIs. Prefer a preserved SampledPiCoverage.

Parameters:
  • sampled_or_schemata (SampledPiCoverage | Mapping[int, Set[str]] | None)

  • schemata (Mapping[int, Set[str]] | None)

  • n_samples (int | None)

  • n_boot (int)

  • ci (float)

  • norm (bool)

  • rng (Generator | None)

  • minterms (Sequence[str] | None)

Return type:

BootstrapResult

cana.function_properties.sensitivity.activities(outputs, k=None)[source]

Deprecated alias of activities_from_bit_lut().

outputs may be a BitLut or a length-2**k 0/1 sequence.

cana.function_properties.sensitivity.sensitivity(outputs, k=None, norm=False)[source]

Deprecated alias of sensitivity_from_bit_lut().

outputs may be a BitLut or a length-2**k 0/1 sequence.

cana.function_properties.sensitivity.activities_old(node)[source]

Deprecated alias of node activities_from_schemata().

cana.function_properties.sensitivity.sensitivity_old(node, norm=False)[source]

Deprecated alias of node sensitivity_from_schemata().