We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a78d121 commit 88587b9Copy full SHA for 88587b9
1 file changed
qsimcirq/qsim_simulator.py
@@ -525,8 +525,10 @@ def _simulate_impl(
525
qsim_state = fullstate_simulator_fn(options, initial_state)
526
elif isinstance(initial_state, np.ndarray):
527
qsim_state = fullstate_simulator_fn(options, input_vector)
528
- assert qsim_state.dtype == np.float32
529
- assert qsim_state.ndim == 1
+ if qsim_state.dtype != np.float32:
+ raise TypeError("qsim_state must have dtype np.float32.")
530
+ if qsim_state.ndim != 1:
531
+ raise ValueError("qsim_state must be a 1D array.")
532
533
yield prs, qsim_state.view(np.complex64), cirq_order
534
0 commit comments