>

        <span class="k">if</span> <span class="n">restore_energy</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
            <span class="n">xi_energy</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">sum</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">abs</span><span class="p">(</span><span class="n">xi</span><span class="p">))</span>
            <span class="n">xi_w_energy</s