Wednesday, September 07, 2011

Messing around with Quantum Computing

If you want to start messing around with Quantum Computing simulators (ahead of actual Quantum Computers being developed), there are a couple of options:

Bernhard Omer's QCL language, developed specifically for QC simulation.

QCF toolbox of Quantum Computing Functions for Matlab and Octave (a free clone of Matlab).

Matt Purkeypile's Cove framework, that could potentially be extended to any language, but currently really only works with C#. He has a number of YouTube videos about it.

Here is a short (and useless) QCL example, where we put a 2-Qbit register into a superposition of states, then measure the Qbits. The first time we try this, we get a 3, the second time we try it, we get a 2:
qcl> qureg s[2]; // set up 2-Qbit register s, initially all zero
qcl> H(s); // apply Hadamard operator to create equal superposition of states
[2/32] 0.5 |0> + 0.5 |1> + 0.5 |2> + 0.5 |3>
qcl> measure s; // now actually measure and collapse wavefunction
[2/32] 1 |3> // result is 3 (0b11)
qcl> reset; // reset Qbits to zero
[2/32] 1 |0>
qcl> H(s); // apply Hadamard operator again
[2/32] 0.5 |0> + 0.5 |1> + 0.5 |2> + 0.5 |3>
qcl> measure s; // measure again
[2/32] 1 |2> // result is 2 (0b10)



No comments: