An interactive bloch sphere implemented with Three.js.
- Setting qubit state to basis states:
- Applying gates, this includes:
- Half turn gates:
-
$X$ Gate -
$Y$ Gate -
$Z$ Gate -
$H$ Gate
-
- Quater turn gates:
-
$S$ Gate ($\sqrt{Z}$ ) -
$S^{-1}$ Gate ($Z^{-\frac 1 2}$ ) -
$Y^{\frac 1 2}$ Gate -
$Y^{-\frac 1 2}$ Gate -
$X^{\frac 1 2}$ Gate -
$X^{-\frac 1 2}$ Gate
-
- Eighth turn gates:
-
$T$ Gate -
$T^{-1}$ Gate -
$Y^{\frac 1 4}$ Gate -
$Y^{-\frac 1 4}$ Gate -
$X^{\frac 1 4}$ Gate -
$X^{-\frac 1 4}$ Gate
-
- Half turn gates:
These gates can be applied in any order for example
- Have npm installed
- run
npm install
- run
vite serve
This project is available as an npm package under the name interactive-blochsphere.
import {InteractiveBlochSphere} from "interactive-blochsphere";
new InteractiveBlochSphere(document.getElementById("blochsphere"));