# validate¶

Methods for validating common types of input.

exception pyphi.validate.StateUnreachableError(state, message)

Raised when the current state cannot be reached from any past state.

pyphi.validate.direction(direction)

Validate that the given direction is one of the allowed constants.

pyphi.validate.tpm(tpm)

Validate a TPM.

pyphi.validate.conditionally_independent(tpm)

Validate that the TPM is conditionally independent.

pyphi.validate.connectivity_matrix(cm)

Validate the given connectivity matrix.

pyphi.validate.perturb_vector(pv, size)

Validate a network’s pertubation vector.

pyphi.validate.network(n)

Validate a Network.

Checks the TPM, connectivity matrix, and perturbation vector.

pyphi.validate.node_states(state)

Check that the state contains only zeros and ones.

pyphi.validate.state_length(state, size)

Check that the state is the given size.

pyphi.validate.state_reachable(subsystem)

Return whether a state can be reached according to the network’s TPM.

If constrained_nodes is provided, then nodes not in constrained_nodes will be left free (their state will not considered restricted by the TPM). Otherwise, any nodes without inputs will be left free.

pyphi.validate.cut(cut, node_indices)

Check that the cut is for only the given nodes.

pyphi.validate.subsystem(s)

Validate a Subsystem.

Checks its state and cut.