PennyLaneAI / PennyLaneAI/catalyst
`adjoint-lowering` pass is unable to handle non-`Quantum` dialect ops
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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