Skip to content

Add generate_clifford_t_pass_manager#15918

Open
alexanderivrii wants to merge 7 commits intoQiskit:mainfrom
alexanderivrii:generate-clifford-t-pass-manager
Open

Add generate_clifford_t_pass_manager#15918
alexanderivrii wants to merge 7 commits intoQiskit:mainfrom
alexanderivrii:generate-clifford-t-pass-manager

Conversation

@alexanderivrii
Copy link
Copy Markdown
Member

Summary

This PR introduces a function generate_clifford_t_pass_manager which is analogous to generate_preset_pass_manager but exposes arguments specifically tailored for Clifford+T compilation. In particular it does not have arguments such as init_stage or optimization_stage but has arguments rz_synthesis_error and rz_cache_error relevant to synthesizing RZ-gates to Clifford+T basis set.

The previously existing ways of instantiating a Clifford+T transpiler pipeline (via transpile or generate_preset_pass_manager with a Clifford+T basis set) are still supported, however using the new function is recommended.

Details and comments

I have defined the following classes:

  • PassManagerCliffordTConfig, which is analogous to PassManagerConfig but tailored for Clifford+T. Currently it subclasses PassManagerConfig as Clifford+T compilation pipeline (not changed in this PR) uses default layout, routing and scheduling stages. (Actually the only place which really needs this to be a subclass is DefaultRoutingPassManager which calls SabreSwapPassManager, which assumes that config includes layout_method. And I did not want to explicitly add layout_method to PassManagerCliffordTConfig as per previous discussions we might want to completely change how layout and routing look for Clifford+T compilations).

  • PassManagerCliffordTStagePlugin, which is analogous to PassManagerCliffordTStagePlugin, but tailored for Clifford+T compilation.

Both of the above classes are internal for now (not exposed in the documentation on purpose) since we might want to further refactor them when the PBC compilation pipeline will be added.

@alexanderivrii alexanderivrii requested a review from a team as a code owner March 30, 2026 21:09
@qiskit-bot
Copy link
Copy Markdown
Collaborator

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core

@alexanderivrii alexanderivrii added this to the 2.5.0 milestone Mar 30, 2026
@alexanderivrii alexanderivrii added Changelog: Added Add an "Added" entry in the GitHub Release changelog. fault tolerance related to fault tolerance compilation labels Mar 30, 2026
@alexanderivrii alexanderivrii requested a review from Cryoris March 30, 2026 21:10
Comment on lines +177 to +178
rz_synthesis_error: float | None = None,
rz_cache_error: float | None = None,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect this to go under the umbrella of generic synthesis arguments. Once we add a plugin here we'll need to accommodate for this, plus other synthesis methods might handle caching differently. Could we just call this rz_synthesis_config and make it a generic dictionary to pass into the synthesis method?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was mainly to show that we now can add Clifford+T pipeline-specific arguments (and because you have asked for this for comparing against other tools). But I agree that we need to think a bit more about how synthesis and Clifford+T should look.

Copy link
Copy Markdown
Collaborator

@Cryoris Cryoris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some high level comments, I didn't read the logic yet 🙂

Comment on lines +185 to +187
basis_gates (list): List of basis gate names to unroll to.
coupling_map (CouplingMap): Directed graph representing a coupling
map.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we ditch these and just use a Target instead? Or is there a reason to use these as standalone?

Copy link
Copy Markdown
Member Author

@alexanderivrii alexanderivrii Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory, we can, however I am personally so used to generate preset pass managers while specifying basis_gates and coupling_map manually, that I would miss this functionality. However, based on our offline discussion, I have removed backend as an argument (especially that we have no such backends at the moment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changelog: Added Add an "Added" entry in the GitHub Release changelog. fault tolerance related to fault tolerance compilation

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

3 participants