Fix remaining mypy/numpy errors#5677
Conversation
Also drop redundant assignment to _ in the test. The apply_measurement method has no return value.
|
Partially implements #3767 |
| prng=np.random.RandomState(), | ||
| initial_state=state_vector.copy(), | ||
| dtype=state_vector.dtype, | ||
| dtype=complex_dtype, |
There was a problem hiding this comment.
in this case, since this is in the simulation direct call path, should we just do a cast here?
There was a problem hiding this comment.
Are we sure state_vector.dtype is complex?
If so we can make it simpler with cast.
There was a problem hiding this comment.
Oh I misread where this is, this is in the testing of consistent act_on. Think this is fine. Not sure we can assume state_vector dtype is complex, so this works.
| prng=np.random.RandomState(), | ||
| initial_state=state_vector.copy(), | ||
| dtype=state_vector.dtype, | ||
| dtype=complex_dtype, |
There was a problem hiding this comment.
Oh I misread where this is, this is in the testing of consistent act_on. Think this is fine. Not sure we can assume state_vector dtype is complex, so this works.
@pavoljuhas How so? I see errors on this PR's |
- Fix type mismatch in _BufferedStateVector.create argument - Fix type of the measurements argument to CliffordState.apply_measurement - Fix type spec of the dtype argument to StateVectorSimulationState `check/mypy --next` now passes without errors.
- Fix type mismatch in _BufferedStateVector.create argument - Fix type of the measurements argument to CliffordState.apply_measurement - Fix type spec of the dtype argument to StateVectorSimulationState `check/mypy --next` now passes without errors.
check/mypy --nextnow passes without errors.