Using Qcl sessions inside TeXmacs |
http://tph.tuwien.ac.at/~oemer/qcl.html
As suggest, users have better install the newest and binary version,
now is 0.5, since it is difficult to compile from source. Moreover, if
you install
qcl> |
qureg a[1];
|
qcl> |
Rot(pi/4,a);
|
qcl> |
Mix(a);
|
qcl> |
dump;
|
STATE: 1 / 32 qubits allocated, 31 / 32 qubits free
qcl> |
include "shor.qcl";
|
qcl> |
operator dft(qureg q) { const n=#q; int i; int j;for i=1
to n { for j=1 to i-1 { if q[n-1] and q[n-j]
{Phase(pi/2^(i-j));}} H(q[n-1]);} flip(q); }
|
at "operator dft(qureg q) { c ...":
illegal scope: Global symbol dft already defined
qcl> |
dft(a);
|
qcl> |
|