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] Drawing certain kron operations fails due to a bug in fill_identities #586

Closed
jpmoutinho opened this issue Oct 16, 2024 · 0 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@jpmoutinho
Copy link
Collaborator

jpmoutinho commented Oct 16, 2024

Short description

The function fill_identities fails when doing kron(CNOT(0, 2)) because it adds one extra identity than what is needed and then the kron function fails to build the KronBlock because there is overlapping support. The function fill_identities is called by the drawing module so that the proper spacings between blocks are included in the drawing.

What is the expected result?

No response

What is the actual result?

No response

Steps/Code to reproduce

Initially noticed when trying to display an hea on a different qubit support. E.g.,

from qadence import *
from qadence.draw import display

display(hea(n_qubits = 2, support = (0, 2)))

but can be reproduced simply with

display(kron(CNOT(0, 2)))

This relates to issue #211, and is one more reason why fill_identities might need a proper refactor.

I considered fixing this by having kron(CNOT(0, 2)) just return a CNOT and not a KronBlock but that is not backwards compatible and could cause other isses. I initially opened an MR here but it is now closed: #585

Tracebacks (optional)

No response

Environment details (optional)

No response

Would you like to work on this issue?

Yes

@jpmoutinho jpmoutinho added the bug Something isn't working label Oct 16, 2024
@jpmoutinho jpmoutinho self-assigned this Oct 16, 2024
@jpmoutinho jpmoutinho closed this as not planned Won't fix, can't repro, duplicate, stale Nov 15, 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