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

Frontend/Backend docs clean up #2124

Merged
merged 4 commits into from
Dec 14, 2023
Merged

Frontend/Backend docs clean up #2124

merged 4 commits into from
Dec 14, 2023

Conversation

natestemen
Copy link
Member

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 the extension in the jupytext metadata.

fixes #1313

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)
@natestemen natestemen added the documentation Improvements or additions to documentation label Dec 13, 2023
@natestemen natestemen self-assigned this Dec 13, 2023
Copy link

codecov bot commented Dec 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0a9c202) 98.21% compared to head (601a56a) 98.21%.

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.
📢 Have feedback on the report? Share it here.

@natestemen natestemen changed the title Nts clarify fb Frontend/Backend docs clean up Dec 13, 2023
Copy link
Member

@andreamari andreamari left a 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.

Comment on lines +16 to +17
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.
Copy link
Member

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
Copy link
Member

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.
Copy link
Member

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} ?

Copy link
Member Author

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.

@natestemen natestemen merged commit 6b21429 into master Dec 14, 2023
14 of 16 checks passed
@natestemen natestemen deleted the nts-clarify-fb branch December 14, 2023 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clarify language in docs around Frontend and Backend compability
2 participants