topology¶
All modules related to topology building.
Responsible for building all possible topologies bases on basic user input:
number of initial state particles
number of final state particles
-
class
InteractionNode(type_name: str, number_of_ingoing_edges: int, number_of_outgoing_edges: int)[source]¶ Bases:
objectStruct-like definition of an interaction node.
-
class
SimpleStateTransitionTopologyBuilder(interaction_node_set: Sequence[expertsystem.topology.InteractionNode])[source]¶ Bases:
objectSimple topology builder.
Recursively tries to add the interaction nodes to available open end edges/lines in all combinations until the number of open end lines matches the final state lines.
-
build_graphs(number_of_initial_edges: int, number_of_final_edges: int) → List[expertsystem.topology.StateTransitionGraph][source]¶
-
extend_graph(graph: Tuple[expertsystem.topology.StateTransitionGraph, Sequence[int]]) → List[Tuple[expertsystem.topology.StateTransitionGraph, List[int]]][source]¶
-
-
class
StateTransitionGraph[source]¶ Bases:
objectGraph class that contains edges and nodes.
Similar to feynman graphs. The graphs are directed, meaning the edges are ingoing and outgoing to specific nodes (since feynman graphs also have a time axis) This class can contain the full information of a state transition from a initial state to a final state. This information can be attached to the nodes and edges via properties.
-
add_node(node_id: int) → None[source]¶ Adds a node with id node_id.
- Raises
ValueError – if node_id already exists
-
attach_edges_to_node_ingoing(ingoing_edge_ids: Iterable[int], node_id: int) → None[source]¶ Attach existing edges to nodes.
So that the are ingoing to these nodes.
- Parameters
- Raises
ValueError – if an edge not doesn’t exist.
ValueError – if an edge ID is already an ingoing node.
-
get_originating_node_list(edge_ids: Iterable[int]) → List[Optional[int]][source]¶ Get list of node ids from which the supplied edges originate from.
-
is_isomorphic(other: expertsystem.topology.StateTransitionGraph) → bool[source]¶ Check if two graphs are isomorphic.
- Returns
True if the two graphs have a one-to-one mapping of the node IDs and edge IDs.
- Return type
-
-
attach_node_to_edges(graph: Tuple[expertsystem.topology.StateTransitionGraph, Sequence[int]], interaction_node: expertsystem.topology.InteractionNode, ingoing_edge_ids: Sequence[int]) → Tuple[expertsystem.topology.StateTransitionGraph, List[int]][source]¶