bloqade-python
bloqade-python copied to clipboard
Generate largest "connected" unit-disk graph from `AtomArrangement`.
The idea here is that when generating defective graphs sometimes there are atoms that are not within the blockade radius of the rest of the system and these atoms are really not necessary to simulate.
As a corollary: I think this should also involve removing vacant sites as well but that could also be a separate method.
I do not think this should be a feature of bloqade-python, as it is strictly an analysis. It is also very simple using networkx:
G = get_UDG(pos,0.72) # Get a networkx graph
internal = list(nx.connected_components(G)) # Identify connected components
largest_connected = internal[nx.argmax([len(q) for q in internal])] # Pick the largest connected component
pos = pos[list(largest_connected)] # Reduce to a subgraph
G = get_UDG(pos,0.72) # rebuild graph