node

Represents a node in a subsystem. Each node has a unique index, its position in the network’s list of nodes.

class pyphi.node.Node(subsystem, index, indices=None, label=None)

A node in a subsystem.

subsystem

Subsystem – The subsystem the node belongs to.

index

int – The node’s index in the network.

network

Network – The network the node belongs to.

label

str – An optional label for the node.

state

int – The state of this node.

input_indices

The indices of nodes which connect to this node.

output_indices

The indices of nodes that this node connects to.

inputs

The set of nodes with connections to this node.

outputs

The set of nodes this node has connections to.

__eq__(other)

Return whether this node equals the other object.

Two nodes are equal if they belong to the same subsystem and have the same index (their TPMs must be the same in that case, so this method doesn’t need to check TPM equality).

Labels are for display only, so two equal nodes may have different labels.

to_json()
pyphi.node.default_label(index)

Default label for a node.

pyphi.node.default_labels(indices)

Default labels for serveral nodes.

pyphi.node.generate_nodes(subsystem, indices=None, labels=False)

Generate the Node objects for these indices.

Parameters:

subsystem (Subsystem) – The subsystem for which nodes are being generated.

Keyword Arguments:
 
  • indices (tuple[int]) – Used by MacroSubsystem to force generation to use certain indices.
  • labels (bool) – If True, nodes will be labeled with the labels of the network. (This is also used by macro systems to keep labels from being mixed up when many micro elements are combined into one macro element.)
Returns:

tuple[|Node|] – The nodes of the Subsystem.

pyphi.node.expand_node_tpm(tpm)

Broadcast a node TPM over the full network.

This is different from broadcasting the TPM of a full system since the last dimension (containing the state of the node) is unitary – not a state- tuple.