cda-tum / mqt-core

MQT Core - The Backbone of the Munich Quantum Toolkit
https://mqt.readthedocs.io/projects/core
MIT License
62 stars 31 forks source link

♻️ optimize `isDynamic` check and move to `QuantumComputation` class #689

Closed burgholzer closed 2 months ago

burgholzer commented 2 months ago

Description

This PR optimizes the isDynamic(Circuit) check by simplifying the overall implementation and making the function const. Furthermore, the function is moved from the CircuitOptimizer to the QuantumComputation class itself.

Last, but not least, this PR fixes an issue in the CMake configuration that would prevent the algorithm tests to run properly.

Checklist:

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 92.1%. Comparing base (8ee8fdb) to head (0b11e9d). Report is 1 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/cda-tum/mqt-core/pull/689/graphs/tree.svg?width=650&height=150&src=pr&token=MqstsRKdqp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum)](https://app.codecov.io/gh/cda-tum/mqt-core/pull/689?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) ```diff @@ Coverage Diff @@ ## main #689 +/- ## ======================================= + Coverage 87.1% 92.1% +4.9% ======================================= Files 125 125 Lines 13770 13780 +10 Branches 2156 2153 -3 ======================================= + Hits 11995 12692 +697 + Misses 1775 1088 -687 ``` | [Flag](https://app.codecov.io/gh/cda-tum/mqt-core/pull/689/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | Coverage Δ | | |---|---|---| | [cpp](https://app.codecov.io/gh/cda-tum/mqt-core/pull/689/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | `91.8% <100.0%> (+5.1%)` | :arrow_up: | | [python](https://app.codecov.io/gh/cda-tum/mqt-core/pull/689/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | `99.7% <ø> (ø)` | | | [Files with missing lines](https://app.codecov.io/gh/cda-tum/mqt-core/pull/689?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | Coverage Δ | | |---|---|---| | [include/mqt-core/ir/QuantumComputation.hpp](https://app.codecov.io/gh/cda-tum/mqt-core/pull/689?src=pr&el=tree&filepath=include%2Fmqt-core%2Fir%2FQuantumComputation.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-aW5jbHVkZS9tcXQtY29yZS9pci9RdWFudHVtQ29tcHV0YXRpb24uaHBw) | `92.4% <100.0%> (+0.4%)` | :arrow_up: | | [src/circuit\_optimizer/CircuitOptimizer.cpp](https://app.codecov.io/gh/cda-tum/mqt-core/pull/689?src=pr&el=tree&filepath=src%2Fcircuit_optimizer%2FCircuitOptimizer.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL2NpcmN1aXRfb3B0aW1pemVyL0NpcmN1aXRPcHRpbWl6ZXIuY3Bw) | `90.2% <100.0%> (+1.5%)` | :arrow_up: | | [src/ir/QuantumComputation.cpp](https://app.codecov.io/gh/cda-tum/mqt-core/pull/689?src=pr&el=tree&filepath=src%2Fir%2FQuantumComputation.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL2lyL1F1YW50dW1Db21wdXRhdGlvbi5jcHA=) | `84.3% <100.0%> (+1.1%)` | :arrow_up: | ... and [17 files with indirect coverage changes](https://app.codecov.io/gh/cda-tum/mqt-core/pull/689/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum)