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

Bug when applying CNOT in reverse #39

Closed
ba2tro opened this issue Sep 7, 2023 · 0 comments · Fixed by qojulia/QuantumOpticsBase.jl#133
Closed

Bug when applying CNOT in reverse #39

ba2tro opened this issue Sep 7, 2023 · 0 comments · Fixed by qojulia/QuantumOpticsBase.jl#133

Comments

@ba2tro
Copy link
Member

ba2tro commented Sep 7, 2023

Applying CNOT2->1 to states |01> and |10> returns |01> and |11> respectively. It returns correct answer for other 2 qubit combinations though and works correctly when doing CNOT1->2.

using QuantumSavory

ra = Register(1)
rb = Register(1)

initialize!((rb[1], ra[1]), L0L1) ## |01⟩
ra.staterefs[1].state[]

apply!((ra[1], rb[1]), CNOT) ## correct: |11⟩ gives: |01⟩ (no change)
ra.staterefs[1].state[]

Shows up in #34

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

Successfully merging a pull request may close this issue.

1 participant