Skip to content

Using both qml.ctrl and qml.adjoint causes named operations to execute as matrix operations #1655

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

Open
jzaia18 opened this issue Apr 16, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@jzaia18
Copy link
Contributor

jzaia18 commented Apr 16, 2025

Running the following circuit:

def small_circ():
    op = qml.T(0)
    op = qml.adjoint(op)
    op = qml.ctrl(op, control=1, control_values=[1])

    return qml.state()

using null.qubit as the device executes a matrix operation instead of the named gate. Removing either the adjoint or the controlled makes the gate named again (and applies a T gate with either inverse=True or control_wires having data), but the presence of both makes it a matrix op and not a named op.

@jzaia18 jzaia18 added the bug Something isn't working label Apr 16, 2025
@dime10 dime10 changed the title [BUG] Using both qml.ctrl and qml.adjoint causes named operations to execute as matrix operations Using both qml.ctrl and qml.adjoint causes named operations to execute as matrix operations Apr 21, 2025
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