pan>
        <span class="k">if</span> <span class="n">n_atoms</span> <span class="o">&gt;</span> <span class="n">n_atoms_max</span><span class="p">:</span>
            <span class="n">n_atoms_max</span> <span class="o">=</span> <span class="n">n_atoms</span>

        <span class="c1"># Gather min distance. For periodic systems we must also consider</span>
        <span class="c1"># distances from an atom to it&#39;s periodic copy, as given by</span>
        <span class="c1"># get_distance_matrix() on the d