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

Mutual Information I(𝒶, 𝒷) and improving doctests/documentation in entanglement.jl #338

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Fe-r-oz
Copy link
Contributor

@Fe-r-oz Fe-r-oz commented Aug 9, 2024

This PR aims to introduce Mutual Information I(A,B) along with improving the doctests and documentation in the entanglement.jl .

In the future, if you like, it would be better to have a entanglement introduced in the manual of either "algebra" or upcoming "circuit simulation" manual.

In the papers, there were many graphs, I think based on entanglement entropy that could be reproduced in a tutorial fashion. Hopefully, this sounds interesting.
....
If you want to submit an unfinished piece of work in order to get comments and discuss, please mark the pull request as a draft and ping the repository maintainer.

Please address only one topic or issue per pull request! Many small PRs are much easier to review and merge than one large PR.

Before merging, all changes and new functionality should be marked in the CHANGELOG file, but feel free to just leave your CHANGELOG notes in the PR description, to avoid merge conflicts with other requests modifying that file. The maintainer will add these CHANGELOG notes for you if you do so.

Before considering your pull request ready for review and merging make sure that all of the following are completed (please keep the clecklist as part of your PR):

  • The code is properly formatted and commented.
  • Substantial new functionality is documented within the docs.
  • All new functionality is tested.
  • All of the automated tests on github pass.

If possible, keep your git history not too wild (rebase and squash commits, keep commits small and semantically separated) so that review is easier.

@Fe-r-oz Fe-r-oz changed the title Mutual Information I(A,B) and improving doctests/documentation in entanglement.jl Mutual Information I(𝒶, 𝒷) and improving doctests/documentation in entanglement.jl Aug 9, 2024
Copy link

codecov bot commented Aug 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.55%. Comparing base (e51a142) to head (b616cdd).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #338      +/-   ##
==========================================
+ Coverage   82.48%   82.55%   +0.06%     
==========================================
  Files          62       62              
  Lines        4186     4202      +16     
==========================================
+ Hits         3453     3469      +16     
  Misses        733      733              

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

Copy link
Member

@Krastanov Krastanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, this is an interesting addition. I left a few comments in.

docs/src/references.bib Outdated Show resolved Hide resolved
src/entanglement.jl Outdated Show resolved Hide resolved
src/entanglement.jl Outdated Show resolved Hide resolved
src/entanglement.jl Outdated Show resolved Hide resolved
src/entanglement.jl Outdated Show resolved Hide resolved
src/entanglement.jl Outdated Show resolved Hide resolved
src/entanglement.jl Outdated Show resolved Hide resolved
src/entanglement.jl Outdated Show resolved Hide resolved
src/entanglement.jl Outdated Show resolved Hide resolved
src/entanglement.jl Outdated Show resolved Hide resolved
@Fe-r-oz Fe-r-oz marked this pull request as draft August 10, 2024 20:59
@Fe-r-oz Fe-r-oz force-pushed the entanglement branch 2 times, most recently from 86d5c0a to f88334b Compare August 18, 2024 14:09
@Fe-r-oz Fe-r-oz marked this pull request as ready for review August 18, 2024 14:44
@Fe-r-oz Fe-r-oz requested a review from Krastanov August 18, 2024 14:45
Copy link
Member

@Krastanov Krastanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty good.

Apologies for not prioritizing this style of PRs -- you have a lot and I have tried to address the higher value ones first, whenever I have time.

I left a few comments in, mainly motivated by the needs of some other parts of the ecosystem that we try to coordinate with.

@@ -77,7 +77,7 @@ export
# Group theory tools
groupify, minimal_generating_set, pauligroup, normalizer, centralizer, contractor, delete_columns,
# Clipped Gauge
canonicalize_clip!, bigram, entanglement_entropy,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's not export it as this is something we would want to synchronize with QuantumInterface

Could you post an issue at https://github.com/qojulia/QuantumInterface.jl/ describing the need for a new generic function and referencing this PR. The goal would be to pick a name that can be reused by other packages.

In the meantime, keeping this unexported will let us merge this PR without waiting for that coordination.

`B(𝒢) ≡ {(𝓁(g₁),𝓇(g₁)),…,(𝓁(gₙ),𝓇(gₙ))}`

The clipped gauge `𝒢` is a specific choice of stabilizer state where exactly two stabilizer endpoints exist at each site,
ensuring `ρₗ(x) + ρᵣ(x) = 2` for all sites `x` where `ρ` represents the reduced density matrix for the subsystem under
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sentence is unclear to me. How can two density matrices sum up to be the scalar 2?

```

See Eq. E6 of [li2019measurement](@cite). See also: [`entanglement_entropy`](@ref)
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should probably be a docstring for a function declaration function mutual_information end, and not be attached to a specific method. Or probably even better if there is a method with some default choice of algorithm (that way it will not cause issues when this gets declared in QuantumInterface).

@@ -50,4 +50,24 @@
@test entanglement_entropy(copy(s), subsystem, Val(:graph))==2
@test entanglement_entropy(copy(s), subsystem, Val(:rref))==2
end

@testset "Mutual information for Clifford circuits" begin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

additional tests that use QuantumOptics to double check the results independently would be very valuable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants