qibolab icon indicating copy to clipboard operation
qibolab copied to clipboard

Drop `networkx` dependency

Open alecandido opened this issue 1 year ago • 0 comments

The only usage of networkx is currently in the Platform.topology. https://github.com/qiboteam/qibolab/blob/7056c84f28a7c0191f26b29f71a505b9c1b4cf9a/src/qibolab/platform.py#L113-L114

However, we do not use practically anything of it being a graph (before it was used by the transpiler). I'd rather drop it here, and do the conversion in Qibo (if needed).

The connectivity of course has to be kept, but we could save the adjacency matrix or list. And given that the topology is rather sparse (especially for large chips, where it matters more), I'd simply go for an adjacency list (i.e. a list of pairs of QubitId).

The conversion will be trivial: https://networkx.org/documentation/stable/reference/classes/generated/networkx.Graph.add_edges_from.html#networkx.Graph.add_edges_from

alecandido avatar Jan 16 '24 14:01 alecandido