Conversation
94c447a to
356abee
Compare
| inlined = _quantum_opt( | ||
| "--inline=inlining-threshold=4294967295", # Use uint max to indicate always inline | ||
| "--mlir-print-op-generic", | ||
| stdin=str(module), | ||
| ) |
There was a problem hiding this comment.
Seems that the always-inline pass doesn't reach func.calls nested inside qref.ctrl / adjoint regions, so pjit helpers survive there. whether those ops implement RegionBranchOpInterface/the inliner interface, or whether inlining should run before ctrl/adjoint wrapping?
In one of my workflow compilation I saw _right_givens_jax survives — and every failing loc is ctrl/… or adjoint/… prefixed (ctrl/jit(angle), adjoint/jit(remainder), ctrl/adjoint/for/body/jit(allclose)).
There was a problem hiding this comment.
https://github.com/PennyLaneAI/catalyst/blob/main/mlir/test/QRef/InlineTest.mlir are you sure? There are tests for calls in adjoint and control regions
There was a problem hiding this comment.
https://github.com/PennyLaneAI/catalyst/blob/main/mlir/test/QRef/InlineTest.mlir are you sure? There are tests for calls in adjoint and control regions
I'm not so sure now since my local branch also changed a lot since last time I reported this 😆
There was a problem hiding this comment.
Let me take a second look
…st into decomp/xas-misc-fixes
| """Return a dictionary of wire arg names to lengths.""" | ||
| wire_lens = {} | ||
| for wire_name, wire_arg in sorted(self.op.wire_args.items()): | ||
| if wire_name not in self.op.hybrid_argnames: |
There was a problem hiding this comment.
| if wire_name not in self.op.hybrid_argnames and len(wire_arg) > 0: |
When compiling EELS, I saw SumOfSlatersPrep with an identification_wires register that legitimately has zero wires — required_register_sizes returns 0 for these index sets. Python's parse_wire_lens still writes it into the ID as identification_wires:0, but the compiler builds its ID from qubit operands, and an empty register contributes none, so it leaves the entry out entirely. The two IDs never match, the sos_state_prep rule ends up registered against a node no operator instance maps to, and the solver reports "Decomposition rule not found for SumOfSlatersPrep"
I tried skipping empty register here and EELS works. But not sure if this is a proper fix without bad side effects @maliasadi
There was a problem hiding this comment.
I mean the MLIR op cannot have a qubit_index name that is indexing nothing 😅
Context:
Miscellaneous fixes found out while testing XAS.