Skip to content

Why quantum? ​

Quantum Forge is not a random number generator. It's a quantum simulator that gives your game objects real quantum behavior: superposition, measurement collapse, entanglement, and interference.

Emergent gameplay from physics ​

Classical physics engines work because you don't script every collision. You set up the rules, and interesting behavior falls out. Quantum Forge works the same way. When quantum mechanics is the physics engine, gameplay emerges from the rules themselves. Entangled objects stay correlated because that's what entanglement does. Interference shifts probabilities because that's what phase does. Players discover strategies you didn't program, because the mechanics are real and composable. Quantum mechanics is a richer set of rules, and the emergent behavior it produces isn't available classically.

Intuition through interaction ​

We understand classical physics intuitively because we've interacted with it our whole lives. Nobody teaches a child how a ball bounces; they throw one and find out. Quantum mechanics feels confusing because we never get to play with it. Quantum games change that. When entangled objects in your game behave like entangled objects, you build intuition through experience. Building and playing quantum games can develop a generation of thinkers for whom quantum behavior is natural, not abstract.

Why now ​

Quantum computing hardware is improving every year, expanding into areas nobody predicted. Games and interactive experiences will be part of that future, but we don't have to wait. Simulation lets us build with quantum mechanics today, developing the design language and patterns now so we're ready when hardware catches up.

Quantum Forge's API is backend-agnostic. The same code works whether the backend is simulation or real quantum hardware. We've already connected our games to actual quantum computers. Start building today, and the same games run on quantum backends as they become practical.

Not Math.random() ​

Math.random() gives you independent numbers with no memory and no connections. Quantum properties are different:

  • Superposition is stateful. A property holds a probability distribution that evolves as you apply gates. You can read probabilities without collapsing.
  • Measurement is irreversible. Collapse forces a definite value. One-way, dramatic.
  • Entanglement creates correlations. Measuring one property instantly determines another, anywhere in the game world.

Quick primer ​

Superposition. A quantum property can hold several values at once. superpose() spreads a property evenly across its values: 50/50 on a property with two values. You can read the probability without collapsing it, so you can render a ghost at half opacity.

Measurement. Measuring collapses the superposition to one definite value, sampled from the probabilities the quantum state defines. The property keeps that value until another gate changes it.

Entanglement. Entanglement is what an interaction leaves behind. Start one ball that exists and one that doesn't, run a.iSwap(b, 0.5), and you get "A exists, B doesn't" superposed with "B exists, A doesn't." Measuring one settles the other.

Values. You declare a property by the values it can take: quantum([false, true]) for exists/doesn't, quantum(["rock", "paper", "scissors"]) for a three-way choice. The number of values is the property's dimension. Two values (a qubit) covers most cases. Start there.

Quick taste ​

typescript
import { ensureLoaded, quantum, type Quantum } from "quantum-forge/quantum";

await ensureLoaded();

interface Enemy {
  id: string;
  alive: Quantum<boolean>;
}

function spawnQuantumEnemy(id: string): Enemy {
  const alive = quantum([false, true]); // starts false
  alive.superpose();                    // 50/50: maybe there, maybe not
  return { id, alive };
}

function drawAlpha(enemy: Enemy): number {
  return enemy.alive.probability(true); // 0.5, and nothing collapses
}

function observe(enemy: Enemy): boolean {
  const here = enemy.alive.measure(); // collapses: true or false
  enemy.alive.dispose();              // done with it
  return here;
}

Coming from 2.x and QuantumPropertyManager? See Migrating to 3.0.

What's next ​

Powered by Quantum Forge