-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Write complete manual QuantumCircuit
documentation
#12403
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e67884f
Write complete manual `QuantumCircuit` documentation
jakelishman 9564759
Reword from review
jakelishman bb5456e
Add missing text around `Var` methods
jakelishman 36b58ff
Add example to `find_bit`
jakelishman 5cc79d7
Comment on metadata through serialization
jakelishman f6a2e50
Add see-also sections to undesirable methods
jakelishman 36b53f4
Re-add internal utilities to documentation
jakelishman 32a7669
Add examples to `depth`
jakelishman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.. _qiskit-circuit-quantumcircuit: | ||
|
||
============================== | ||
:class:`.QuantumCircuit` class | ||
============================== | ||
|
||
.. | ||
This is so big it gets its own page in the toctree, and because we | ||
don't want it to use autosummary. | ||
|
||
.. currentmodule:: qiskit.circuit | ||
|
||
.. autoclass:: qiskit.circuit.QuantumCircuit | ||
:no-members: | ||
:no-inherited-members: | ||
:no-special-members: | ||
:class-doc-from: class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Some notes if we stick with this rather than the simpler
QuantumCircuit
(no link):Despite those concerns, I think I agree with your approach here, particularly because it makes the index page more readable with
QuantumCircuit
being escaped as code and having the wordclass
. I tried to get a custom title to work inindex.rst
like '``QuantumCircuit`` class <qiskit.circuit.QuantumCircuit>', but RST doesn't like the inline formatting with `.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.
I mostly did this out of habit because I almost always put in cross-references when possible. If there's a way that works a little better, I can do that.
From my side, I don't mind the styling not being perfect immediately, if that's the remaining blocker (I'd seen it locally, too). It's a styling bug that we probably need to get fixed anyway, because I'd be surprised if it's not in use in at least some other places - I'm quite likely to have done it somewhere else in the API docs too - but it's still totally legible in the meantime, it just looks slightly odd.
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.
If we could get the
index.rst
to properly render 'QuantumCircuit
class <qiskit.circuit.QuantumCircuit>', then I would ask us to change to simplyQuantumCircuit
. But I couldn't get that working. So I think what you have is the best choice because it makes the index page more readable.Indeed, it's my biggest concern. It's always been a problem though, and we'll bump https://github.ibm.com/IBM-Q-Software/iqp-channel-docs/issues/1037 up in priority. It's a short-term bug, so I agree it's not a blocker.
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.
You mean a link where the inline code block and the word "class" are both the link text? If so: nested syntax (inline code inside a link) is (in)famously hard to do in rST. It's just about possible to hack together in some cases, but the syntax is at best arcane.
Sphinx-specific stuff is easier because that produces the nested elements by manipulating the
docutils
tree directly.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.
Yep, exactly. So, I think we should stick with how you have things.