ryankert01 opened a new pull request, #975:
URL: https://github.com/apache/mahout/pull/975

   ## Problem
   
   Calling `get_final_state_vector()` on parameterized circuits failed with 
"circuits have parameters but parameter_binds is not specified" even after 
`bind_parameters()` was called.
   
   ## Root Cause
   
   `bind_parameters()` stored values in a dictionary, but 
`get_final_state_vector()` never passed them to the backend simulators.
   
   ## Solution
   
   Pass bound parameter values to each backend and apply them before simulation:
   - Qiskit: use `assign_parameters()`
   - Cirq: use `ParamResolver`
   - Braket: use `inputs` dict
   
   ## Example
   
   **Before (broken):**
   ```python
   qm.apply_rx_gate(0, 'theta')
   qm.bind_parameters({'theta': 0.5})
   qm.get_final_state_vector()  # Error!
   ```
   
   **After (works):**
   ```python
   qm.apply_rx_gate(0, 'theta')
   qm.bind_parameters({'theta': 0.5})
   qm.get_final_state_vector()  # Returns statevector
   ```


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