cda-tum / mqt-qcec

MQT QCEC - A tool for Quantum Circuit Equivalence Checking
https://mqt.readthedocs.io/projects/qcec
MIT License
90 stars 21 forks source link

🐛 Fix a div-by-zero in `Proportional` strategy for empty circuit #317

Closed burgholzer closed 1 year ago

burgholzer commented 1 year ago

Description

This PR fixes a corner case where an empty circuit could lead to a division by zero error when trying to compute the gate ration between both circuits. Furthermore, a shortcut is added for when both circuits are empty.

Checklist:

codecov[bot] commented 1 year ago

Codecov Report

Merging #317 (c15ca99) into main (7eb64b2) will increase coverage by 5.7%. The diff coverage is 100.0%.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/cda-tum/mqt-qcec/pull/317/graphs/tree.svg?width=650&height=150&src=pr&token=eKL7Ya7iep&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-qcec/pull/317?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 #317 +/- ## ======================================= + Coverage 90.2% 96.0% +5.7% ======================================= Files 34 34 Lines 1720 1738 +18 Branches 210 212 +2 ======================================= + Hits 1553 1670 +117 + Misses 167 68 -99 ``` | [Flag](https://app.codecov.io/gh/cda-tum/mqt-qcec/pull/317/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-qcec/pull/317/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | `95.7% <100.0%> (+<0.1%)` | :arrow_up: | | [python](https://app.codecov.io/gh/cda-tum/mqt-qcec/pull/317/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | `97.2% <ø> (+25.1%)` | :arrow_up: | | [Files](https://app.codecov.io/gh/cda-tum/mqt-qcec/pull/317?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | Coverage Δ | | |---|---|---| | [...pplicationscheme/ProportionalApplicationScheme.hpp](https://app.codecov.io/gh/cda-tum/mqt-qcec/pull/317?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-aW5jbHVkZS9jaGVja2VyL2RkL2FwcGxpY2F0aW9uc2NoZW1lL1Byb3BvcnRpb25hbEFwcGxpY2F0aW9uU2NoZW1lLmhwcA==) | `100.0% <ø> (ø)` | | | [src/EquivalenceCheckingManager.cpp](https://app.codecov.io/gh/cda-tum/mqt-qcec/pull/317?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL0VxdWl2YWxlbmNlQ2hlY2tpbmdNYW5hZ2VyLmNwcA==) | `93.9% <100.0%> (+0.3%)` | :arrow_up: | ... and [6 files with indirect coverage changes](https://app.codecov.io/gh/cda-tum/mqt-qcec/pull/317/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum)
github-actions[bot] commented 1 year ago

Cpp-Linter Report :heavy_check_mark:

No problems need attention.

Have any feedback or feature suggestions? Share it here.