PennyLaneAI / PennyLaneAI/catalyst

`adjoint-lowering` pass is unable to handle non-`Quantum` dialect ops

Open
#2,934 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Following on from #2932, the same test case reveals a different error due to the algorithm being written to only handle quantum dialect ops. If the user converts to the PBC dialect, the pass will fail.

@qp.qjit
@qp.transforms.ppr_to_ppm
@qp.transforms.to_ppr
@qp.qnode(qp.device("null.qubit", wires=1))
def circuit():
   qp.adjoint(lambda: qp.S(0))()
   return qp.probs()
catalyst.utils.exceptions.CompileError: catalyst failed with error code -6: Assertion failed: (result && "expected 'from' to be contained within the map"), function lookup, file IRMapping.h, line 74.

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

Start with the adjoint-lowering pass and reproduce the provided circuit, including conversion to the PBC dialect. Trace the failing IRMapping lookup and determine how the pass handles non-Quantum dialect operations; done means the example compiles without the assertion failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.