yuewuo / fusion-blossom

A fast minimum-weight perfect matching solver for quantum error correction
MIT License
64 stars 16 forks source link

visualization.py #39

Open AbdullahKazi500 opened 6 months ago

AbdullahKazi500 commented 6 months ago

this PR addresses the issue by embedding the visualization directly within a Jupyter Notebook cell, eliminating the need for a separate local server and browser tab to view the visualization. Let's break down how it achieves this:

HTML templates for displaying the decoding hypergraph and the parity matrix. These templates contain placeholders for JavaScript code that will render the visualizations.

The display() function from IPython is used to embed HTML code within the Jupyter Notebook cell. This allows the visualization to be rendered directly within the notebook environment.

Within the HTML templates, JavaScript code is included to render the visualizations. This code may interact with external libraries or data sources to generate the visualizations dynamically.

By executing the provided Python code within a Jupyter Notebook cell, users can easily view the visualizations without the need for a separate server or browser tab. The visualizations are integrated seamlessly into the notebook workflow, allowing for efficient exploration and analysis.

This approach migrates the visualization tool to use IPython embedding, which enables easy visualization within Jupyter Notebook. It leverages the flexibility of IPython's display capabilities to embed complex visualizations directly into notebook cells.

AbdullahKazi500 commented 6 months ago

Fixes #33

yuewuo commented 6 months ago

Fixes #33

Hi, simply copying the visualization.py does not fix the issue. It requires adapting the existing visualization code (the standalone HTML and javascript) to the new visualization code (webpack-based with compression) so that it can be embedded into jupyter notebook. The python file is just an example of how to inject object into the notebook, but what it injects is an example instead of the visualization tool.

AbdullahKazi500 commented 6 months ago

thanks will have a look @yuewuo