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

✨ Add customGate flag and optimizer functionality to flatten only custom gates #651

Merged
merged 8 commits into from
Jul 25, 2024

Conversation

DRovara
Copy link
Contributor

@DRovara DRovara commented Jul 24, 2024

Description

This pull request adds the customGate flag to the CompoundOperation class. This flag is set for CompoundOperations that were constructed from custom gate calls.

The pull request also provides new functionality to the flattenOperations optimizer. Now, a second parameter can be used to indicate that only custom gates should be flattened. It makes sense to put this functionality here as outside of the CircuitOptimizer class, certain protected members cannot be accessed anymore.

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.

Copy link

codecov bot commented Jul 25, 2024

Codecov Report

Attention: Patch coverage is 90.90909% with 1 line in your changes missing coverage. Please review.

Project coverage is 91.6%. Comparing base (3ce5689) to head (6c76ad1).
Report is 144 commits behind head on main.

Files with missing lines Patch % Lines
src/operations/CompoundOperation.cpp 83.3% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main    #651     +/-   ##
=======================================
- Coverage   91.6%   91.6%   -0.1%     
=======================================
  Files        148     148             
  Lines      14755   14759      +4     
  Branches    2369    2370      +1     
=======================================
+ Hits       13522   13525      +3     
- Misses      1233    1234      +1     
Flag Coverage Δ
cpp 91.3% <90.9%> (-0.1%) ⬇️
python 99.7% <ø> (ø)
Files with missing lines Coverage Δ
include/mqt-core/operations/CompoundOperation.hpp 100.0% <ø> (ø)
src/CircuitOptimizer.cpp 88.9% <100.0%> (+<0.1%) ⬆️
src/parsers/QASM3Parser.cpp 90.5% <100.0%> (ø)
src/operations/CompoundOperation.cpp 85.9% <83.3%> (-0.6%) ⬇️

@DRovara DRovara marked this pull request as ready for review July 25, 2024 11:23
@burgholzer burgholzer added enhancement New feature or request Core Anything related to the Core library and IR c++ Anything related to C++ code labels Jul 25, 2024
Copy link
Member

@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.

Many thanks for this nice addition.
I just pushed two commits with a few cleanups.
Once CI passes, this is good to go in 🚀

@burgholzer burgholzer enabled auto-merge (squash) July 25, 2024 12:07
@burgholzer burgholzer merged commit 44d8363 into cda-tum:main Jul 25, 2024
34 checks passed
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 enhancement New feature or request
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants