jsqubits runner

An online quantum computer simulator

This is a JavaScript runner preloaded with the jsqubits library. Enter arbitrary JavaScript in the text area below and press the "Run" button. For more information, see the jsqubits user manual.

Load example:

jsqubits methods

jsqubits(bitstring)
Create a QState object
new QState(numbits, amplitudes)
Create a QState object
add(otherState)
Add another state
subtract(otherState)
Subtract another state
multiply(value)
Multiply by a global phase
normalize()
Normalize the amplitudes
x(targetBits)
Pauli X
y(targetBits)
Pauli Y
z(targetBits)
Pauli Z
r(targetBits, angle)
Phase shift gate
s(targetBits)
Phase gate: r(π/2)
t(targetBits)
T gate: r(π/4)
hadamard(targetBits)
Hadamard
not(targetBits)
Not
swap(bit1, bit2)
Swap two bits
rotateX(targetBits, angle)
Rotate about X
rotateY(targetBits, angle)
Rotate about Y
rotateZ(targetBits, angle)
Rotate about Z
controlledHadamard(controlBits, targetBits))
Controlled Hadamard
cnot(controlBits, targetBits)
Controlled Not
controlledX(controlBits, targetBits)
Controlled Pauli X
controlledXRotation(ctrlBits, trgtBits, angle)
Controlled rotation about X
toffoli(controlBit, controlBit, ..., targetBit)
Toffoli
applyFunction(inputBits, targetBits, function)
Apply a function
tensorProduct(otherQState)
Tensor product
qft(targetBits)
Quantum Fourier Transform
amplitude(basisState)
Get an amplitude
measure(targetBits)
Make a measurement
jsqubits.complex(real, imaginary)
Create a complex number
jsqubits.Complex.add,subtract,multiply,negate
Some Complex methods

Note:

For more details, see the jsqubits user manual.

Copyright 2012 David Kemp. Licensed under the MIT license.