qiboteam / qibo

A full-stack framework for quantum computing.
https://qibo.science
Apache License 2.0
294 stars 60 forks source link

Symbolic Hamiltonian with constants #1389

Closed alecandido closed 4 months ago

alecandido commented 4 months ago

Fixes #1383

Checklist:

alecandido commented 4 months ago

@mho291 I started adding a minimal test that reproduces your issue.

I'm now going to add the patch that should make that test passing. Whenever you have time, confirm that the test is close enough to what you expect (then I will also ask to check the full fix).

codecov[bot] commented 4 months ago

Codecov Report

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

Project coverage is 99.84%. Comparing base (98a310a) to head (b51190c). Report is 26 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1389 +/- ## ========================================== - Coverage 99.84% 99.84% -0.01% ========================================== Files 76 76 Lines 10844 10843 -1 ========================================== - Hits 10827 10826 -1 Misses 17 17 ``` | [Flag](https://app.codecov.io/gh/qiboteam/qibo/pull/1389/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/1389/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=qiboteam) | `99.84% <100.00%> (-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.

alecandido commented 4 months ago

For the time being, it's a quick patch (plus some docstrings beautifications).

I wanted to refactor a bit more the function. But I took a look at the rest of the module, and there are many things to refactor. So, it's not worth to do it now, better to allocate some time and do it consistently.

mho291 commented 4 months ago

Thanks @alecandido ! I have checked the code and verified it works. Will approve the changes.