Skip to content

Catalyst bug for controlled reflection #751

Description

@renezander90

Priority

Medium

Responsible

No response

Qrisp Version

0.9.5

Python Version

3.11.15

Operating System

macOS

Short Description

Catalyst compile error for Qrisp example with a reflection inside of a control environment.

Steps to Reproduce

from qrisp import *

@qjit
def main():
    qb = QuantumBool()
    ctrl = QuantumBool()
    h(qb)
    h(ctrl)

    with control(ctrl, ctrl_state=0):
        reflection([qb])

    return measure(qb), measure(ctrl)

main()

CompileError: catalyst failed with error code 1: Failed to run pipeline: GradientLoweringStage
Compilation failed:
While processing 'AnnotateInvalidGradientFunctionsPass' pass Failed to lower MLIR module

Expected Behavior

No compilation error.

Actual Behavior

Compilation error.

Means of Verification

Test-ID Type Description Expected Result
T-001 Positive
T-002 Negative
T-003 Boundary
T-004 Boundary

Additional Context

No response

Definition of Done

  • Root cause identified
  • Fix implemented and peer-reviewed
  • Regression test added
  • All tests pass (CI green)
  • Changelog entry added

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions