Skip to content

Commit 8321f02

Browse files
Debug
1 parent 8eb9883 commit 8321f02

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/qtensornetwork.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,6 @@ bool QTensorNetwork::ForceM(bitLenInt qubit, bool result, bool doForce, bool doA
275275

276276
// Insert terminal measurement.
277277
measurements[layerId][qubit] = toRet;
278-
279-
if (!layerId) {
280-
return toRet;
281-
}
282278

283279
// If no qubit in this layer is unmeasured, we can completely telescope into classical state preparation.
284280
std::vector<bitLenInt> nonMeasuredQubits;
@@ -297,8 +293,7 @@ bool QTensorNetwork::ForceM(bitLenInt qubit, bool result, bool doForce, bool doA
297293

298294
// Erase all of the previous layers.
299295
std::map<bitLenInt, bool> m = measurements[layerId];
300-
const size_t lidMin1 = layerId - 1U;
301-
for (size_t i = 0U; i < lidMin1; ++i) {
296+
for (size_t i = 0U; i < layerId; ++i) {
302297
circuit.erase(circuit.begin() + layerId - i);
303298
measurements.erase(measurements.begin() + layerId - i);
304299
}

0 commit comments

Comments
 (0)