Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yao tutorial Pluto notebook: manual cell execution anomaly #341

Open
hros opened this issue Mar 13, 2022 · 2 comments
Open

Yao tutorial Pluto notebook: manual cell execution anomaly #341

hros opened this issue Mar 13, 2022 · 2 comments

Comments

@hros
Copy link

hros commented Mar 13, 2022

I started going through Yao's tutorial notebooks, and I noticed something peculiar when running the application tutorial in Pluto:
If I rerun the cell with the command state(a) (by pressing Shift+Enter) the result changes to (approximately) |00> instead of (|00>+|11>)/\sqrt 2
I know that Pluto is reactive, and usually there should not be any reason to rerun a cell, but... it still seems strange (naturally, this doesn't happen in the REPL)
Other cells in this notebook seem to be OK with reexecution by Shift+Enter. Except for the other state cell, which is state(q1) which also causes the output to change to approximately |00> instead of precisely |00>.
If I change the value of q1, it causes the output of reexecution of state(a) to change to that value. It seems that the somehow q1 is being parsed instead of q1 |> bellcircuit

@GiggleLiu
Copy link
Member

GiggleLiu commented Mar 13, 2022

FYI, the best place to get started is: https://arxiv.org/abs/1912.10877

We really need to polish the online documentations of Yao. The pluto checks your variable dependency and re-evaluate cells automatically, it is not very compatible with inplace operations because the change of variables is implicit.

e.g. instead of using inplace apply q1 |> bellcircuit, use q2 = apply(q1, bellcircuit) will make pluto update correctly.
We are sorry that Yao's |> does not follow the standard convension. It is a legacy issue which is hard to change now.

@VarLad
Copy link
Contributor

VarLad commented Mar 22, 2022

@hros Thanks for reporting!
I do have an update, but I need more time to get it together.
(Its long overdue at this point....)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants