qdk_chemistry.plugins.networkx.term_grouper module

NetworkX-backed term groupers using DSATUR graph coloring.

class qdk_chemistry.plugins.networkx.term_grouper.NxFullCommutingTermGrouper[source]

Bases: TermGrouper

Group terms by full Pauli commutation using networkx DSATUR.

Uses the saturation-largest-first (DSATUR) graph coloring strategy from networkx, which typically produces fewer groups than the built-in greedy first-fit algorithm.

name()[source]

Return nx_commuting as the algorithm name.

Return type:

str

class qdk_chemistry.plugins.networkx.term_grouper.NxQubitWiseCommutingTermGrouper[source]

Bases: TermGrouper

Group terms by qubit-wise commutation using networkx DSATUR.

Uses the saturation-largest-first (DSATUR) graph coloring strategy from networkx, which typically produces fewer groups than the built-in greedy first-fit algorithm.

name()[source]

Return nx_qubit_wise_commuting as the algorithm name.

Return type:

str