PennyLaneAI / PennyLaneAI/catalyst

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

Open
#1,655 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug frontend
Dominant language
Python
Stars
234
Forks
84
Avg merge
2d 15h
Merged PRs (30d)
66

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the circuit from the issue on the null.qubit device, keeping both qml.adjoint and qml.ctrl applied to qml.T. Trace how the operation is represented after these transforms and compare it with cases where either transform is removed. Done means the combined operation remains a named T operation rather than becoming a matrix operation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.