Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix more numpy / mypy typing issues #5669

Merged
merged 5 commits into from
Jul 7, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix type-complaint about optional return value
  • Loading branch information
pavoljuhas committed Jul 6, 2022
commit 9669c5ad565fbbb1f748252f36aa904671ff8187
4 changes: 3 additions & 1 deletion cirq-core/cirq/circuits/circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2623,9 +2623,11 @@ def on_stuck(bad_op):
on_stuck_raise=on_stuck,
)

return protocols.apply_unitaries(
result = protocols.apply_unitaries(
unitary_ops, qubits, protocols.ApplyUnitaryArgs(state, buffer, range(len(qubits)))
)
assert result is not None, "apply_unitaries() should raise TypeError instead"
return result


def _decompose_measurement_inversions(op: 'cirq.Operation') -> 'cirq.OP_TREE':
Expand Down