qml icon indicating copy to clipboard operation
qml copied to clipboard

Demo on measurement-based quantum computation

Open soosub opened this issue 3 years ago • 15 comments

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, in implementations.rst.

  • [x] All QML tutorials conform to PEP8 standards. To auto format files, simply pip install black, and then run black -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

soosub avatar May 04 '22 21:05 soosub

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 (The Deployment SHA refers 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.

github-actions[bot] avatar May 18 '22 15:05 github-actions[bot]

Some additional resources:

  • https://phas.ubc.ca/~raussen/Supplements/VideoLectures.html
  • https://arxiv.org/pdf/1711.04921.pdf

soosub avatar Jun 01 '22 15:06 soosub

@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)

soosub avatar Jul 06 '22 20:07 soosub

@KetpuntoG or @CatalinaAlbornoz, can one of you add @isschoch and @mauriceweber as reviewers here?

soosub avatar Jul 26 '22 15:07 soosub

Cannot wait to learn some cool stuff about MBQC!

isschoch avatar Jul 26 '22 15:07 isschoch

Hey! I cannot pass on the review to the next person until you complete the TODO's Can you take a look at them? 🙂

KetpuntoG avatar Aug 17 '22 17:08 KetpuntoG

We're working on it @KetpuntoG 😌

soosub avatar Aug 17 '22 17:08 soosub

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.

soosub avatar Aug 19 '22 20:08 soosub

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 👌

KetpuntoG avatar Aug 19 '22 20:08 KetpuntoG

Ready for another review @KetpuntoG

soosub avatar Aug 19 '22 21:08 soosub

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")

primal_dual

soosub avatar Aug 23 '22 18:08 soosub

@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 👍🏼

soosub avatar Aug 26 '22 18:08 soosub

Don't worry about updating the branch @soosub , the demo is perfect 😄 when we upload it we will update everything

KetpuntoG avatar Sep 09 '22 16:09 KetpuntoG

@KetpuntoG I was planning to address this now the FlamingPy August release is out but there seem to be some issues 🥵

soosub avatar Sep 09 '22 16:09 soosub

@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 :)

KetpuntoG avatar Sep 09 '22 17:09 KetpuntoG

@soosub , @radras thanks for this great demo! Tomorrow we will announce the release of this demo on Pennylane twitter 🚀

KetpuntoG avatar Dec 05 '22 22:12 KetpuntoG