pyphi.substrate_generator.random_substrate#

pyphi.substrate_generator.random_substrate(n, *, seed, epsilon=0.0, cm=None)[source]#

A seeded random binary substrate of n units.

Each unit’s ON probability, for every previous state, is drawn independently and uniformly from (epsilon, 1 − epsilon) using an isolated generator seeded with seed, so the substrate is exactly reproducible from (n, seed, epsilon).

Parameters:
  • n (int) – Number of binary units.

  • seed (int) – Seed for the isolated random generator.

  • epsilon (float, optional) – Margin keeping probabilities away from 0 and 1 (deterministic entries); 0.0 (the default) permits near-deterministic rows.

  • cm (numpy.ndarray, optional) – Connectivity matrix. If None, connectivity is inferred from the sampled TPM (generically fully connected).

Returns:

Substrate – The sampled substrate.

Return type:

Substrate