next up previous contents
Next: A tutor on the Up: Using the parallel routines Previous: Installing the MPI patchfile   Contents

Using the MPI routines in the QCL

The qcl must be run with the mpirun command, passing it the number of processes to use with the -np command-line switch.

\begin{lstlisting}[frame=trbl]{}
mpirun -np <nodes> -machinefile <nodes file> ./qcl
\end{lstlisting}


Five parallel routines are provided with the MPI extension to the Quantum Computing Language. The functions are called ParMatrix1-5 and all of the functions take a quantum register and a matrix as parameters. The following is an example of how to apply a parallel matrix decomposition to a trivially small qubit;


\begin{lstlisting}[frame=trbl]{}
qureg a[2];
Mix(a);
Rot(0.6435, a);
complex matrix m[4];
m[0,0]=1
m[1,1]=1
m[2,2]=1
m[3,3]=-1
ParMatrix3(m,a);
\end{lstlisting}



Colm O hEigeartaigh 2003-05-30