-
Notifications
You must be signed in to change notification settings - Fork 26
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
[Quantum Chinese Chess] Add SplitJump and MergeJump #166
Conversation
alpha.PhasedMove(-0.5)(source_0, target_0) | ||
alpha.PhasedMove(-0.5)(source_1, target_0) | ||
# Pass the classical properties of the source pieces to the target piece. | ||
target_0.reset(source_0) |
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.
This semantic is kind of confusing. I am not totally sure if this is correct. Remind me what reset is supposed to do again?
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.
It copies the "type", "color" and "is_entangled" properties from source_0 to target_0.
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 see. And we are assuming that type, color are the same for source_0 and source_1.
Couldn't is_entangled be different for source_0 and source_1 though?
Also, do we ever fix the type/color for the source squares? Like, they may be empty now, right?
I don't think this logic is correct.
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.
Hi Doug, yes, earlier in chess.py we've checked to make sure source_0 and source_1 have the same type, color, and is_entangled = true (maybe later we could support classical to merge with entangled piece).
The type/color/is_entangled for source squares are fixed through the method "update_board_by_sampling()" in chess.py, which will be called after each move. There are cases that they won't be reset to empty (see test cases for those scenarios).
The source piece for SplitJump will also be fixed through update_board_by_sampling().
|
||
def test_merge_jump_imperfect_merge_scenario_3(): | ||
# Imperfect merge scenario 3 | ||
# This is a simplied version of the scenario above, where we unhook a3 and b3. |
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.
Consider changing the line comments here and above to docstrings with triple quotes. I think they will show up in IDEs better.
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.
Thanks Doug! It's updated.
Add SplitJump and MergeJump as new moves.