‹ Back to Blog

118 Legal Moves Per Turn

An SDK for Quantum Chess AI

quantum-chessopen-sourceaiquantum-computingsdk

A Quantum Chess board mid-game, with pieces in superposition glowing pink and orange

Chess made AI what it is. From Claude Shannon’s 1950 paper sketching out how a machine might play chess, through Deep Blue’s 1997 match against Kasparov, to AlphaZero teaching itself superhuman play in four hours, chess has been the gym where we figured out how to make computers think. Or at least, how to make them look like they’re thinking.

Today I’m open sourcing the Quantum Chess SDK, a TypeScript package that gives you everything you need to build your own Quantum Chess AI. The game rules, the move generator, the match runner, and a sandboxed lookahead engine you can search against. Implement one method and you have a player. I’m excited about this one.

What chess did for AI

There’s a pattern here.

Shannon’s paper wasn’t really about chess. It was about using chess as a tractable test case for questions about search, evaluation, and decision-making under combinatorial explosion. The game was a convenient microcosm: well-defined rules, a clear objective, a vast search space, and an existing population of strong human players to measure against.

That framing held for half a century. Chess engines drove the development of alpha-beta pruning, transposition tables, iterative deepening, null-move heuristics, and a long list of search and evaluation techniques that became standard tools in AI research.

Then neural networks changed the game. Stockfish’s NNUE architecture replaced hand-tuned evaluation with a neural network trained on millions of positions, stronger than any hand-crafted evaluation in history. And AlphaZero showed you could skip the accumulated human knowledge entirely. No opening books, no endgame tablebases, no hand-crafted heuristics. Pure self-play reinforcement learning, tabula rasa, superhuman play in a few hours. The ideas didn’t stay in chess. DeepMind’s deep learning expertise led to AlphaFold, which predicted protein structures well enough to win the 2024 Nobel Prize in Chemistry, and MuZero, which learned to play games without even being told the rules.

The constraints of the problem pushed researchers to develop techniques that turned out to be general: combinatorial search, adversarial dynamics, the need for both tactical precision and strategic planning. Chess was the gym.

What’s different about Quantum Chess

Quantum Chess extends standard chess with three operations borrowed from quantum mechanics. A split places a piece into superposition across two squares; it exists at both with equal probability, and the two halves are entangled. A merge recombines two superposed copies of a piece back into one square. And when a classical action interacts with a quantum piece, capturing a piece that’s only 60% likely to be there, a measurement occurs. The piece either collapses into existence (capture succeeds) or into absence (it was never there, your piece doesn’t move). The probabilities follow from the quantum state of the board, not from an arbitrary random number generator.

Not all interactions force measurement. A piece sliding through a square occupied by a piece in superposition doesn’t collapse it. The move becomes conditional on that square being empty, and the sliding piece’s position becomes correlated with the blocking piece’s state. Entanglement, without either side collapsing. When pieces of the same type occupy squares involved in a split or merge, their quantum amplitudes interfere constructively or destructively, shifting probabilities in ways that have no classical explanation. The board accumulates these correlations, and you can’t describe the position with just a list of pieces and probabilities. The correlations are the game.

This changes what an AI has to do.

Measurement creates chance nodes. Classical chess is purely adversarial. Quantum Chess has probabilistic branch points where a move might succeed or fail depending on quantum state. The AI has to reason about both outcomes, weighted by probability, and those probabilities change based on prior moves.

Evaluation is a different problem. A queen at 50% probability is not worth half a queen. Its value depends on what it’s entangled with and whether the opponent can force a measurement at an inconvenient time. The phenomena that matter most, interference, entanglement, and conditional probability shifts, are exactly the things that make quantum mechanics hard to reason about classically.

Bar chart comparing average legal moves per position: Classical Chess at ~30 versus Quantum Chess at ~118, with splits accounting for more than half

The branching factor explodes. Across 188,198 positions from our self-play testing data, the average branching factor in Quantum Chess is about 118, roughly four times classical chess’s ~35. Splits account for more than half the legal moves (~67 per position), and even standard moves run higher than classical (~45 vs ~35) because superposed pieces create more available targets. At 118 moves per node, a depth-3 search explores ~1.6 million leaf nodes versus ~43,000 in classical chess. Efficient pruning is critical, and unsolved; without it we’re stuck around depth 4 if we want reasonable move times.

There is no accumulated knowledge to bootstrap from. Classical chess has centuries of opening theory, endgame tablebases covering every position with seven or fewer pieces, and billions of recorded games. Quantum Chess has none of that. We don’t know the openings. We don’t know the endgames. We don’t even know which quantum tactics are sound and which are traps. Any AI will have to discover most of it from scratch.

Exploring a new frontier with AI

