This PR adds a new stable greedy topological sorting method and changes the default topological sort to use this method when iterating over nodes of a bloq instance graph.
This is useful to
Improve qubit cost analysis
Improve cirq-interop and minimize qubit allocations when specifying a GreedyQubitManager.
This PR adds a new stable greedy topological sorting method and changes the default topological sort to use this method when iterating over nodes of a bloq instance graph.
This is useful to
Fixes the issue mentioned in https://github.com/quantumlib/Qualtran/pull/963#issuecomment-2192745758, would be useful for https://github.com/quantumlib/Qualtran/issues/1097 and can be improved by addressing https://github.com/quantumlib/Qualtran/issues/1098