QuantumBFS / Yao.jl

Extensible, Efficient Quantum Algorithm Design for Humans.

Home Page:https://yaoquantum.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

H not working

itsdfish opened this issue · comments

Hi,

Thank you for putting this package together. I was hoping to use it to learn about quantum circuits. Unfortunately, I noticed many things do not work any more, including the tutorial and some examples in the plotting companion package. For example, the following does not work:

chain(put(2, 1=>chain(X, H)), control(2, -1, 2=>X))

However, it works when H is replaced with HGate:

chain(put(2, 1=>chain(X, HGate())), control(2, -1, 2=>X))

Presumably, an alias for HGate was deleted.

Given that X, H, etc. are common, it might be worth considering to give users the option to export into the main environment.

Hi, thanks for the issue! However, I'm not able to reproduce your mistake, unfortunately. Your first code block works perfectly on my laptop. I suspect this is because you have some local variable is defined with the name H.

I'm sorry for the false alarm. You are right. I had a variable already named H in a hidden Pluto cell. I normally use VSCode, so I failed to consider that possibility. I will close this issue. I also opened an issue with YaoPlots.jl, and was able to reproduce that result in a clean environment.