When DeepMind built AlphaZero, there were decades of chess knowledge encoded in engines like Stockfish, knowledge that AlphaZero was able to rediscover and in some cases surpass through self-play. But the human knowledge came first. The AI refined it.

With Quantum Chess, the relationship inverts. The game is too new and too complex for humans to have developed deep theory. We have intuitions about when to split and when to merge, about measurement risk, about the value of maintaining entanglement. But nobody has mapped out the strategic landscape the way centuries of grandmasters have mapped out classical chess. There are no Quantum Chess endgame tablebases. There’s no equivalent of the Sicilian Defense.

AI can go first this time. A sufficiently strong Quantum Chess AI, trained through self-play or search or some hybrid approach, wouldn’t just be a strong player. It would be an oracle for Quantum Chess strategy, telling us which openings are sound, which quantum tactics create durable advantage, what the right balance is between quantum and classical play. Practical questions that would take human players years to figure out, if they could figure them out at all.

But the implications go beyond the game itself. Quantum Chess is a concrete, adversarial environment where AI has to develop strategies for navigating superposition, entanglement, and measurement. If techniques for evaluating quantum game states turn out to be useful for reasoning about quantum systems more broadly, nobody should be surprised. Alpha-beta pruning and Monte Carlo tree search found applications far beyond board games. There’s no reason the quantum versions can’t do the same.

What’s in the SDK

So here’s what I’m shipping. It’s one npm package: @quantum-native/quantum-chess-sdk. Install it and you get everything:

  • Game types, rules, and legal move generation
  • The QCPlayer interface for building AI players
  • QCExplorer for sandboxed lookahead and search
  • A match runner for playing games between any two players
  • Reference AI implementations, including a complete alpha-beta search engine with Quantum Chess handling

The core interface is QCPlayer. Implement chooseMove and you have a player:

interface QCPlayer {
  readonly name: string;
  chooseMove(
    view: QCEngineView,
    explorer: QCExplorer | null,
    clock: QCClock | null
  ): Promise<QCMoveChoice>;
}

The QCEngineView gives you the board state: pieces, probabilities, legal moves (standard, split, and merge), move history, and side to move. The QCExplorer lets you try moves and see what happens without committing. It handles quantum state, measurement branching, and evaluation. You can fork it for parallel search branches.

There’s a built-in AI, the PureSDKAdapter, that implements alpha-beta search with iterative deepening, quiescence search, piece-square tables, and expectimax branching at measurement nodes. If you want to see how a Quantum Chess AI handles measurement uncertainty, split evaluation, and merge decisions, start there.

The match runner handles everything else: turn order, clock management, game-over detection, event streaming. Point it at two QCPlayer implementations and it runs a game. There are also adapters for HTTP, WebSocket, and Web Worker players, so your AI can run anywhere.

What I hope people build

I don’t know. The classical chess AI community produced things nobody predicted: neural network evaluation functions, self-play training pipelines, analysis tools that changed how humans study the game. I’m open sourcing the SDK because I think the Quantum Chess variant creates a rich design space, and I’d rather see what a community does with it than try to explore it alone.

A few directions I’d love to see explored:

Self-play reinforcement learning. AlphaZero for Quantum Chess. During our collaboration with Google Quantum AI, we had conversations with members of the DeepMind AlphaZero team about whether the same approach could be applied to Quantum Chess. It wasn’t clear that it could, partly because of the explosion in legal moves per position.

An approach closer to Stockfish’s NNUE, where a neural network refines the evaluation function rather than replacing the search, is one I find more promising. The SDK provides the game engine and match runner; you provide the neural network and training loop. The QCExplorer.sample() method gives you Monte Carlo samples of the quantum state, which could serve as training signal for a value network. Whether self-play discovers quantum-specific strategies, or converges toward mostly classical play, would be interesting either way.

Quantum-native evaluation functions. The current evaluation weights piece values by probability, which is a reasonable first approximation that completely ignores entanglement. An evaluation function that takes the full quantum state into account, perhaps using the reduced density matrix or entanglement entropy as features, might find value that probability-weighted material misses.

Quantum advantage experiments. Use the tournament runner to systematically compare quantum-enabled versus classical-only AIs across a range of positions and skill levels. Publish the results. Contribute to the open question of whether the ruleset exhibits quantum advantage, or whether variations on the rules make quantum play more meaningful.

Come build with us

The code is on GitHub. The SDK documentation includes a complete guide to building your first Quantum Chess AI, from a random move picker to a full search engine with quantum handling.

I’ve been building quantum games and tools, all experiments in making quantum mechanics tangible: Quantum Chess, Harmoniq, Quantris, Ponq, Bloch Invaders, all powered by Quantum Forge. There’s a growing community around this stuff and we’d love more people in it. Join us on Discord.

Chess taught machines to think. Maybe Quantum Chess can teach them to think quantum.

Comments

Loading comments...