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

🐛 fix endianness in DCX and XX_minus_YY gate matrix definition #741

Closed burgholzer closed 3 weeks ago

burgholzer commented 3 weeks ago

Description

This has been brought up as in cda-tum/mqt-qcec/issues/489. Turns out the endianness of the DCX gate matrix was wrong and this has not been detected because the tests where multiplying the gates of the definition for verification purposes in the wrong order. After adjusting the tests, another incorrect endianness result popped up for the xx_minus_yy gate.

Both issues have now been fixed.

Checklist:

codecov[bot] commented 3 weeks ago

Codecov Report

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

Project coverage is 92.1%. Comparing base (dcda5c1) to head (4961a2c). Report is 12 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/cda-tum/mqt-core/pull/741/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/741?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 #741 +/- ## ======================================= - Coverage 92.2% 92.1% -0.2% ======================================= Files 125 125 Lines 13739 13770 +31 Branches 2158 2157 -1 ======================================= + Hits 12678 12684 +6 - Misses 1061 1086 +25 ``` | [Flag](https://app.codecov.io/gh/cda-tum/mqt-core/pull/741/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/741/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%> (-0.2%)` | :arrow_down: | | [python](https://app.codecov.io/gh/cda-tum/mqt-core/pull/741/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/741?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/GateMatrixDefinitions.hpp](https://app.codecov.io/gh/cda-tum/mqt-core/pull/741?src=pr&el=tree&filepath=include%2Fmqt-core%2Fdd%2FGateMatrixDefinitions.hpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-aW5jbHVkZS9tcXQtY29yZS9kZC9HYXRlTWF0cml4RGVmaW5pdGlvbnMuaHBw) | `100.0% <100.0%> (ø)` | | ... and [16 files with indirect coverage changes](https://app.codecov.io/gh/cda-tum/mqt-core/pull/741/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum)