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

♻️ methods for applying operations to DDs #674

Open burgholzer opened 3 months ago

burgholzer commented 3 months ago

Description

This PR adds a couple of convenience methods for applying operations to DDs. This avoids having to duplicate the respective logic in top-level libraries like DDSIM or QCEC.

Checklist:

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 83.13253% with 14 lines in your changes missing coverage. Please review.

Project coverage is 91.9%. Comparing base (9be9167) to head (7860cb8).

Files Patch % Lines
include/mqt-core/dd/Operations.hpp 74.5% 13 Missing :warning:
include/mqt-core/dd/Package.hpp 92.3% 1 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/cda-tum/mqt-core/pull/674/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/674?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 #674 +/- ## ======================================= + Coverage 87.0% 91.9% +4.8% ======================================= Files 125 125 Lines 13780 13833 +53 Branches 2164 2171 +7 ======================================= + Hits 11997 12717 +720 + Misses 1783 1116 -667 ``` | [Flag](https://app.codecov.io/gh/cda-tum/mqt-core/pull/674/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/674/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | `91.6% <83.1%> (+5.0%)` | :arrow_up: | | [python](https://app.codecov.io/gh/cda-tum/mqt-core/pull/674/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](https://app.codecov.io/gh/cda-tum/mqt-core/pull/674?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/dd/Simulation.hpp](https://app.codecov.io/gh/cda-tum/mqt-core/pull/674?src=pr&el=tree&filepath=include%2Fmqt-core%2Fdd%2FSimulation.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-aW5jbHVkZS9tcXQtY29yZS9kZC9TaW11bGF0aW9uLmhwcA==) | `100.0% <100.0%> (ø)` | | | [...-core/ir/operations/ClassicControlledOperation.hpp](https://app.codecov.io/gh/cda-tum/mqt-core/pull/674?src=pr&el=tree&filepath=include%2Fmqt-core%2Fir%2Foperations%2FClassicControlledOperation.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-aW5jbHVkZS9tcXQtY29yZS9pci9vcGVyYXRpb25zL0NsYXNzaWNDb250cm9sbGVkT3BlcmF0aW9uLmhwcA==) | `96.7% <100.0%> (+<0.1%)` | :arrow_up: | | [src/dd/FunctionalityConstruction.cpp](https://app.codecov.io/gh/cda-tum/mqt-core/pull/674?src=pr&el=tree&filepath=src%2Fdd%2FFunctionalityConstruction.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL2RkL0Z1bmN0aW9uYWxpdHlDb25zdHJ1Y3Rpb24uY3Bw) | `94.8% <100.0%> (+70.6%)` | :arrow_up: | | [src/dd/Simulation.cpp](https://app.codecov.io/gh/cda-tum/mqt-core/pull/674?src=pr&el=tree&filepath=src%2Fdd%2FSimulation.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL2RkL1NpbXVsYXRpb24uY3Bw) | `96.0% <100.0%> (+96.0%)` | :arrow_up: | | [include/mqt-core/dd/Package.hpp](https://app.codecov.io/gh/cda-tum/mqt-core/pull/674?src=pr&el=tree&filepath=include%2Fmqt-core%2Fdd%2FPackage.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-aW5jbHVkZS9tcXQtY29yZS9kZC9QYWNrYWdlLmhwcA==) | `97.0% <92.3%> (+1.3%)` | :arrow_up: | | [include/mqt-core/dd/Operations.hpp](https://app.codecov.io/gh/cda-tum/mqt-core/pull/674?src=pr&el=tree&filepath=include%2Fmqt-core%2Fdd%2FOperations.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-aW5jbHVkZS9tcXQtY29yZS9kZC9PcGVyYXRpb25zLmhwcA==) | `85.4% <74.5%> (-2.7%)` | :arrow_down: | ... and [17 files with indirect coverage changes](https://app.codecov.io/gh/cda-tum/mqt-core/pull/674/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum)