Skip to content

Conversation

Shaobo-Zhou
Copy link
Contributor

@Shaobo-Zhou Shaobo-Zhou commented Sep 6, 2025

Description

This PR introduces new actions to the reinforcement learning environment and adds support for stochastic mapping passes:

🚀 Major Changes
Expanded Action Space

  • Added AIRouting as a routing/mapping option and wrapped in SafeAIRouting for stable integration into the RL pipeline.
  • Added tket layout actions: GraphPlacement and NoiseAwarePlacement (fidelity-aware).

Support for Stochastic Passes

  • Wrapped stochastic actions (e.g., AIRouting, SabreLayout) in a multi-trial evaluation loop, optimizing for the figure of merit instead of the default gate count internally in Qiskit passes.
  • Introduced max_iterations as parameters to control trial counts, enabling improved predictor performance and stability.

**Changes in determine_valid_actions_for_state**

  • Refined the logic: After a circuit is mapped, only mapping-preserving optimization actions are allowed to prevent reusing outdated layouts when the circuit structure changes.

Fixes and Enhancements

  • Fixed a bug in OptimizeCliffords by ensuring CollectCliffords runs beforehand.
  • Corrected computation of estimated success probability in reward.py
  • Fixed incorrect usage of GatesInBasis in rl/predictorenv.py
  • Adjusted benchmark level to INDEP in test_predictor_rl.py, since the current action space does not guarantee support for high-level gates.
  • Disabled multiprocessing on Windows with Python 3.13 due to _posixsubprocess issues.

Dependency Update

  • Added qiskit-ibm-ai-local-transpiler to the dependencies
  • Pinned networkx==2.8.5 to ensure compatibility with qiskit-ibm-ai-local-transpiler
  • Upgraded pytket_qiskit>=0.71.0

Checklist:

  • The pull request only contains commits that are focused and relevant to this change.
  • I have added appropriate tests that cover the new/changed functionality.
  • I have updated the documentation to reflect these changes.
  • I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals.
  • I have added migration instructions to the upgrade guide (if needed).
  • The changes follow the project's style guidelines and introduce no new warnings.
  • The changes are fully tested and pass the CI checks.
  • I have reviewed my own code changes.

Shaobo Zhou and others added 30 commits March 29, 2025 19:20
Update action space and feature space

Update actions

Update action space
Fix: resolve pre-commit issues and add missing annotations

Fix: resolve pre-commit issues and add missing annotations

Remove example_test.py

Remove example_test.py
Fix: resolve pre-commit issues and add missing annotations

Fix: resolve pre-commit issues and add missing annotations

Fix: resolve pre-commit issues and add missing annotations
Fix bugs

Fix bugs

Fix bugs
Fix windows runtime warning problem

Fix windows runtime warning issue
@Shaobo-Zhou Shaobo-Zhou force-pushed the new_structure branch 3 times, most recently from 7644681 to 44e0e40 Compare September 23, 2025 17:31
@denialhaag
Copy link
Contributor

Hey @Shaobo-Zhou, we just merged #468 to fix the CI on main. The PR contains the minimum version bumps necessary to make everything work again. I hope the rebase is not too bad. 🙂

@denialhaag
Copy link
Contributor

This seems to have worked fine! I just had two quick points regarding the rebase. 🙂

@Shaobo-Zhou Shaobo-Zhou force-pushed the new_structure branch 4 times, most recently from 5ccc3c0 to b28ccf2 Compare September 25, 2025 17:44
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.

4 participants