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

🐛 Fix stripping of idle qubits #763

Merged
merged 2 commits into from
Jan 21, 2025
Merged

Conversation

burgholzer
Copy link
Member

@burgholzer burgholzer commented Nov 27, 2024

Description

Fixes #729

This PR builds on the register handling improvements in #807 and fixes the the last remaining part of the problem observed in #729.
When dumping a circuit to QASM that has been stripped of idle qubits, the initial layout and output permutation need to be adjusted so that the resulting circuit can be read in again without problems.
The reason this PR is so small is mainly because a lot of the legwork was already done in #807.

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 self-assigned this Nov 27, 2024
@burgholzer burgholzer added refactor Anything related to code refactoring fix Fix for something that isn't working Core Anything related to the Core library and IR c++ Anything related to C++ code labels Nov 27, 2024
@burgholzer burgholzer force-pushed the fix-idle-qubit-stripping branch from 9b64a26 to f506140 Compare November 28, 2024 01:33
@burgholzer burgholzer force-pushed the fix-idle-qubit-stripping branch from f506140 to dca4aae Compare January 21, 2025 15:49
@burgholzer burgholzer marked this pull request as ready for review January 21, 2025 15:52
@burgholzer burgholzer enabled auto-merge January 21, 2025 15:56
Copy link

codecov bot commented Jan 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.2%. Comparing base (ba3aa86) to head (dca4aae).
Report is 4 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main    #763   +/-   ##
=====================================
  Coverage   92.2%   92.2%           
=====================================
  Files        126     126           
  Lines      13827   13828    +1     
  Branches    2153    2153           
=====================================
+ Hits       12756   12759    +3     
+ Misses      1071    1069    -2     
Flag Coverage Δ
cpp 92.0% <100.0%> (+<0.1%) ⬆️
python 99.7% <ø> (ø)
Files with missing lines Coverage Δ
src/ir/QuantumComputation.cpp 90.4% <100.0%> (+<0.1%) ⬆️

... and 1 file with indirect coverage changes

@burgholzer burgholzer merged commit ed00fb4 into main Jan 21, 2025
30 checks passed
@burgholzer burgholzer deleted the fix-idle-qubit-stripping branch January 21, 2025 18:10
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 refactor Anything related to code refactoring
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

🐛 Circuits with discontiguous qubit registers are not properly exported since v2.7.0
1 participant