-
-
Notifications
You must be signed in to change notification settings - Fork 166
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
Frontend/Backend docs clean up #2124
Conversation
the `doc` role is more suited for the purposes here of linking to pages. If one wishes to link to a specific section, the `ref` role would be the way to go. Here we were mostly only using `ref` superficially to link to headers. If that's the case linking to the document itself makes most sense.
this ensures proper format when using `jupytext` to convert between markdown and notebook formats (e.g. ipynb)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2124 +/- ##
=======================================
Coverage 98.21% 98.21%
=======================================
Files 87 87
Lines 4150 4150
=======================================
Hits 4076 4076
Misses 74 74 ☔ View full report in Codecov by Sentry. |
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.
LGTM! Thanks for fixing the issue and for the overall cleaning.
In short, a frontend is the tool used to write a quantum program, and a backend is the tool that executes said program. | ||
What follows is more detailed information as to how these concepts are handled in Mitiq. |
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.
Good!
@@ -1,7 +1,7 @@ | |||
--- | |||
jupytext: | |||
text_representation: | |||
extension: .myst | |||
extension: .md |
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.
Thanks for fixing all the extensions. Now files are correctly opened by Jupyter Notebook + jupytext
.
@@ -70,7 +69,7 @@ the expectation value to mitigate. This function will: | |||
2. Run the circuit. | |||
3. Convert from raw measurement statistics (or a different output format) to an expectation value. | |||
|
|||
For information on how to define more advanced executors, see the {ref}`Executors <guide/executors/executors>` section of the Mitiq user guide. | |||
For information on how to define more advanced executors, see the {doc}`../guide/executors` section of the Mitiq user guide. |
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.
What is the main difference between {ref} and {doc} ?
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.
Great question! I had to figure that out too.
- The
{ref}
role is an all-purpose link-creating-tool for creating references to documents and labeled sections of documents (e.g. an anchor within a specific page). - The
{doc}
role is specifically made for referencing local documents only (no external documents, and no anchors/sections/equations/images/etc). One thing to note here with{doc}
, is that if we do not pass text in for the link, it uses the title of the page we are linking to. - It's worth mentioning that both of these can be achieved with markdown links
[text](link)
as well, so why bother with either of these roles? When using{ref}
and{doc}
, we are providing sphinx with more information than it would get otherwise, and is able to some magic and make our lives easier. I'm not totally clear on what, but I think it makes refactoring easier as sphinx will know that specific references are broken using this syntax.
As for why sphinx has both {doc}
and {ref}
, I'm not sure. It does seem a bit redundant to me. Why not just have the more powerful one? That said, I always like the idea of using the simplest solution to a problem, and that includes using the simplest available tool.
Description
This PR started with the intention of clarifying some language about frontend/backend compatibility as per #1313, but I found the language to be quite clear. So I used this as an opportunity to clean up some of the code, as well as to ensure all our docs work well with
jupytext
by correctly setting theextension
in the jupytext metadata.fixes #1313