shiavm006 opened a new issue, #608:
URL: https://github.com/apache/mahout/issues/608

   ### Description
   
   The Cirq backend crashes when attempting to add measurements to a circuit 
with zero qubits. The `execute_circuit` function in `cirq_backend.py` calls 
`cirq.measure(*circuit.all_qubits())` on empty circuits, which raises an error 
because you cannot measure an empty list of qubits.
   
   ### Steps to Reproduce
   
   1. Create a QuMat instance with Cirq backend
   2. Create an empty circuit with 0 qubits
   3. Call `execute_circuit()` directly on the backend (bypassing the main 
QuMat wrapper)
   
   **Example code:**
   from qumat import QuMat
   
   config = {
       "backend_name": "cirq",
       "backend_options": {"shots": 1024}
   }
   qumat = QuMat(config)
   qumat.create_empty_circuit(0)
   
   
   ### Actual Behavior
   
   Crashes with backend-specific error when attempting to call 
`cirq.measure(*[])` on an empty qubit list. The error message is cryptic and 
doesn't explain the root cause (0 qubits).
   
   


-- 
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]

Reply via email to