Skip to content

🐛 Fix ancillary handling in ZX checker#512

Merged
burgholzer merged 38 commits intomainfrom
debugging-ancilla-qubits
Jun 16, 2025
Merged

🐛 Fix ancillary handling in ZX checker#512
burgholzer merged 38 commits intomainfrom
debugging-ancilla-qubits

Conversation

@burgholzer
Copy link
Member

@burgholzer burgholzer commented Nov 25, 2024

Description

Fixes #508

The regression tests and the corresponding CI failures demonstrate the underlying issue in the ZX checkers:

  • the first C++ test, which previously segfaulted, now returns equivalent, while all other checkers agree that the two circuits are not equivalent.
  • the second C++ test is a full C++ reproducer of the failing Python test. This test segfaults due to a map out of range error.
  • the Python test is adapted from 🐛 Partial equivalence with ancillary qubits #508

Note the first two tests fail for separate reasons, which means there are multiple things going wrong here.

This PR adjusts the conditions under which the ZX checker declares it can handle the underlying circuits, making it more conservative than before.
Additionally, the out of range error is fixed.

Checklist:

  • The pull request only contains commits that are related to it.
  • I have added appropriate tests and documentation.
  • I have made sure that all CI jobs on GitHub pass.
  • The pull request introduces no new warnings and follows the project's style guidelines.

@burgholzer burgholzer added c++ Anything related to C++ code fix Anything related to bugfixes labels Nov 25, 2024
pehamTom and others added 3 commits May 5, 2025 15:45
Disables ZX Checker when non-garbage ancillae are defined.
@codecov
Copy link

codecov bot commented May 5, 2025

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

Copy link
Member Author

@burgholzer burgholzer left a comment

Choose a reason for hiding this comment

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

@pehamTom many thanks for the changes here. I pushed a couple of commits with cleanups of unrelated changes and a small fix for an oversight in the new shortcut of the ZX Checker run method.

I only have two real questions left, which you will find inline.
Other than that, it would be nice if you could add a changelog entry for this fix.

@burgholzer burgholzer marked this pull request as ready for review May 5, 2025 19:18
Copy link
Member Author

@burgholzer burgholzer left a comment

Choose a reason for hiding this comment

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

Thanks @pehamTom for the further iteration here. I think we need one more iteration and then this should be done for good. You'll find the detailed comments inline.

@burgholzer burgholzer added the minor Part of a minor release label Jun 16, 2025
@burgholzer burgholzer enabled auto-merge (squash) June 16, 2025 16:10
@burgholzer burgholzer added this to the MQT QCEC v3.1 milestone Jun 16, 2025
@burgholzer burgholzer merged commit 0475924 into main Jun 16, 2025
30 checks passed
@burgholzer burgholzer deleted the debugging-ancilla-qubits branch June 16, 2025 16:24
@github-project-automation github-project-automation bot moved this from In Progress to Done in MQT Jun 16, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in MQT Verification Jun 16, 2025
@burgholzer burgholzer mentioned this pull request Jun 16, 2025
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Anything related to C++ code fix Anything related to bugfixes minor Part of a minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐛 Partial equivalence with ancillary qubits

2 participants