Due Jan 31, 2006rd
The purpose of this lab is to become familiar with QCL, an interpreted language that supports mixed quantum/classical computation.
First, some useful information:
I suggest that you edit files outside of QCL, rather than using the command line interface that QCL provides.
Finally, although you should not need to for this assignment (you may for the next), you can increase the number of simulated qubits that QCL supports by using the -b command line option.
For instance, to simulate 64 qubits:
Note that you cannot simulate a large number of qubits.
Simulating a quantum system is an O(2^n) problem!
qureg x; // declares 2 qubits x and xint i; // declares a classical integer
real r; // declares a classical floating point number
measure x, i; // measures qubit states and places the result in i
dump x; // dump qubit probabilities
reset; // resets all qubits in the system back to zero.
Mix(source1); // H gate
CNot(target, source1 & source2); // Toffoli gate.
The procedure should teleport a qubit (source) into
the destination qubit. It will use the scratch qubit as part of the
teleportation process. After writing this procedure, test it by running
it on a few arbitrary source qubit states (you can make some interesting
qubit states for testing, by using the Rot(pi/y, source) function. Choose
y to be some real number). Use the "dump" QCL command to demonstrate that
the source qubit state is successfully teleported into the destination
qubit. Print these tests out and hand in the source to teleport and
the screen dumps to show that it works.
Problem 2) Super-dense coding
Write a QCL procedure EPR(qubit q1, qubit q2) that creates an EPR state on qubits q1 and q2.