-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plotting for ZXDiagrams and ZXGraphs, Equality for ZXDiagrams and converting ZX to ZXW #102
Conversation
replace index based access with get and a default value
Hello @contra-bit , thank you very much for working on adding |
Good catch. It is not required. I only added pkg> add https://github.com/JuliaCompilerPlugins/CompilerPluginTools.jl Then I added the equivalent command to the notebook as well. Pkg.add(url="https://github.com/JuliaCompilerPlugins/CompilerPluginTools.jl")
|
@contra-bit Thanks for the PR. I suggest removing the dependency that is only used in the notebook, and keeping the main package as clean as possible. Perhaps it would be better to set up a separate environment in the |
…into feature/plots
I am thrilled to share several improvements in this pull request! I have introduced plotting functionality as an optional extension using Vega and DataFrames. This change ensures that these dependencies will only be loaded when needed, leading to faster load times and reduced memory usage. To enhance accessibility, I have updated the color scheme of spider graphs so that they are distinguishable for people with Color Vision Deficiency (CVD), and improved the readability of phase labels. For further details, kindly consult the accessibility guidelines provided at zxcalculus.com. My latest contributions enhance testing for both ZXDiagrams and ZXGraphs by adding plots to most tests, along with creating a brand-new notebook dedicated to equivalence checking and refining the existing tutorial notebook. Users will benefit from automatic generation of diagrams within these notebooks. Moreover, YaoHIR has gained the ability to import OpenQASM files, allowing seamless conversion to ZXDiagrams—providing yet another practical method to construct quantum circuits. I will try to get all my contributions merged and then update the Pkg in the notebooks. As part of my efforts, I fixed the match and apply function for the ZXGraph :id rule while adding the new equivalence checking functionality. Now, it is possible to determine if two diagrams are identical through the built-in equivalency checks. Last but not least, I took care of numerous housekeeping tasks such as updating imports, resolving problems discovered during testing, enhancing overall user experience for plots, and dealing with miscellaneous glitches |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #102 +/- ##
==========================================
+ Coverage 82.49% 89.21% +6.71%
==========================================
Files 28 30 +2
Lines 3537 3691 +154
==========================================
+ Hits 2918 3293 +375
+ Misses 619 398 -221 ☔ View full report in Codecov by Sentry. |
@contra-bit Thanks for working on this PR. It looks decent. Before merging this PR, I have only two minor suggestions.
|
FYI you don't have to use the package env for notebooks, every Pluto notebook has its own env by default. |
I hope I have fixed the indentation issues, further I have increased the test coverage and added a .JuliaFormatter.toml that species that the default indentation is 4. The notebooks are now configured to use the Yao upstream repositories. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address the feedback and resolve the notebook environment issues as pointed out by @Roger-luo
I have addressed the feedback and think this can be merged now. @ChenZhao44 Thank you for being patient. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @contra-bit , sorry for jumpping in late. I rechecked your commits based on @ChenZhao44 and @Roger-luo 's comments. There are still a few outstanding problems.
I reformatted the mentioned files by hand. Thank you for the thorough review. |
Great! This PR looks good to me. Let's see if Dr. Zhao and Dr. Luo has any further comments! |
LGTM |
Dear Maintainers,
This pull request introduces several improvements, including the addition of optional plotting functionality for ZXDiagrams and ZXGraphs and closes #101 and fixes #100. The plotting function uses Vega and DataFrames, which will only be loaded when necessary to improve load times and reduce memory usage. The color scheme of spider graphs has been updated to be more accessible for individuals with Color Vision Deficiency (CVD) and improved label readability. Further information on accessibility can be found at <https://zxcalculus.com>.
Additional testing has been implemented for both ZXDiagrams and ZXGraphs, with plots added to most tests and the creation of a new notebook focused on equivalence checking. Existing tutorial notebooks have also been refined, and users will now benefit from automated diagram generation within these notebooks.
Furthermore, the YaoHIR package has gained the capability to import OpenQASM files, enabling easy conversion from openQASM to ZXDiagrams and providing another useful approach to building. optimizing and verifying quantum circuits.
The pull request further includes various bug fixes and improvements, such as addressing issues with the match and apply function for the ZXGraph :id rule, enhancing the overall user experience for plots, resolving testing issues, and handling miscellaneous bugs.
Regards and thanks for reviewing my pull request