The "Layer" arrow in flow visualisation appears outside the plot frame for linear graphs.
In general, we expect it to be at a fixed, constant distance between the lower open graph nodes and the plot frame.
Incorrect behavior:
from graphix import OpenGraph, PauliExponential, Plane
import networkx as nx
og = OpenGraph(graph=nx.Graph([(0, 1), (1, 2), (2, 3)]), input_nodes=[0], output_nodes=[3], measurements=dict.fromkeys(range(3), Plane.XY))
flow = og.extract_causal_flow()
flow.draw()
Correct behaviour (for non-linear open graphs):
from graphix import OpenGraph, PauliExponential, Plane
import networkx as nx
og = OpenGraph(graph=nx.Graph([(0, 2), (2, 4), (1, 3), (3, 5), (2, 3)]), input_nodes=[0, 1], output_nodes=[4, 5], measurements=dict.fromkeys(range(4), Plane.XY))
flow = og.extract_causal_flow()
flow.draw()
The potential fix should make methods GraphVisualizer._set_plot_lims and GraphVisualizer._draw_layers in the visualization.py module more robust.
The "Layer" arrow in flow visualisation appears outside the plot frame for linear graphs.
In general, we expect it to be at a fixed, constant distance between the lower open graph nodes and the plot frame.
Incorrect behavior:
Correct behaviour (for non-linear open graphs):
The potential fix should make methods
GraphVisualizer._set_plot_limsandGraphVisualizer._draw_layersin thevisualization.pymodule more robust.