Skip to content

Document transpiler pass categories and examples#16403

Open
kataro92 wants to merge 3 commits into
Qiskit:mainfrom
kataro92:docs-3436-transpiler-passes-examples
Open

Document transpiler pass categories and examples#16403
kataro92 wants to merge 3 commits into
Qiskit:mainfrom
kataro92:docs-3436-transpiler-passes-examples

Conversation

@kataro92

Copy link
Copy Markdown
Contributor

Summary

Closes #3436.

This expands the qiskit.transpiler.passes API documentation with a short guide to using transpiler passes directly. It explains how passes work with PassManager, the difference between analysis and transformation passes, and how the pass categories fit into a custom transpilation workflow.

Details and comments

The current docs/apidoc/transpiler_passes.rst page renders the module docstring from qiskit.transpiler.passes, so this PR updates qiskit/transpiler/passes/__init__.py.

The new documentation:

  • Adds a "Working with transpiler passes" overview.
  • Explains AnalysisPass, TransformationPass, and PropertySet.
  • Adds small examples using CountOps, RemoveBarriers, and InverseCancellation with PassManager.
  • Adds concise descriptions for the existing pass categories, including layout, routing, basis change, optimization, scheduling, circuit analysis, synthesis, post-layout, and utility passes.

This keeps the change scoped to the transpiler-passes API page and avoids duplicating the broader preset-pass-manager overview from qiskit.transpiler.

Tests

  • python -m py_compile qiskit/transpiler/passes/__init__.py
  • Ran the new analysis-pass example locally.
  • Ran the new transformation-pass example locally.
  • git diff --check

AI/LLM disclosure

  • I didn't use LLM tooling, or only used it privately.
  • I used the following tool to help write this PR description: Cursor with GPT-5.5.
  • I used the following tool to generate or modify code: Cursor with GPT-5.5.

I reviewed and understand the generated guidance, documentation change, examples, and test results before submitting.

Add an overview of analysis and transformation passes, explain the role of each pass category, and include small examples for using passes with PassManager.
@kataro92 kataro92 requested a review from a team as a code owner June 10, 2026 02:49
@kataro92 kataro92 requested a review from mtreinish June 10, 2026 02:49
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 27249783085

Coverage decreased (-0.01%) to 87.531%

Details

  • Coverage decreased (-0.01%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 27 coverage regressions across 4 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

27 previously-covered lines in 4 files lost coverage.

File Lines Losing Coverage Coverage
crates/qasm2/src/parse.rs 18 96.68%
crates/qasm2/src/lex.rs 6 92.03%
crates/circuit/src/parameter/symbol_expr.rs 2 74.17%
crates/circuit/src/parameter/parameter_expression.rs 1 91.03%

Coverage Stats

Coverage Status
Relevant Lines: 126602
Covered Lines: 110816
Line Coverage: 87.53%
Coverage Strength: 953029.86 hits per line

💛 - Coveralls

@ShellyGarion ShellyGarion added the documentation Something is not clear or an error documentation label Jun 10, 2026
@Cryoris Cryoris self-requested a review June 10, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Something is not clear or an error documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

qiskit.transpiler.passes needs module level docs and passes need examples

3 participants