Skip to content

🐛 Miscellaneous fixes for qubit and register handling #476

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

Merged
merged 9 commits into from
Nov 9, 2023

Conversation

burgholzer
Copy link
Member

@burgholzer burgholzer commented Nov 8, 2023

Description

This PR brings some improvements and fixes to the handling of qubits and registers in MQT Core.
First of all, it fixes the routine that marks qubits as ancillaries so that qubits are really properly transformed from regular qubits in a regular register to ancillary qubits in an ancillary register.
Second, it improves the stability of the QASM dump by making sure that the registers are dumped in the proper order that they were declared in.
Lastly, it fixes an oversight in the routine for unifying registers that effectively erased any ancillary qubits from the qubit count.

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.

registers should appear in the correct order now when a circuit is exported to QASM

Signed-off-by: burgholzer <[email protected]>
it reset the number of ancillaries but did not increase the number of qubits

Signed-off-by: burgholzer <[email protected]>
circuits should be printed as is; otherwise, there is a certain confusion between the initial layout that is being printed and the actual circuit.

Signed-off-by: burgholzer <[email protected]>
first removes the qubit and then adds it back as an ancillary qubit.

Signed-off-by: burgholzer <[email protected]>
@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 Nov 8, 2023
@burgholzer burgholzer self-assigned this Nov 8, 2023
Copy link

codecov bot commented Nov 8, 2023

Codecov Report

Merging #476 (977547b) into main (62abb9d) will decrease coverage by 0.1%.
The diff coverage is 95.6%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #476     +/-   ##
=======================================
- Coverage   90.1%   90.0%   -0.1%     
=======================================
  Files        110     110             
  Lines      11785   11785             
  Branches    2056    2057      +1     
=======================================
- Hits       10620   10617      -3     
- Misses      1165    1168      +3     
Flag Coverage Δ
cpp 89.8% <95.0%> (-0.1%) ⬇️
python 100.0% <100.0%> (ø)
Files Coverage Δ
include/QuantumComputation.hpp 90.6% <100.0%> (+0.9%) ⬆️
src/mqt/core/plugins/qiskit.py 100.0% <100.0%> (ø)
src/operations/NonUnitaryOperation.cpp 87.9% <100.0%> (-4.5%) ⬇️
src/QuantumComputation.cpp 78.8% <90.0%> (-0.1%) ⬇️

Copy link
Contributor

github-actions bot commented Nov 9, 2023

Cpp-Linter Report ✔️

No problems need attention.

Have any feedback or feature suggestions? Share it here.

@burgholzer burgholzer merged commit d9ed9b7 into main Nov 9, 2023
@burgholzer burgholzer deleted the fixes-register-handling branch November 9, 2023 15:55
@burgholzer burgholzer restored the fixes-register-handling branch November 9, 2023 15:55
@burgholzer burgholzer deleted the fixes-register-handling branch November 9, 2023 15:58
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
None yet
Development

Successfully merging this pull request may close these issues.

1 participant