cda-tum / mqt-qudits

A Framework For Mixed-Dimensional Qudit Quantum Computing
https://mqt.readthedocs.io/projects/qudits
MIT License
17 stars 4 forks source link

Added state preparation compiler feature #28

Closed KevinMTO closed 4 months ago

KevinMTO commented 4 months ago

Overview: This PR adds a new feature to the compiler, enabling it to create a sequence of (multi-controlled) operations that will prepare the circuit to a specific state input by the user.

Description:

Checklist:

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 84.67153% with 63 lines in your changes missing coverage. Please review.

Project coverage is 72.8%. Comparing base (de01837) to head (fa6e421). Report is 22 commits behind head on main.

Files with missing lines Patch % Lines
src/mqt/qudits/core/micro_dd.py 79.2% 43 Missing :warning:
...ts/compiler/state_compilation/state_preparation.py 92.8% 8 Missing :warning:
src/mqt/qudits/quantum_circuit/circuit.py 14.2% 6 Missing :warning:
...udits/compiler/state_compilation/retrieve_state.py 94.8% 4 Missing :warning:
...tional_twodit_compilation/opt/distance_measures.py 66.6% 2 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/28/graphs/tree.svg?width=650&height=150&src=pr&token=qDDZkemicI&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-qudits/pull/28?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 #28 +/- ## ======================================= + Coverage 69.7% 72.8% +3.1% ======================================= Files 105 108 +3 Lines 4964 5375 +411 Branches 263 263 ======================================= + Hits 3462 3917 +455 + Misses 1502 1458 -44 ``` | [Flag](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/28/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | Coverage Δ | | *Carryforward flag | |---|---|---|---| | [cpp](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/28/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | `73.7% <ø> (ø)` | | Carriedforward from [695cd9e](https://app.codecov.io/gh/cda-tum/mqt-qudits/commit/695cd9ea836d3bf692791503fd0677336537552f?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | | [python](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/28/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | `72.5% <84.6%> (+4.4%)` | :arrow_up: | | *This pull request uses carry forward flags. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) to find out more. | [Files with missing lines](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/28?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | Coverage Δ | | |---|---|---| | [src/mqt/qudits/quantum\_circuit/gate.py](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/28?src=pr&el=tree&filepath=src%2Fmqt%2Fqudits%2Fquantum_circuit%2Fgate.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9xdWRpdHMvcXVhbnR1bV9jaXJjdWl0L2dhdGUucHk=) | `83.8% <100.0%> (+0.2%)` | :arrow_up: | | [...tional\_twodit\_compilation/opt/distance\_measures.py](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/28?src=pr&el=tree&filepath=src%2Fmqt%2Fqudits%2Fcompiler%2Ftwodit%2Fvariational_twodit_compilation%2Fopt%2Fdistance_measures.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9xdWRpdHMvY29tcGlsZXIvdHdvZGl0L3ZhcmlhdGlvbmFsX3R3b2RpdF9jb21waWxhdGlvbi9vcHQvZGlzdGFuY2VfbWVhc3VyZXMucHk=) | `35.1% <66.6%> (+35.1%)` | :arrow_up: | | [...udits/compiler/state\_compilation/retrieve\_state.py](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/28?src=pr&el=tree&filepath=src%2Fmqt%2Fqudits%2Fcompiler%2Fstate_compilation%2Fretrieve_state.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9xdWRpdHMvY29tcGlsZXIvc3RhdGVfY29tcGlsYXRpb24vcmV0cmlldmVfc3RhdGUucHk=) | `94.8% <94.8%> (ø)` | | | [src/mqt/qudits/quantum\_circuit/circuit.py](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/28?src=pr&el=tree&filepath=src%2Fmqt%2Fqudits%2Fquantum_circuit%2Fcircuit.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9xdWRpdHMvcXVhbnR1bV9jaXJjdWl0L2NpcmN1aXQucHk=) | `92.9% <14.2%> (-2.7%)` | :arrow_down: | | [...ts/compiler/state\_compilation/state\_preparation.py](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/28?src=pr&el=tree&filepath=src%2Fmqt%2Fqudits%2Fcompiler%2Fstate_compilation%2Fstate_preparation.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9xdWRpdHMvY29tcGlsZXIvc3RhdGVfY29tcGlsYXRpb24vc3RhdGVfcHJlcGFyYXRpb24ucHk=) | `92.8% <92.8%> (ø)` | | | [src/mqt/qudits/core/micro\_dd.py](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/28?src=pr&el=tree&filepath=src%2Fmqt%2Fqudits%2Fcore%2Fmicro_dd.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9xdWRpdHMvY29yZS9taWNyb19kZC5weQ==) | `79.2% <79.2%> (ø)` | | ... and [11 files with indirect coverage changes](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/28/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum)