<span class="p">(</span><span class="n">n_atoms</span><span class="p">)]</span>
    <span class="n">connected_matrix</span> <span class="o">+=</span> <span class="n">np</span><span class="o">.</span><span class="n">eye</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">connected_matrix</span><span class="p">))</span>

    <span class="k">def</span> <span class="nf">visit</span><span class="p">(</span><span class="n">atom</span><span class="p">,</span> <span clas