cirq.testing.assert_has_consistent_qid_shape

cirq.testing.assert_has_consistent_qid_shape(val: Any) → None[source]
Tests whether a value’s _qid_shape_ and _num_qubits_ are correct and
consistent.
Verifies that the entries in the shape are all positive integers and the
length of shape equals _num_qubits_ (and also equals len(qubits) if
val has qubits.
Parameters

val – The value under test. Should have _qid_shape_ and/or num_qubits_ methods. Can optionally have a qubits property.