s="bp">self</span><span class="o">.</span><span class="n">hamil</span><span class="o">.</span><span class="n">terms</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
            <span class="c1"># we have checked before that coef is real</span>
            <span class="n">coef</span> <span class="o">=</span> <span class="nb">complex</span><span class="p">(</span><span class="n">coef</span><span class="p">)</span><span class="o">.</span><span class="n">real</span>

        