num_mats</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">unitary_mats</span><span class="p">)</span>
        <span class="k">for</span> <span class="n">mat</span> <span class="ow">in</span> <span class="n">unitary_mats</span><span class="p">:</span>
            <span class="k">assert</span> <span class="n">mat</span><span class="o">.</span><span class="n">shape</span> <span class="o">==</span> <span class="p">(</span><span class="n">block_size</span><span c