Skip to content

Commit 2e5d350

Browse files
committed
fix
1 parent 38e22d0 commit 2e5d350

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

mlir/lib/Quantum/Transforms/DecomposeLoweringPatterns.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,10 @@ class OpSignatureAnalyzer {
281281
newResults.emplace_back(extractOp.getResult());
282282
}
283283

284-
if (signature.needAllocQreg) {
285-
rewriter.create<quantum::DeallocOp>(callOp.getLoc(), qreg);
286-
}
284+
// FIXME: Dealloc should be fine, but it will cause the error in lightning now
285+
// if (signature.needAllocQreg) {
286+
// rewriter.create<quantum::DeallocOp>(callOp.getLoc(), qreg);
287+
// }
287288

288289
return newResults;
289290
}

mlir/test/Quantum/DecomposeLoweringTest.mlir

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ module @cz_hadamard {
121121
// CHECK: [[INSERT_CZ2:%.+]] = quantum.insert [[INSERT_CZ1]][[[EXTRACTED]]], [[H2]] : !quantum.reg, !quantum.bit
122122
// CHECK: [[FINAL_EXTRACT1:%.+]] = quantum.extract [[INSERT_CZ2]][ 0] : !quantum.reg -> !quantum.bit
123123
// CHECK: [[FINAL_EXTRACT2:%.+]] = quantum.extract [[INSERT_CZ2]][ 1] : !quantum.reg -> !quantum.bit
124-
// CHECK: quantum.dealloc [[INSERT_CZ2]] : !quantum.reg
125124
// CHECK-NOT: quantum.custom "CNOT"
126125
%out_qubits:2 = quantum.custom "CNOT"() %2, %3 : !quantum.bit, !quantum.bit
127126

0 commit comments

Comments
 (0)