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

✨ Elide permutations optimization #586

Merged
merged 10 commits into from
Apr 15, 2024
Merged

✨ Elide permutations optimization #586

merged 10 commits into from
Apr 15, 2024

Conversation

burgholzer
Copy link
Member

Description

This PR introduces a new optimization that allows to elide permutations from circuits.
Essentially, it starts with the initial layout, applies it to every gate of the circuit.
Upon encountering a SWAP gate, the tracked permutation is updated and the gate eliminated.
Finally, the output permutation of the circuit is updated.

The PR also includes some fixes for newer clang-tidy warnings as well as a small printing fix for quantum circuits.

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 feature New feature or request Core Anything related to the Core library and IR c++ Anything related to C++ code labels Apr 14, 2024
@burgholzer burgholzer added this to the MQT Core milestone Apr 14, 2024
@burgholzer burgholzer self-assigned this Apr 14, 2024
Copy link

codecov bot commented Apr 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.4%. Comparing base (00fcfaa) to head (1862add).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main    #586   +/-   ##
=====================================
  Coverage   91.3%   91.4%           
=====================================
  Files        131     131           
  Lines      14052   14090   +38     
  Branches    2243    2250    +7     
=====================================
+ Hits       12841   12886   +45     
+ Misses      1211    1204    -7     
Flag Coverage Δ
cpp 91.1% <100.0%> (+<0.1%) ⬆️
python 99.5% <ø> (ø)
Files Coverage Δ
include/mqt-core/operations/CompoundOperation.hpp 100.0% <ø> (ø)
include/mqt-core/operations/Control.hpp 100.0% <100.0%> (ø)
...nclude/mqt-core/operations/NonUnitaryOperation.hpp 91.6% <ø> (ø)
include/mqt-core/operations/Operation.hpp 79.4% <100.0%> (-1.3%) ⬇️
src/CircuitOptimizer.cpp 88.8% <100.0%> (+0.4%) ⬆️
src/QuantumComputation.cpp 82.0% <100.0%> (ø)
src/operations/CompoundOperation.cpp 83.9% <100.0%> (+0.6%) ⬆️
src/operations/NonUnitaryOperation.cpp 90.8% <100.0%> (+4.7%) ⬆️
src/operations/Operation.cpp 93.1% <100.0%> (+0.2%) ⬆️
src/parsers/QCParser.cpp 80.9% <100.0%> (+0.3%) ⬆️

... and 2 files with indirect coverage changes

Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
Signed-off-by: burgholzer <burgholzer@me.com>
@burgholzer burgholzer enabled auto-merge (squash) April 15, 2024 10:19
@burgholzer burgholzer merged commit 5649e0c into main Apr 15, 2024
37 checks passed
@burgholzer burgholzer deleted the elide-permutations branch April 15, 2024 11:05
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 feature New feature or request
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

1 participant