Upload nonlinear amplitude transformation demo - #1738
Conversation
|
👋 Hey, looks like you've updated some demos! 🐘 Don't forget to update the Please hide this comment once the field(s) are updated. Thanks! |
drdren
left a comment
There was a problem hiding this comment.
Try to fix pip install
drdren
left a comment
There was a problem hiding this comment.
Remove pip install
drdren
left a comment
There was a problem hiding this comment.
Add pip install pyqsp
| def MultiControlledZ(wires, control_values=None): | ||
| if control_values is None: | ||
| control_values = [0] * (len(wires) - 1) | ||
| qml.ctrl(qml.Z(wires=wires[-1]), | ||
| control=wires[:-1], | ||
| control_values=control_values) | ||
|
|
||
| # R_gate implements the reflection R used in the block construction. | ||
| def R(wires): | ||
| assert len(wires) % 2 == 1 | ||
| n = len(wires)//2 | ||
| qml.PauliX(wires=wires[0]) | ||
| MultiControlledZ(wires=wires[1:n+1]+[wires[0]]) | ||
| qml.PauliX(wires=wires[0]) |
There was a problem hiding this comment.
Take a look to qml.Reflection(wires)
That should replace all this code 😄
| def ProjCtrlPhaseShift(control_wires, target_wire, phi): | ||
| qml.MultiControlledX(wires=control_wires + target_wire, | ||
| control_values=[0] * len(control_wires)) | ||
| qml.RZ(phi = 2 * phi, wires=target_wire) | ||
| qml.MultiControlledX(wires=control_wires + target_wire, | ||
| control_values=[0] * len(control_wires)) |
There was a problem hiding this comment.
I don't think they are equivalent. I tested it numerically and they both apply different phase patterns.
drdren
left a comment
There was a problem hiding this comment.
Remove pip install pyqsp
Your preview is ready 🎉!You can view your changes here
|
drdren
left a comment
There was a problem hiding this comment.
Fix figure formatting
|
Hi @josh146 , we are finalising this demo so that @rishabh-gupta28 's collaborators can review it. I think the earliest release date is in September. |
drdren
left a comment
There was a problem hiding this comment.
Hi @rishabh-gupta28 , I left some comments suggesting how to rework some parts of the demo, as we discussed. It is an excellent demo that I am confident people will want to read. Let me know your thoughts!
…demo.py Co-authored-by: drdren <104710745+drdren@users.noreply.github.com>
…demo.py Co-authored-by: drdren <104710745+drdren@users.noreply.github.com>
Co-authored-by: drdren <104710745+drdren@users.noreply.github.com>
Co-authored-by: drdren <104710745+drdren@users.noreply.github.com>
Co-authored-by: drdren <104710745+drdren@users.noreply.github.com>
Co-authored-by: drdren <104710745+drdren@users.noreply.github.com>
Co-authored-by: drdren <104710745+drdren@users.noreply.github.com>
rishabh-gupta28
left a comment
There was a problem hiding this comment.
@drdren I went through all your suggested changes and approved all of them without any changes as they are already perfect!
Co-authored-by: drdren <104710745+drdren@users.noreply.github.com>
| "username": "georgepwhuang" | ||
| }, | ||
| { | ||
| "username": "hyizhak" |
There was a problem hiding this comment.
We must add Patrick's handle too.
Before submitting
Please complete the following checklist when submitting a PR:
Ensure that your tutorial executes correctly, and conforms to the
guidelines specified in the README.
Remember to do a grammar check of the content you include.
All tutorials conform to
PEP8 standards.
To auto format files, simply
pip install black, and thenrun
black -l 100 path/to/file.py.When all the above are checked, delete everything above the dashed
line and fill in the pull request template.
Title:
Summary:
Relevant references:
Possible Drawbacks:
Related GitHub Issues:
If you are writing a demonstration, please answer these questions to facilitate the marketing process.
GOALS — Why are we working on this now?
Eg. Promote a new PL feature or show a PL implementation of a recent paper.
AUDIENCE — Who is this for?
Eg. Chemistry researchers, PL educators, beginners in quantum computing.
KEYWORDS — What words should be included in the marketing post?
Which of the following types of documentation is most similar to your file?
(more details here)