qml
qml copied to clipboard
Demo on measurement-based quantum computation
Before submitting
Please complete the following checklist when submitting a PR:
-
[x] Ensure that your tutorial executes correctly, and conforms to the guidelines specified in the README.
-
[x] Add a thumbnail link to your tutorial in
beginner.rst, or if a QML implementation, inimplementations.rst. -
[x] All QML tutorials conform to PEP8 standards. To auto format files, simply
pip install black, and then runblack -l 100 path/to/file.py.
Title: Measurement-based quantum computation
Summary: A demo on measurement-based quantum computation
Relevant references:
- https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.86.5188
- https://quantum-journal.org/papers/q-2021-02-04-392/
Possible Drawbacks: None
Related GitHub Issues: None
Thank you for opening this pull request.
You can find the built site at this link.
Deployment Info:
- Pull Request ID:
485 - Deployment SHA:
e8d3df1cd3a262e62f1ea6061d810c325f1454ca(TheDeployment SHArefers to the latest commit hash the docs were built from)
Note: It may take several minutes for updates to this pull request to be reflected on the deployed site.
Some additional resources:
- https://phas.ubc.ca/~raussen/Supplements/VideoLectures.html
- https://arxiv.org/pdf/1711.04921.pdf
@radras we could consider using FlamingPy to visualize cluster states. In particular, in the fault tolerant section where we need 3D cluster states 👀 If yes, we should add it to the requirements.txt (or whatever they have here)
@KetpuntoG or @CatalinaAlbornoz, can one of you add @isschoch and @mauriceweber as reviewers here?
Cannot wait to learn some cool stuff about MBQC!
Hey! I cannot pass on the review to the next person until you complete the TODO's Can you take a look at them? 🙂
We're working on it @KetpuntoG 😌
Hey it's ready for another review. I have one questions about formatting though:
- Can I combine references into one pair of brackets? I have a couple of places where we reference multiple papers but it comes out as [1] [2] [3]. It would be nice to have something like [1, 2, 3] as per usual.
Hey it's ready for another review. I have one questions about formatting though:
- Can I combine references into one pair of brackets? I have a couple of places where we reference multiple papers but it comes out as [1] [2] [3]. It would be nice to have something like [1, 2, 3] as per usual.
Thanks! Not to my knowledge. It is something that appears in other demos. If I find out, I'll let you know 👌
Ready for another review @KetpuntoG
For the dual/primal plot I used this:
from flamingpy.codes import SurfaceCode
from plotly.subplots import make_subplots
import plotly.graph_objects as go
# RHG lattice
RHG = SurfaceCode(3)
# Layout
size = 450
fig = make_subplots(rows=1, cols=2,
specs=[[{'type':'scene'}, {'type':'scene'}]],
column_titles=["Primal", "Dual"],
horizontal_spacing = 0.02)
fig.update_layout(width=1.75*size, height=size)
# Primal
z = 3
fig1 = RHG.draw(backend="plotly", label=["type"], showbackground=True, width=size, height=size)
fig.update_layout(scene = dict(zaxis = {'nticks': 2, 'range': [z-0.5, z+0.5], 'dtick':1, "showspikes":False}), showlegend=False)
fig.update_layout(scene = dict(xaxis = {'dtick':1, "showspikes":False}))
fig.update_layout(scene = dict(yaxis = {'dtick':1, "showspikes":False}))
fig.add_trace(fig1.data[0], row=1, col=1)
fig.add_trace(fig1.data[1], row=1, col=1)
# Dual
z = 2
fig2 = RHG.draw(backend="plotly", label=["type"], showbackground=True, width=size, height=size)
fig.get_subplot(1,2)['zaxis'].update({'nticks': 2, 'range': [z-0.5, z+0.5], "showspikes":False})
fig.get_subplot(1,2)['xaxis'].update({'dtick':1, "showspikes":False})
fig.get_subplot(1,2)['yaxis'].update({'dtick':1, "showspikes":False})
fig.add_trace(fig2.data[0], row=1, col=2)
fig.add_trace(fig2.data[1], row=1, col=2)
# Showing figure
fig.show(width=size, height=size)
# Saving figure
fig.write_image("primal_dual.jpeg")
fig.write_html("primal_dual.html")

@KetpuntoG @isaacdevlugt I addressed all the comments. There are little things that @radras might want to address still, but I don't think they are strictly necessary. We could always update the demo in the future. I will leave the finalisation in your capable hands 👍🏼
Don't worry about updating the branch @soosub , the demo is perfect 😄 when we upload it we will update everything
@KetpuntoG I was planning to address this now the FlamingPy August release is out but there seem to be some issues 🥵
@KetpuntoG I was planning to address this now the FlamingPy August release is out but there seem to be some issues 🥵
Ah okey! Let's see if Narinam answer you :)
@soosub , @radras thanks for this great demo! Tomorrow we will announce the release of this demo on Pennylane twitter 🚀