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] Controlled operations are not right #35

Open
chMoussa opened this issue Dec 6, 2024 · 0 comments
Open

[Bug] Controlled operations are not right #35

chMoussa opened this issue Dec 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@chMoussa
Copy link
Collaborator

chMoussa commented Dec 6, 2024

If the order between the control is before the target for cases CNOT(control=0, target=1), everything will be correct. For cases such as CNOT(control=1, target=0), this will be incorrect as the matrix should be different.

Expected output of _controlled:
CNOT(control=0, target=1)
jnp.array([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]])
and for CNOT(control=1, target=0):
jnp.array([[1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0], [0, 1, 0, 0]])

Currently, for the last case, we obtain the same as CNOT(control=0, target=1):
jnp.array([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]])

@chMoussa chMoussa added the bug Something isn't working label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant