Tests whether a value's _qid_shape_ and _num_qubits_ are correct and


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.

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