bloqade-python icon indicating copy to clipboard operation
bloqade-python copied to clipboard

Generate largest "connected" unit-disk graph from `AtomArrangement`.

Open weinbe58 opened this issue 2 years ago • 1 comments

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.

weinbe58 avatar Aug 24 '23 14:08 weinbe58

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

jon-wurtz avatar Aug 30 '23 16:08 jon-wurtz