qiboteam / qibo

A framework for quantum computing
https://qibo.science
Apache License 2.0
287 stars 58 forks source link

Generalization of `models.unary_encoder(nqubits, architecture="tree")` for all `nqubits` #1380

Closed renatomello closed 2 months ago

renatomello commented 2 months ago

This function was previously implemented only for when nqubits was a power of 2. Now it works for general nqubits.

Checklist:

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.

Project coverage is 99.83%. Comparing base (98a310a) to head (bb09dfb).

Files Patch % Lines
src/qibo/models/encodings.py 94.11% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1380 +/- ## ========================================== - Coverage 99.84% 99.83% -0.01% ========================================== Files 76 76 Lines 10844 10846 +2 ========================================== + Hits 10827 10828 +1 - Misses 17 18 +1 ``` | [Flag](https://app.codecov.io/gh/qiboteam/qibo/pull/1380/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/qiboteam/qibo/pull/1380/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) | `99.83% <94.11%> (-0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

renatomello commented 2 months ago

This is not gonna be as simple as I initially thought. So I'm gonna close this for now and recreate the PR if and when we have a general solution.