docs: add modifier documentation#182
Conversation
…ctions, modifiers on classical functions
|
@CalMacCQ I think the page is almost ready, a part of the QFT example (and a section about |
There was a problem hiding this comment.
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@CalMacCQ, I also added a Grover example. I think it is ready now. We only miss Unitary callable but I would add them when we are sure that they are not going to be experimental anymore |
|
We have to wait for Quantinuum/guppylang#2061 to be merged |
CalMacCQ
left a comment
There was a problem hiding this comment.
This is a great start. Thanks for this.
I have yet to read this thoroughly but here are some quick comments.
I'll take another look tomorrow.
Co-authored-by: Callum Macpherson <93673602+CalMacCQ@users.noreply.github.com>
|
|
||
| # Modifiers | ||
|
|
||
| Modifiers transform a block of quantum operations. They make it possible to express controlled and inverse operations without defining a separate function for each variant. |
There was a problem hiding this comment.
I would prefer more here - I think it's important to highlight that modifiers are capable of changing the typoe signature (e. g U -> ctrl -U). What is the aim of modifiers? Are they there to improve composability? Are they there to defer to the compiler instead of user defns?
|
|
||
| ## Control flow | ||
|
|
||
| When a controlled block contains control flow, the control is pushed to every quantum operation produced by the branch or loop. Evaluating the classical condition and loop bounds is not controlled. For instance, the following two programs are equivalent: |
There was a problem hiding this comment.
the guppy logic here is so clean and demonstrative you could maybe reverse this section - 'These are equivalent.. this is because classical conditioning and loops are not part of the with control modification'
There was a problem hiding this comment.
I see, but I'm sure how to organize the session 🤔
dunc-go
left a comment
There was a problem hiding this comment.
Really appreciate the effort here.
Top level comment: I think this page should be split into 3 pages.
One is a top level explanation of the syntax and general properties of modifiers and maybe function flags. Then I think each modifier (control and syntax for now) can have their own pages with their specific properties (forbiddens etc) and then finally a 3rd page with examples such the conjugation box and the grovers.
closes #98