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

dispatch(Ry(0), :random) is not working correctly #480

Open
simonschnake opened this issue Oct 4, 2023 · 1 comment
Open

dispatch(Ry(0), :random) is not working correctly #480

simonschnake opened this issue Oct 4, 2023 · 1 comment

Comments

@simonschnake
Copy link

Dear all,

dispatch(Ry(0), :random)

is setting the angle theta in the range of [0, 1], which is probably not wanted.

Thank you
Simon

@GiggleLiu
Copy link
Member

Hi, thanks for the issue. The following patch would immediately fix the issue:

julia> Yao.render_params(r::RotationGate, ::Val{:random}) = (rand()*2π,)

Do you think we should merge it to Yao so that it can be the default behavior? I am a bit worried that users would think this behavior can be not very predictable. For example, the time evolution block still generate random t in range [0, 1] for no reason.

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

2 participants