View source on GitHub |
Validates the size of the given state_vector
against the given shape.
cirq.validate_qid_shape(
state_vector: np.ndarray, qid_shape: Optional[Tuple[int, ...]]
) -> Tuple[int, ...]
Returns | |
---|---|
The qid shape. |
Raises | |
---|---|
ValueError
|
if the size of state_vector does not match that given in
qid_shape or if qid_state is not given if state_vector does
not have a dimension that is a power of two.
|