Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix value of the spectrum returned in the quantum_info.entropies.von_neumann_entropy #1360

Merged
merged 4 commits into from
Jun 17, 2024

Conversation

alhajri
Copy link

@alhajri alhajri commented Jun 13, 2024

The Von Neumann entropy function when return_spectrum=True returns -log(eigenvalues). However, if the state is pure, return_spectrum=True returned 1.0 which is the value of the eigenvalue, not the -log. The function is now changed to return 0.0 to be more consistent with the behavior of the function in the pure case.

Checklist:

  • Reviewers confirm new code works as expected.
  • Tests are passing.
  • Coverage does not decrease.
  • Documentation is updated.

@alhajri alhajri requested a review from renatomello June 13, 2024 11:06
@renatomello renatomello added the bug Something isn't working label Jun 13, 2024
@renatomello renatomello added this to the Qibo 0.2.9 milestone Jun 13, 2024
@renatomello renatomello changed the title changed the value of the spectrum returned in the von neumann entropy Fix value of the spectrum returned in the quantum_info.entropies.von_neumann_entropy Jun 13, 2024
@renatomello renatomello added the quantum_info module PRs and issues related to the quantum information module label Jun 13, 2024
Copy link

codecov bot commented Jun 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.84%. Comparing base (5676a8a) to head (6a13965).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1360   +/-   ##
=======================================
  Coverage   99.84%   99.84%           
=======================================
  Files          74       74           
  Lines       10759    10759           
=======================================
  Hits        10742    10742           
  Misses         17       17           
Flag Coverage Δ
unittests 99.84% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@renatomello renatomello added this pull request to the merge queue Jun 17, 2024
Merged via the queue into master with commit 70901d5 Jun 17, 2024
24 of 25 checks passed
@renatomello renatomello deleted the log_entropies branch June 17, 2024 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working quantum_info module PRs and issues related to the quantum information module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants