Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/releases/changelog-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@

This fix enables automatic qubit management to be used with gradients.


* Fixed the :func:`~.passes.commute_ppr` pass incorrectly modifying operands of PPRs that live in
different blocks.
[(#2267)](https://github.com/PennyLaneAI/catalyst/pull/2267)

* The `--inline-nested-module` pass no longer renames external function declarations.
[(#2244)](https://github.com/PennyLaneAI/catalyst/pull/2244)

Expand Down
6 changes: 5 additions & 1 deletion mlir/lib/QEC/Transforms/CommutePPR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@ void moveCliffordPastNonClifford(const PauliStringWrapper &lhsPauli,

// Update the use of value in newRHSOperands
for (unsigned i = 0; i < newRHSOperands.size(); i++) {
newRHSOperands[i].replaceAllUsesExcept(nonCliffordOp.getOutQubits()[i], nonCliffordOp);
newRHSOperands[i].replaceUsesWithIf(
nonCliffordOp.getOutQubits()[i], [&](OpOperand &operand) {
return operand.getOwner() != nonCliffordOp &&
operand.getOwner()->getBlock() == lhs->getBlock();
});
}

rewriter.replaceOp(rhs, rhs.getInQubits());
Expand Down