dwave.system.samplers.DWaveSampler.to_networkx_graph#
- DWaveSampler.to_networkx_graph()[source]#
Output the QPU’s working graph in NetworkX format.
- Returns:
Either a Chimera lattice, a Pegasus lattice or a Zephyr lattice.
- Return type:
Examples
This example converts a selected QPU to a graph and verifies that it has a greater number of edges (couplers) than nodes (qubits).
>>> from dwave.system import DWaveSampler ... >>> with DWaveSampler() as sampler: ... g = sampler.to_networkx_graph() ... len(g.edges) > len(g.nodes) True