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 only usage of
networkx
is currently in thePlatform.topology
. https://github.com/qiboteam/qibolab/blob/7056c84f28a7c0191f26b29f71a505b9c1b4cf9a/src/qibolab/platform.py#L113-L114However, 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