an class="p">(</span><span class="n">n_x</span><span class="p">):</span>
            <span class="k">for</span> <span class="n">j</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">n_y</span><span class="p">):</span>

                <span class="c1"># Skip lower triangular part for symmetric matrices</span>
                <span class="k">if</span> <span class="n">symmetric</span> <span class="ow">and</span> <span class="n">j</span> <span class="o">&lt;</