Closed contra-bit closed 10 months ago
Dear @contra-bit,
Thank you for your PR! It is greatly helpful for maintaining the plotting support.
Currently, we have defined several different calculi in this package, including the original ZX-calculus (ZXDiagram
and ZXGraph
), the ZXWH-calculus (ZXWDiagram
) implemented by @exAClior, and also the (pW/ZW)-calculus (ZWDiagram
) that requires a planar graph data structure #99.
My plan is to only support visualizing the Multigraph
based calculi. Furthermore, I intend to utilize the weak-dependency feature that has been introduced in Julia 1.9 to include the previous plotting part. I suggest you follow the current master branch for the ZX(W)-Diagrams instead of the deprecated chen/zxwh
branch.
Please feel free to ask any questions. We could also arrange an online meeting for a more detailed discussion.
Best regards, Chen
Thank you for your answer. I think a meeting would be great for us to that align our development efforts. Did you receive my message on slack?
Based on your input, I have ignored this branch and freshly implemented the plotting functionality which this PR provides in the main branch here. All of the existing test for plots already pass.
I am currently converting the dependencies Vega and Compose et al into weak dependencies.
Regarding the tests: the notebook from this PR and the zx_plots
testfile work, yet plotting Multigraph ZXDiagram such as this fail:
g = Multigraph([0 1 0; 1 0 1; 0 1 0])
ps = [Rational(0) for i = 1:3]
v_t = [SpiderType.X, SpiderType.Z, SpiderType.X]
zxd = ZXDiagram(g, v_t, ps)
plot(zxd)
Due to the error:
LoadError: MethodError: reducing over an empty collection is not allowed; consider supplying `init` to the reducer
Is this because no gates have been added and thus there are no spiders yet? Can you take a look why this error occurs?
Before creating the PR, I would like to know:
test/zx_diagram.jl
a correct and valid ZXDiagram? In this case we should decide if we want to move the tests for the ploting directly into the tests of the different diagram types. What do you think?AbstractZDiagram
, which encompasses all diagram types?plot
to plot(diagram::AbstractZDiagram)
?I hope that the ZX or ZXW universality will allow us to build a great tool for quantum scientists, which can be applied in many different quantum research areas due to the intuitive approach to quantum theory it gives us. I am grateful and thankful for all the good work you and the team have already provided :)
Closing this PR, in favor of #102
Hello dear maintainers,
the removal of the plotting availability in YaoPlots (#100) has impeded, my research into the ZX-Calculus. I have created this PR to make plotting work and have updates the
tutorial.jl
notebook to the plot diagrams and graphs, when returned.My current goal is to work with the
chen/zxwh
branch and to have an up to date tutorial notebook that provides a brief overview of what is possible with ZX-Calculus and tests for plotting.This PR contains a patch, which adds DataFrames and Vega as dependencies. Please inform me, if you want to have the dependencies here or if they should be imported adhoc into the pluto notebook.
I disabled the test for
plot_compose
because there are a lot of undefined references. Please advise ifplot_compose
should be fixed.I did try merging this branch with the master, yet there where issues, with the Planar Multigraph Tests. Should I try to merge with #98 and then into the master?
Have I understood correctly that the plotting capabilities for ZX(W)-Diagrams and Graphs will stay in this package? Please excuse me If I have misunderstood your plans.
Thank you all for the great software which already exist and lets work together improve it even more :)
Please tell me if this PR is moving in the right direction and what you would like to improve.