Copilot commented on code in PR #1072:
URL: https://github.com/apache/mahout/pull/1072#discussion_r2833699013
##########
qumat/cirq_backend.py:
##########
@@ -106,23 +107,26 @@ def execute_circuit(circuit, backend, backend_config):
shots = backend_config["backend_options"].get("shots", 1)
return [{0: shots}]
+ # Create a working copy to avoid mutating the original circuit
+ working_circuit = copy.deepcopy(circuit)
Review Comment:
The fix correctly prevents circuit mutation by creating a working copy.
However, consider adding a test case that verifies a circuit can be executed
multiple times without accumulating duplicate measurements. This would prevent
regression of issue #1069.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]