-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Conversation
Based on https://github.com/Microsoft/Quantum/tree/master/Samples/src/CHSHGame Co-authored-by: Justin Sievers <justinmsievers@gmail.com> Co-authored-by: Johnny Wang <aptx.hdc@gmail.com>
This looks good overall, thank you! Here are several high-level comments/ideas for improvement:
Please let me know if you want to do these changes; if not, I'll probably have some time for that after I've done a first pass on the rest of the PRs, maybe next week. |
Thanks for the feedback! Those sound like good suggestions. I agree that task 5 can be done better, in particular. I'll try to find some time to make the changes (hopefully by this weekend). |
@tcNickolas Changes made. :) Should the comment from the CHSH game sample be included in this kata (in the Tasks.qs header or the README) as an introduction for the users? |
Wow, that was fast! :-) I'll take a look on Monday. I would include a very brief introduction (literally a couple of words about what nonlocal games show and how CHSH game is one of the most famous examples of them) to the README.md, but not copy the whole comment. I prefer including sources, like https://cs.uwaterloo.ca/~watrous/CPSC519/LectureNotes/20.pdf, whenever possible instead of full explanations. |
With the classical Alice and Bob tasks, they have to return a value for it to compile, so the way other katas do it is to return some default value before the user completes the task. But if they both return false for example, then that's already the optimal strategy. :) They could return different values to fail the tests but that gives away the solution a little. Using fail statements gets around this.
* Remove launch.json * Add introduction to the kata tasks * Switch test for task 1.2 to success rate * Remove checking qubit state after operation from tasks 2.2 and 2.4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a round of cleanup - mostly small presentation things which didn't make sense as comments :-) Two relatively large changes are
- test for task 1.2 - I think it works better based on success rate instead of single-time call, since this allows to experiment with randomized strategies (the old test would pass a randomized strategy half of the time, even though its success rate is 50%).
- tests for tasks 2.2 and 2.4 - I think it's better not to restrict the state of the qubit after the measurement, since there are different measurements that can produce the same answer but leave the qubit in different states.
I think everything looks great now! Please take a look and let me know if you disagree with any of the changes - if things look good to you too I'll merge it.
I did this to try to make sure they weren't measuring in the wrong basis and just getting lucky with the results, but I think I see how it's too strict now (if they use H then measure in the Z basis), especially since measurements in the wrong basis should still be caught by the test for task 2.5. The changes look good. :) |
Based on https://github.com/Microsoft/Quantum/tree/master/Samples/src/CHSHGame
The kata also includes an experiment for Bob's qubit rotations (described in the README) that we wrote for our project, but I'm not sure if that should stay in the kata.
Co-authored-by: Justin Sievers justinmsievers@gmail.com
Co-authored-by: Johnny Wang aptx.hdc@gmail.com