span> <span class="n">Vext</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
        <span class="n">Vext</span> <span class="o">=</span> <span class="n">external_potential_operator</span><span class="p">(</span><span class="n">s</span><span class="p">)</span>
    <span class="n">Vh</span> <span class="o">=</span> <span class="n">hartree_potential_operator</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="n">up_n</span> <span cla