Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️ Revised qubit register handling #495

Merged
merged 4 commits into from
Dec 12, 2023

Conversation

burgholzer
Copy link
Member

Description

This kind of supersedes #493 and provides an alternative, less intrusive version that properly handles ancillary qubits and marking qubits in existing registers as ancillaries.
It simply checks on the removal of a qubit from a qreg whether that qubit is marked as ancillary and correspondingly decrements the right qubit number counter.

This has also been tested in QCEC to resolve the errors that were popping up over there.

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.

Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
@burgholzer burgholzer added fix Fix for something that isn't working Core Anything related to the Core library and IR c++ Anything related to C++ code labels Dec 12, 2023
@burgholzer burgholzer self-assigned this Dec 12, 2023
Copy link

codecov bot commented Dec 12, 2023

Codecov Report

Merging #495 (89f2885) into main (3759199) will decrease coverage by 0.1%.
The diff coverage is 100.0%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #495     +/-   ##
=======================================
- Coverage   90.3%   90.3%   -0.1%     
=======================================
  Files        111     111             
  Lines      11829   11826      -3     
  Branches    2057    2057             
=======================================
- Hits       10690   10682      -8     
- Misses      1139    1144      +5     
Flag Coverage Δ
cpp 90.1% <100.0%> (-0.1%) ⬇️
python 100.0% <ø> (ø)
Files Coverage Δ
src/QuantumComputation.cpp 81.3% <100.0%> (-1.0%) ⬇️

…t in Windows debug mode

Signed-off-by: burgholzer <burgholzer@me.com>
@burgholzer burgholzer merged commit 6e10d70 into main Dec 12, 2023
34 checks passed
@burgholzer burgholzer deleted the revised-qubit-register-handling branch December 12, 2023 13:20
burgholzer added a commit to cda-tum/mqt-qcec that referenced this pull request Dec 12, 2023
## Description

This PR updates `mqt-core` with a new fix (cda-tum/mqt-core#495) for a
small bug that resulted in two circuits that were acting on the same
number of "primary" qubits to report that circuits differed in their
number of qubits.

## Checklist:

<!---
This checklist serves as a reminder of a couple of things that ensure
your pull request will be merged swiftly.
-->

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

---------

Signed-off-by: burgholzer <burgholzer@me.com>
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 Core Anything related to the Core library and IR fix Fix for something that isn't working
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant