Part I: Quantum Chess
(github repo)
Now, before I get any snarky replies, I know that "quantum chess" is a bit of a misnomer. Chess is already quantum! Like most modern pop-science uses of the word, I am of course using it to describe a chess variation that implements superposition of game states, but "superpositional chess" just doesn't roll off the tongue like Quantum Chess does. If you have a better idea for a name, let me know.
The idea is simple: in a standard game of chess, each of the two players take turns making a single move each turn. The same is true of quantum chess, except that a player has the option to, instead of moving a piece to a specific square, place a piece in a superposition of all possible moves that that piece could have made. Future moves will eventually reveal that there is only one space that the piece could have moved to for the sequence of moves to be legal, at which point the waveform collapses upon that move.
To give a simple example, I will employ a Python program I wrote to visualize such a game, which I will explain later on.
White's first move is to place their knight in superposition. Every move that the knight could have made is highlighted in magenta. Black replies with e5, but it doesn't matter for the sake of this example.
White then plays c4, which is only a legal move if Nc3 was not played. Since the only other move that could have been made was Na3, the state of that knight collapses upon that move.
Some clarification on the rules:
What I find fascinating about this game is twofold: firstly, the fundamental rules of chess are unaltered. At the end of a game of quantum chess, after every piece's eventual location is known, the game can be replayed from the beginning and will consist only of standard, legal chess moves. Secondly, because of the fact that the game's fundamental rules are unaltered, some variation of this could be applied to any turn-based, shared-information game with no element of chance.
Before I realized the second point, I tried writing a software implementation that sought to describe pieces in superposition as some sort of strange meta-pieces on a single board that would either resolve to real pieces of end up being annihilated when their twin was resolved, but this was horribly cumbersome, slow, and inelegant. Around refactor no. 3 I realized that I could simply simulate chess normally, but place the entire game state in a superposition. The resulting code was comically simple once I resorted to using a standard chess engine library as a base. Most of it ended up just being the ASCII visualization.
If a superposition is played, the game state is cloned and a new branch is made for each move that could have been made. Every time a subsequent move is made, the move is attempted in all branches. If that move is illegal in that branch, the branch is culled. It would seem like this would result in exponentially ballooning game states in memory, but the fact that each superpositioned piece's start square must be known means that even in a superpositionally-heavy game, only a few hundred states are active at once in the worst cases.
You can download and play it yourself here: https://github.com/CalcMeister/QuantumChess
The emergent meta of such a game is also fascinating! It would seem like such a ruleset would make queens and rooks even more powerful than they already are; being able to superposition pieces effectively renders you able to save a move for later, then move twice at once. For a piece like a queen, this can be very powerful.
In this example, white has decided to trade their bishop for black's knight in the Ruy Lopez, and then castles kingside.
To reply, black could choose to place their queen in superposition; this potentially allows black to reach nearly anywhere on the board on their next turn! White's pawn on e4 is vulnerable to be captured, and cannot be immediately defended against by white's knight. (Note: the notation on d2 indicates that that square contains either black's queen or white's pawn.)
White could attempt to capture the queen by entering the queen's probability field, but this is futile! In one possible universe, the queen could have moved to where the white knight now sits, but that move does not prove that the queen couldn't have moved somewhere else.
The queen takes advantage of this blunder and captures white's knight for free. White replies, cheekily, by superpositioning their own queen.
Black, sensing trouble, quickly escapes to the ether by superpositioning their own queen—there is nothing now white's queen can do to capture black's. It's a bit of a mess to look at, I know.
Now THIS is where things get really interesting. There is a special property of a certain unappreciated piece that destroys black's effort to escape... (Here's where I'd suggest you pause the video and see if you can figure it out for yourself.)
For those of you who got it, congratulations! The winning realization is this:
Pawns can only move diagonally when capturing.
White plays hxg3, which immediately collapses the probability field on black's queen having moved there. Since white's pawn could only have moved diagonally if it captured a piece on its destination square, black's queen necessarily MUST have moved to g3 for the game to remain legal. Thus, black's queen is captured from its superposition my quantum chess's most powerful piece: the pawn. (You may also notice that there is now a chunk missing from white's probability field—this is because black's queen moved through it on the last turn, necessitating that the white queen could not have moved there.
Because of this oddity, pawns end up being the most powerful piece in the game. Haphazard superpositions are immediately punished by pawn captures, so moves must be carefully planned so that probability fields are not in the line of fire of pawns. There are a few other interesting side effects I've discovered while playing this with friends:
Note: While writing this section, I realized that I can make this game even more interesting by truly bringing it in parallel with Heisenberg's uncertainty principle. My existing implementation of superposition is just that: the knowledge that a specific piece has moved, but no knowledge of where. The obvious opposite to this would be to know precisely where a piece has moved to, but not which one. I'm going to change the rules so that only one of two moves can be made:
This is much more elegant. This will leave the game largely unchanged—most squares only have one piece that can move to them at a time, so the waveform will collapse as soon as it is created. But there will be some instances where that is not the case, and I will explore them as soon as I implement it!
Part II: Many-Worlds Solitaire
The chief problem with quantum chess is this: no one wants to play it with me. It's simply too ridiculous to explain to most, and can't really be easily played on a standard chessboard. As with most of my strange fixations, I am relegated to enjoying them in solitude.
The idea is simple: I want to play an opponent in a derivative variation of quantum chess that instead of having some complex game-tree search algorithm or AI cooking up moves, I simply play an opponent that, each turn, plays every single move it can legally make.
I visualize this by displaying a board that only shows my pieces and not my opponent's—my opponent's pieces' probability fields quickly spread across the entire board like a virus. White (the player) can only make normal chess moves, and loses whenever they are in checkmate in ANY active game state in superposition.
The advantage of this is that it is deterministic, and therefore a true solitaire; no decisions must be made on behalf of the opponent. The disadvantage is that unlike normal quantum chess, the game states really do balloon, and quickly.
It's also pretty hard to lose, and yet-unclear how to win. I've verified that it works (by playing the fools mate, I am notified that I have been checkmated) but I haven't gotten checkmated any other way. One apparent weakness of such a game is that there is no clear way for white's pieces to end up being captured. For a piece to be captured, it would have to be taken in every single possible universe—by moving it, white culls the multitude of states where the piece had been captured.
I am very intrigued by the idea of a chess-based deterministic solitaire, but I need ideas for rules that make white more adversarial. Any ideas? This isn't really a clean ending to this post, but it's all I've got! :p
(github repo)
Now, before I get any snarky replies, I know that "quantum chess" is a bit of a misnomer. Chess is already quantum! Like most modern pop-science uses of the word, I am of course using it to describe a chess variation that implements superposition of game states, but "superpositional chess" just doesn't roll off the tongue like Quantum Chess does. If you have a better idea for a name, let me know.
The idea is simple: in a standard game of chess, each of the two players take turns making a single move each turn. The same is true of quantum chess, except that a player has the option to, instead of moving a piece to a specific square, place a piece in a superposition of all possible moves that that piece could have made. Future moves will eventually reveal that there is only one space that the piece could have moved to for the sequence of moves to be legal, at which point the waveform collapses upon that move.
To give a simple example, I will employ a Python program I wrote to visualize such a game, which I will explain later on.
White's first move is to place their knight in superposition. Every move that the knight could have made is highlighted in magenta. Black replies with e5, but it doesn't matter for the sake of this example.
White then plays c4, which is only a legal move if Nc3 was not played. Since the only other move that could have been made was Na3, the state of that knight collapses upon that move.
Some clarification on the rules:
- Placing a piece in superposition means it must simultaneously inhabit all possible destination squares. You can't just pick a few.
Pieces must be moved or superpositioned from a known source square. You can't "double superposition" a piece by claiming it has moved twice from some square.
Technically, it is game states that are being placed in superposition, not pieces. This means that a king could theoretically be in a superposition between moving up and castling, for example, or perhaps a pawn could be in a superposition between all its possible promotions.
What I find fascinating about this game is twofold: firstly, the fundamental rules of chess are unaltered. At the end of a game of quantum chess, after every piece's eventual location is known, the game can be replayed from the beginning and will consist only of standard, legal chess moves. Secondly, because of the fact that the game's fundamental rules are unaltered, some variation of this could be applied to any turn-based, shared-information game with no element of chance.
Before I realized the second point, I tried writing a software implementation that sought to describe pieces in superposition as some sort of strange meta-pieces on a single board that would either resolve to real pieces of end up being annihilated when their twin was resolved, but this was horribly cumbersome, slow, and inelegant. Around refactor no. 3 I realized that I could simply simulate chess normally, but place the entire game state in a superposition. The resulting code was comically simple once I resorted to using a standard chess engine library as a base. Most of it ended up just being the ASCII visualization.
If a superposition is played, the game state is cloned and a new branch is made for each move that could have been made. Every time a subsequent move is made, the move is attempted in all branches. If that move is illegal in that branch, the branch is culled. It would seem like this would result in exponentially ballooning game states in memory, but the fact that each superpositioned piece's start square must be known means that even in a superpositionally-heavy game, only a few hundred states are active at once in the worst cases.
You can download and play it yourself here: https://github.com/CalcMeister/QuantumChess
The emergent meta of such a game is also fascinating! It would seem like such a ruleset would make queens and rooks even more powerful than they already are; being able to superposition pieces effectively renders you able to save a move for later, then move twice at once. For a piece like a queen, this can be very powerful.
In this example, white has decided to trade their bishop for black's knight in the Ruy Lopez, and then castles kingside.
To reply, black could choose to place their queen in superposition; this potentially allows black to reach nearly anywhere on the board on their next turn! White's pawn on e4 is vulnerable to be captured, and cannot be immediately defended against by white's knight. (Note: the notation on d2 indicates that that square contains either black's queen or white's pawn.)
White could attempt to capture the queen by entering the queen's probability field, but this is futile! In one possible universe, the queen could have moved to where the white knight now sits, but that move does not prove that the queen couldn't have moved somewhere else.
The queen takes advantage of this blunder and captures white's knight for free. White replies, cheekily, by superpositioning their own queen.
Black, sensing trouble, quickly escapes to the ether by superpositioning their own queen—there is nothing now white's queen can do to capture black's. It's a bit of a mess to look at, I know.
Now THIS is where things get really interesting. There is a special property of a certain unappreciated piece that destroys black's effort to escape... (Here's where I'd suggest you pause the video and see if you can figure it out for yourself.)
For those of you who got it, congratulations! The winning realization is this:
Pawns can only move diagonally when capturing.
White plays hxg3, which immediately collapses the probability field on black's queen having moved there. Since white's pawn could only have moved diagonally if it captured a piece on its destination square, black's queen necessarily MUST have moved to g3 for the game to remain legal. Thus, black's queen is captured from its superposition my quantum chess's most powerful piece: the pawn. (You may also notice that there is now a chunk missing from white's probability field—this is because black's queen moved through it on the last turn, necessitating that the white queen could not have moved there.
Because of this oddity, pawns end up being the most powerful piece in the game. Haphazard superpositions are immediately punished by pawn captures, so moves must be carefully planned so that probability fields are not in the line of fire of pawns. There are a few other interesting side effects I've discovered while playing this with friends:
- If a piece is superpositioned in such a way that some, but not all possible destination squares place the opponent in check, those possibilities will be culled if the opponent elects on their next turn not to move their king, since you cannot leave your king in check.
If a piece besides a pawn moves into an opposing piece's probability field, the opponent can simply move their piece from a different ending location to keep it alive. If they don't do that in time, it's possible to kill the piece forever by trampling the rest of the probability field on subsequent turns by pieces of any color, thus requiring that the piece must have been taken at some point.
If there are no pieces on your base rank besides your king and both rooks, it's possible to put your king in a superposition between all its cardinal moves as well as both castles, all at once.
A pawn in superposition from its starting square is very powerful. It can effectively cover four possible squares at once, each delivering a killing blow if an opposing probability field gets too close.
Pieces besides pawns can "un-superposition" by moving back to the square they came from.
Note: While writing this section, I realized that I can make this game even more interesting by truly bringing it in parallel with Heisenberg's uncertainty principle. My existing implementation of superposition is just that: the knowledge that a specific piece has moved, but no knowledge of where. The obvious opposite to this would be to know precisely where a piece has moved to, but not which one. I'm going to change the rules so that only one of two moves can be made:
- a) A move from a known square to an unknown one
b) A move from an unknown square to a known one
This is much more elegant. This will leave the game largely unchanged—most squares only have one piece that can move to them at a time, so the waveform will collapse as soon as it is created. But there will be some instances where that is not the case, and I will explore them as soon as I implement it!
Part II: Many-Worlds Solitaire
The chief problem with quantum chess is this: no one wants to play it with me. It's simply too ridiculous to explain to most, and can't really be easily played on a standard chessboard. As with most of my strange fixations, I am relegated to enjoying them in solitude.
The idea is simple: I want to play an opponent in a derivative variation of quantum chess that instead of having some complex game-tree search algorithm or AI cooking up moves, I simply play an opponent that, each turn, plays every single move it can legally make.
I visualize this by displaying a board that only shows my pieces and not my opponent's—my opponent's pieces' probability fields quickly spread across the entire board like a virus. White (the player) can only make normal chess moves, and loses whenever they are in checkmate in ANY active game state in superposition.
The advantage of this is that it is deterministic, and therefore a true solitaire; no decisions must be made on behalf of the opponent. The disadvantage is that unlike normal quantum chess, the game states really do balloon, and quickly.
It's also pretty hard to lose, and yet-unclear how to win. I've verified that it works (by playing the fools mate, I am notified that I have been checkmated) but I haven't gotten checkmated any other way. One apparent weakness of such a game is that there is no clear way for white's pieces to end up being captured. For a piece to be captured, it would have to be taken in every single possible universe—by moving it, white culls the multitude of states where the piece had been captured.
I am very intrigued by the idea of a chess-based deterministic solitaire, but I need ideas for rules that make white more adversarial. Any ideas? This isn't really a clean ending to this post, but it's all I've got! :p