Skip to content
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

📝 Add documentation for ZX-calculus package and C++ API docs setup #817

Merged
merged 53 commits into from
Feb 26, 2025

Conversation

pehamTom
Copy link
Contributor

@pehamTom pehamTom commented Jan 27, 2025

Description

This PR introduces documentation for the C++ ZX-calculus library.
It also adds the general infrastructure for C++ API documentation as part of the MQT Core project based on Doxygen and the breathe extension.

Fixes #813

This change addresses concerns about missing documentation that came up in the revision openjournals/joss-reviews#7478.

Checklist:

  • The pull request only contains commits that are related to it.
  • I have added appropriate tests and documentation.
  • I have made sure that all CI jobs on GitHub pass.
  • The pull request introduces no new warnings and follows the project's style guidelines.

Sorry, something went wrong.

Copy link

codecov bot commented Jan 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.3%. Comparing base (2c02f80) to head (9c7cb09).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main    #817   +/-   ##
=====================================
  Coverage   92.3%   92.3%           
=====================================
  Files        127     127           
  Lines      13556   13555    -1     
  Branches    2086    2086           
=====================================
+ Hits       12520   12522    +2     
+ Misses      1036    1033    -3     
Flag Coverage Δ
cpp 92.1% <100.0%> (+<0.1%) ⬆️
python 99.7% <ø> (ø)
Files with missing lines Coverage Δ
...nclude/mqt-core/datastructures/SymmetricMatrix.hpp 100.0% <ø> (ø)
include/mqt-core/dd/CachedEdge.hpp 84.2% <ø> (ø)
include/mqt-core/dd/ComputeTable.hpp 100.0% <ø> (ø)
include/mqt-core/dd/Edge.hpp 94.1% <ø> (ø)
include/mqt-core/dd/Operations.hpp 75.5% <ø> (ø)
include/mqt-core/dd/Package.hpp 96.8% <ø> (+<0.1%) ⬆️
include/mqt-core/dd/UniqueTable.hpp 97.1% <ø> (ø)
include/mqt-core/ir/QuantumComputation.hpp 100.0% <ø> (ø)
include/mqt-core/ir/operations/Expression.hpp 92.7% <100.0%> (ø)
include/mqt-core/qasm3/Exception.hpp 53.8% <ø> (ø)
... and 8 more

... and 1 file with indirect coverage changes

@burgholzer burgholzer added documentation Improvements or additions to documentation ZX Anything related to the ZX package c++ Anything related to C++ code labels Jan 27, 2025
@burgholzer burgholzer added this to the ZX Package Improvements milestone Jan 27, 2025
@burgholzer burgholzer changed the title Add documentation for ZX-calculus package. 📝 Add documentation for ZX-calculus package. Jan 27, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Copy link
Member

@burgholzer burgholzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These look phenomenal ✨ many thanks for taking the time to add these docstrings!
I just browsed through them and added a couple of inline comments where I noticed that something might be slightly off. Hope these help.

Looking forward to seeing this in the online documentation!

pehamTom and others added 8 commits January 31, 2025 10:16

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Co-authored-by: Lukas Burgholzer <[email protected]>
Signed-off-by: Tom Peham <[email protected]>
Co-authored-by: Lukas Burgholzer <[email protected]>
Signed-off-by: Tom Peham <[email protected]>

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Co-authored-by: Lukas Burgholzer <[email protected]>
Signed-off-by: Tom Peham <[email protected]>

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
We use Doxygen and Breathe to include the C++ API.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@pehamTom pehamTom marked this pull request as ready for review February 25, 2025 22:22
this breaks sphinx-autobuild and creates an endless loop.
Doxygen is now run once when the `docs` session is started or if the documentation build is running on RtD

Signed-off-by: burgholzer <[email protected]>
Signed-off-by: burgholzer <[email protected]>
it would really help if these examples were executed similarly to the Python notebooks...

Signed-off-by: burgholzer <[email protected]>
Signed-off-by: burgholzer <[email protected]>
…everted)"

This reverts commit fa93c9f.
Copy link
Member

@burgholzer burgholzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright. I played around with this a little more, tweaked a couple of things, and fixed a couple of smaller errors in the guide as well the general documentation.

To be honest, I am not yet fully happy with the Doxygen+Breathe solution here for the C++ API docs. Mostly because the resulting documentation lacks a lot of the structure that Doxygen actually provides in their HTML standalone builds and which I like very much.
However, I spent much more time today than I am willing to admit to find better alternatives, without much success. It seems that this is the current best practise for how to do this kind of documentation and better tooling needs to be developed first.

And regardless of whether this is the "perfect" solution, it is a big step forward in terms of documentation for the project and this PR most definitely has fulfilled its purpose.
I especially like the short, but on point, quickstart guide here.

Long story short: thank you for your work on this 🙏🏼. let's get it in now 🚀
Polishing the source code documentation and its presentation will be an ongoing effort over the coming weeks and months 🙌🏼

@burgholzer burgholzer enabled auto-merge (squash) February 26, 2025 20:25
@burgholzer burgholzer changed the title 📝 Add documentation for ZX-calculus package. 📝 Add documentation for ZX-calculus package and C++ API docs setup Feb 26, 2025
@pehamTom pehamTom disabled auto-merge February 26, 2025 20:36
@pehamTom pehamTom enabled auto-merge (squash) February 26, 2025 20:38
@burgholzer burgholzer disabled auto-merge February 26, 2025 20:53
@burgholzer burgholzer enabled auto-merge (squash) February 26, 2025 20:56
@burgholzer burgholzer merged commit 9d8cfd5 into main Feb 26, 2025
31 checks passed
@burgholzer burgholzer deleted the zx-docs branch February 26, 2025 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Anything related to C++ code documentation Improvements or additions to documentation ZX Anything related to the ZX package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📝 Add documentation for ZX package
2 participants