n">n</span><span class="p">[</span><span class="n">j</span><span class="p">]</span>
                <span class="n">energy</span> <span class="o">=</span> <span class="p">(</span>
                    <span class="o">-</span><span class="p">(</span>
                        <span class="p">(</span><span class="n">q</span><span class="p">[</span><span class="s2">&quot;a&quot;</span><span class="p">]</span> <span class="o">*</span> <span class="n">r_s</span> <span class="o">+</span> <span class="n">q</span><spa