-
Notifications
You must be signed in to change notification settings - Fork 106
Description of apply / within
as part of control flow.
#939
Comments
I wonder if it may be reasonable to have a section on Q# keywords, similar to how the Python language reference lists different kinds of statements, or to how the C# language reference has a page for each keyword to help with searchability? |
@cgranade I really like this idea. Also, I keep on entering keywords into the TOC search box, even though it only filters through the TOC titles. So I guess if they had separate pages showing up in the TOC, they'd be in that search automatically. |
+@KittyYeungQ, @bettinaheim for discussion |
Figure a keyword list might be a good addition to the Quick Reference pages in the user guide. Did a quick scan through and came out with these keywords below. Figure this is a decent place to discuss, let me know if I'm missing anything. (The bold titles are just loosely what they relate to for our sake here, not a suggestion for the quick ref page structure). Types:
Vars:
Ops:
Control flow
Qubits:
Namespace:
Attributes:
Operator symbols: |
Strong +1 to @msoeken and @cgranade I keep trying to find docs for things like |
@msoeken @cgranade @efratshabtai Can you take a look at the above list and confirm if it looks good or missing anything? |
Adding @bettinaheim, since many of these are about the Q# language itself. To that effect, there's a full list of Q# keywords defined in the parser at https://github.com/microsoft/qsharp-compiler/blob/2002c55a59808d44c2fec4f862c67b5848c27816/src/QsCompiler/TextProcessor/QsKeywords.fs#L66 and https://github.com/microsoft/qsharp-compiler/blob/b77641106b8faaa9046e119dec9f704f200bce46/src/QsCompiler/DataStructures/ReservedKeywords.fs. In any case, I think the only other language-level thing that I find myself linking people to regularly is the format for documentation comments (currently at https://docs.microsoft.com/en-us/quantum/user-guide/using-qsharp/file-structure#documentation-comments, under Q# user guide → Use Q# → File structure). |
@KittyYeungQ I cannot see anything missing there. |
@KittyYeungQ looks good to me |
@gillenhaalb can you create a PR to add this? |
@KittyYeungQ Yep, will do that now. A few clarifications before I start:
|
@gillenhaalb The explanation being insufficient. I can't find any explanation for the functioning and purpose of the keywords |
For example, in the first code block of this section on Pauli measurements: https://docs.microsoft.com/en-us/quantum/concepts/pauli-measurements |
@geduardo I think the confusion (w.r.t. that example specifically) comes from their use being somewhat roughly described there (i.e. on the Pauli page). As far as I can tell from the documentation (Conjugation section), a block of
corresponds to applying So, what's actually happening in the Pauli code block is that it's applying |
I think the searchability argument is a pretty good one for splitting things up further as a reference. Can we compare to what other docs.ms docsets do? Taking a quick look:
|
That's correct; the |
I strongly agree with the searchability concern. I am often working (or on stream) and want to look up the docs for things like |
@cgranade @crazy4pi314 Thanks for the input (and links, etc.). The benefit in searchability does sound substantial---I think I'll go ahead with that route. I'll make a small PR moving the conjugations section to Control Flow, and then a separate one for the keywords pages. They'll start out relatively minimalist just to go ahead and have them all in place, and we can then discuss more in the PR what info the pages should/shouldn't have. |
No worries, happy to help! Thanks for taking this on!
Sounds like a good plan, please let me know if I can help. One suggestion I'd have as they get past the minimal stage is to include concrete examples as much as possible; ideally said examples would be pulled from the samples repo so that we can unit test and make sure that those samples stay correct as the Q# language evolves. With the new ability to draw from Jupyter Notebooks, we may be able to tie that to @guenp's suggestion at microsoft/Quantum#422 if we format the Intro to Q# sample as a Q# notebook. |
+1 to including sample code on the keyword pages. That's one of the docs improvements that (other than searchability) could have the biggest impact. |
I think this issue was solved with the new language repo. |
Conjugation is currently described as part of Operations and functions. I would have expected it (also) as part of the Control flow, where all other control flow constructs are described.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: