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

🎨🚨🔧 Ruff, mypy and project configuration #51

Closed KevinMTO closed 1 month ago

KevinMTO commented 1 month ago

Description

This PR resolves all ruff, mypy, and CodeQL warnings in the project. It also updates the project structure with the latest best practices.

Checklist:

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 81.84405% with 319 lines in your changes missing coverage. Please review.

Project coverage is 76.2%. Comparing base (a285729) to head (00a24bf). Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...n_aware_transpilation/log_local_adaptive_decomp.py 16.9% 44 Missing :warning:
...c/mqt/qudits/simulation/backends/stochastic_sim.py 60.0% 16 Missing :warning:
...g_aware_transpilation/phy_local_adaptive_decomp.py 85.0% 13 Missing :warning:
src/mqt/qudits/simulation/qudit_provider.py 40.9% 13 Missing :warning:
src/mqt/qudits/simulation/save_info.py 31.5% 13 Missing :warning:
src/mqt/qudits/simulation/jobs/jobstatus.py 64.5% 11 Missing :warning:
...t/qudits/visualisation/mini_quantum_information.py 21.4% 11 Missing :warning:
...er/twodit/entanglement_qr/phy_ent_qr_cex_decomp.py 37.5% 10 Missing :warning:
...ts/simulation/noise_tools/noisy_circuit_factory.py 85.9% 10 Missing :warning:
...riational_twodit_compilation/ansatz/instantiate.py 40.0% 9 Missing :warning:
... and 52 more
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/51/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/51?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 #51 +/- ## ======================================= - Coverage 79.1% 76.2% -2.9% ======================================= Files 117 117 Lines 5826 6123 +297 Branches 262 278 +16 ======================================= + Hits 4609 4670 +61 - Misses 1217 1453 +236 ``` | [Flag](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/51/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-qudits/pull/51/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | `63.7% <ø> (-10.0%)` | :arrow_down: | | [python](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/51/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | `80.6% <81.8%> (-0.3%)` | :arrow_down: | | [Files with missing lines](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/51?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | Coverage Δ | | |---|---|---| | [...mpilation\_minitools/local\_compilation\_minitools.py](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/51?src=pr&el=tree&filepath=src%2Fmqt%2Fqudits%2Fcompiler%2Fcompilation_minitools%2Flocal_compilation_minitools.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9xdWRpdHMvY29tcGlsZXIvY29tcGlsYXRpb25fbWluaXRvb2xzL2xvY2FsX2NvbXBpbGF0aW9uX21pbml0b29scy5weQ==) | `100.0% <100.0%> (ø)` | | | [...er/compilation\_minitools/naive\_unitary\_verifier.py](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/51?src=pr&el=tree&filepath=src%2Fmqt%2Fqudits%2Fcompiler%2Fcompilation_minitools%2Fnaive_unitary_verifier.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9xdWRpdHMvY29tcGlsZXIvY29tcGlsYXRpb25fbWluaXRvb2xzL25haXZlX3VuaXRhcnlfdmVyaWZpZXIucHk=) | `95.8% <100.0%> (+1.7%)` | :arrow_up: | | [src/mqt/qudits/compiler/compiler\_pass.py](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/51?src=pr&el=tree&filepath=src%2Fmqt%2Fqudits%2Fcompiler%2Fcompiler_pass.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9xdWRpdHMvY29tcGlsZXIvY29tcGlsZXJfcGFzcy5weQ==) | `92.3% <100.0%> (+10.4%)` | :arrow_up: | | [...mpiler/onedit/local\_operation\_swap/swap\_routine.py](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/51?src=pr&el=tree&filepath=src%2Fmqt%2Fqudits%2Fcompiler%2Fonedit%2Flocal_operation_swap%2Fswap_routine.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9xdWRpdHMvY29tcGlsZXIvb25lZGl0L2xvY2FsX29wZXJhdGlvbl9zd2FwL3N3YXBfcm91dGluZS5weQ==) | `98.9% <100.0%> (+<0.1%)` | :arrow_up: | | [...qudits/compiler/twodit/entanglement\_qr/\_\_init\_\_.py](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/51?src=pr&el=tree&filepath=src%2Fmqt%2Fqudits%2Fcompiler%2Ftwodit%2Fentanglement_qr%2F__init__.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9xdWRpdHMvY29tcGlsZXIvdHdvZGl0L2VudGFuZ2xlbWVudF9xci9fX2luaXRfXy5weQ==) | `100.0% <ø> (ø)` | | | [.../variational\_twodit\_compilation/ansatz/\_\_init\_\_.py](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/51?src=pr&el=tree&filepath=src%2Fmqt%2Fqudits%2Fcompiler%2Ftwodit%2Fvariational_twodit_compilation%2Fansatz%2F__init__.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9xdWRpdHMvY29tcGlsZXIvdHdvZGl0L3ZhcmlhdGlvbmFsX3R3b2RpdF9jb21waWxhdGlvbi9hbnNhdHovX19pbml0X18ucHk=) | `100.0% <100.0%> (ø)` | | | [...onal\_twodit\_compilation/ansatz/ansatz\_gen\_utils.py](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/51?src=pr&el=tree&filepath=src%2Fmqt%2Fqudits%2Fcompiler%2Ftwodit%2Fvariational_twodit_compilation%2Fansatz%2Fansatz_gen_utils.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9xdWRpdHMvY29tcGlsZXIvdHdvZGl0L3ZhcmlhdGlvbmFsX3R3b2RpdF9jb21waWxhdGlvbi9hbnNhdHovYW5zYXR6X2dlbl91dGlscy5weQ==) | `92.3% <100.0%> (+0.6%)` | :arrow_up: | | [...dit/variational\_twodit\_compilation/opt/\_\_init\_\_.py](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/51?src=pr&el=tree&filepath=src%2Fmqt%2Fqudits%2Fcompiler%2Ftwodit%2Fvariational_twodit_compilation%2Fopt%2F__init__.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9xdWRpdHMvY29tcGlsZXIvdHdvZGl0L3ZhcmlhdGlvbmFsX3R3b2RpdF9jb21waWxhdGlvbi9vcHQvX19pbml0X18ucHk=) | `100.0% <100.0%> (ø)` | | | [src/mqt/qudits/exceptions/\_\_init\_\_.py](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/51?src=pr&el=tree&filepath=src%2Fmqt%2Fqudits%2Fexceptions%2F__init__.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9xdWRpdHMvZXhjZXB0aW9ucy9fX2luaXRfXy5weQ==) | `100.0% <100.0%> (ø)` | | | [src/mqt/qudits/quantum\_circuit/\_\_init\_\_.py](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/51?src=pr&el=tree&filepath=src%2Fmqt%2Fqudits%2Fquantum_circuit%2F__init__.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum#diff-c3JjL21xdC9xdWRpdHMvcXVhbnR1bV9jaXJjdWl0L19faW5pdF9fLnB5) | `100.0% <100.0%> (ø)` | | | ... and [75 more](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/51?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum) | | ... and [9 files with indirect coverage changes](https://app.codecov.io/gh/cda-tum/mqt-qudits/pull/51/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=cda-tum)