finesse.graph.operator_graph.OperatorGraph.fix_node¶
- OperatorGraph.fix_node(self, int node, bool state)¶
Fix a node to a specific state. When True the node will not be reduced/removed from the graph.
This method fixes the specified node to the given state in the graph. If the node index is not valid, an exception is raised.
- Parameters
- nodeint
The index of the node to fix.
- statebint
The state to which the node should be fixed. This should be a boolean-like value (0 or 1).
- Raises
- Exception
If the node index is not valid (i.e., if it is less than 0 or greater than the number of nodes in the graph).