Skip to content

Conversation

@lmondada
Copy link
Collaborator

@lmondada lmondada commented Dec 2, 2025

This PR introduces a "decomposition pattern graph", implemented in DecompositionPatternSelection.cpp. For encapsulation, it is not exposed in any header file, and hence can only be used through the new selectDecompositionPatterns function exposed in DecompositionPatterns.h.

The passes Decomposition and BasisConversion are modified to use this new pattern selection mechanism whenever the basis argument is specified and enable-patterns is empty. The basis argument was added to the Decomposition pass (and is optional).

DecompositionGraph is constructed using the metadata exposed by #3587 on the available decomposition patterns. The graph captures how gates can be decomposed into other gates (edges are decomposition patterns, vertices are gate types). For any desired target gate set, the set of all "useful" decompositions can be inferred by traversing the graph backwards, starting from the target gate set.

I have left the actual pass definitions in the target YAML files unchanged. It should be possible to substantially simplify them in a future PR, as using the basis argument should make most explicit lists of enabled and disabled patterns superfluous.

See also Jira issue CUDAQ-217

@lmondada lmondada force-pushed the lm/decompgraph branch 2 times, most recently from 77eed07 to 2038789 Compare December 10, 2025 13:43
@lmondada lmondada force-pushed the lm/decompgraph branch 6 times, most recently from 06088f0 to 9a6800d Compare December 10, 2025 16:06
@lmondada lmondada requested a review from schweitzpgi December 11, 2025 18:30
@lmondada lmondada marked this pull request as ready for review December 11, 2025 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant