class="sd">    | Returns:</span>
<span class="sd">    |     H: np.ndarray, Hamiltonian, up Hamiltonian, down Hamiltonian.</span>
<span class="sd">    &quot;&quot;&quot;</span>
    <span class="k">if</span> <span class="n">K</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
        <span class="n">K</span> <span class="o">=</span> <span class="n">kinetic_energy_operator</span><span class="p">(</span><span class="n">s</span><span class="p">)</span>
    <span class="k">if</