Skip to content

NPA hierarchy [unitaryHACK]#61

Merged
vprusso merged 5 commits intovprusso:masterfrom
georgios-ts:pr-npa
May 20, 2021
Merged

NPA hierarchy [unitaryHACK]#61
vprusso merged 5 commits intovprusso:masterfrom
georgios-ts:pr-npa

Conversation

@georgios-ts
Copy link
Copy Markdown
Contributor

@georgios-ts georgios-ts commented May 17, 2021

Description

Resolves #5.
Implements a function to calculate an upper bound on the commuting measurement value of a nonlocal game.

Questions

  • Is toqito/helper the best place for npa_hierarchy.py or we should expose the functionality of npa_constraints to the user?

Status

  • Ready to go

@codecov
Copy link
Copy Markdown

codecov bot commented May 17, 2021

Codecov Report

Merging #61 (31a340d) into master (834549e) will increase coverage by 0.0%.
The diff coverage is 99.2%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #61    +/-   ##
=======================================
  Coverage    98.7%   98.7%            
=======================================
  Files         117     118     +1     
  Lines        2179    2319   +140     
  Branches      504     556    +52     
=======================================
+ Hits         2151    2290   +139     
  Misses         12      12            
- Partials       16      17     +1     
Impacted Files Coverage Δ
toqito/helper/npa_hierarchy.py 99.1% <99.1%> (ø)
toqito/nonlocal_games/nonlocal_game.py 98.4% <100.0%> (+0.1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 834549e...31a340d. Read the comment docs.

if len(_reduce(word_b)) == i - j:
words += [word_a + word_b]

# now generate the intermediate levels of hierarchy
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

According to the testing coverage, it looks like:

toqito/helper/npa_hierarchy.py                        123      0     92      3    98.60%   51->48, 90->89, 92->91

indicating that in order to achieve full coverage, testing some other examples involving intermediate levels would be a worthwhile test to include.

Comment thread tests/test_helper/test_npa_constraints.py Outdated
Comment thread toqito/helper/npa_hierarchy.py Outdated
Comment thread tests/test_helper/test_npa_constraints.py Outdated
Comment thread tests/test_helper/test_npa_constraints.py Outdated
Comment thread toqito/nonlocal_games/nonlocal_game.py Outdated
Comment thread toqito/helper/npa_hierarchy.py Outdated
Comment thread toqito/helper/npa_hierarchy.py Outdated
Comment thread toqito/helper/npa_hierarchy.py Outdated
Comment thread toqito/helper/npa_hierarchy.py
@vprusso
Copy link
Copy Markdown
Owner

vprusso commented May 18, 2021

Hi @georgios-ts. Great effort here, I think this is looking really great so far, so that's fantastic :)

Regarding your question:

Is toqito/helper the best place for npa_hierarchy.py or we should expose the functionality of npa_constraints to the user?

Hmm, that is a good question. Some candidate ideas are to place it directly within the NonlocalGame class. Since the NPA hierarchy really only applies to functionality pertaining to a nonlocal game anyway, it might make sense to consolidate it there. The downside of that of course is that it bloats the code. I think for now though, where you have it makes sense to me at the moment.

In short, I'm not too strongly opinionated as to where it goes. You obviously are a very capable and experienced developer, and part of the (selfish) benefit from my perspective is that this gives me an opportunity to learn from you. This is perhaps a broader point, but if you have feedback on a larger scale about the structure of the project, I would love to hear that from you. Anyway, that's all tangential--the takeaway there is I will let you use your best discretion on that front.

Regarding the second part of your question, I think you did a great job in exposing the proper interface to the user--namely, the function you wrote inside the NonlocalGame class is probably all we wish the user to have exposure to.

As I said, overall, looks great. I added quite a few comments in the diff, but rest assured, they are all quite minor.

Do let me know if you have any questions, disagree about my comments, or have any input at all. Cheers!

@georgios-ts
Copy link
Copy Markdown
Contributor Author

Thanks @vprusso.
Ok, my suggestion is to leave it where it is for now (in toqito/helper).

Honestly, the structure of the project is great! It's simple, clean, easy to navigate and each function is well documented.

@vprusso
Copy link
Copy Markdown
Owner

vprusso commented May 19, 2021

Hi @georgios-ts. Great job addressing all of my comments. I know a lot of them were quite pedantic and trivial, but thank you kindly for taking the time to alter them. I see you made some updates and I just wanted to be sure that you aren't waiting for any input on my end. Of course, if you are still chugging along, I also don't want to be overly burdensome. Basically just checking in to make sure you're not waiting on me :)

@georgios-ts
Copy link
Copy Markdown
Contributor Author

Hi @vprusso, this is ready from my side.

@vprusso
Copy link
Copy Markdown
Owner

vprusso commented May 20, 2021

@georgios-ts. Fantastic, I'll merge away! :)

@vprusso vprusso merged commit 4b7399e into vprusso:master May 20, 2021
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.

Feature: NPA hierarchy

2 participants