New System
|
n(size); |
Creates a qubit system with size number of qubits. This system is
initialized so that the |0> state has amplitude 1.
|
|
Execute Hadamard |
h(targetbit);
|
This command takes the 2x2 Hadamard matrix: [[1,1][1,-1]] and
applies it to the target bit.
|
The first bit has index 0.
|
|
Execute ControlledPhase |
c(targetbit, phaseangle_modPI, controlbit1, controlbit2, ...);
|
This command takes the 2x2 matrix: [[1,0][0,e^(i*pi*theta)]] and
applies it to the target bit, only if all the control bits are 1.
|
The first bit has index 0. The control bits are optional
parameters.
|
|
Reverse Bitorder on bases |
b(FirstBit, LastBit); or b;
|
This command will send the amplitude of each computational basis to
the basis which is the result of reversing the positions of the digits in the
interval defined by FirstBit, LastBit in the binary expansion of the original
basis. For Example: b(1,2); will exchange the amplitudes of |13> (|1101>)
and |11> (|1011>).
|
If FirstBit and LastBit are not supplied, the reverse will be
performed on the entire system.
|
|
Perform DFT |
d(FirstBit, LastBit); or d;
|
This command will perform the appropriate combination of Hadamard
and Controlled Phase operations on the range of qubits. This sequence mimics
the sequence given in Ekert and Jozsa. |
If FirstBit and LastBit are not supplied, the reverse will be
performed on the entire system.
|
|
Modular Exponentiation |
x(y, n);
|
This command does not use quantum operators to achieve modular
exponentiation. This explicity maps amplitudes from one basis and assigns them
to another. | a*2^(size/2) > -> | a*2^(size/2) + y^a mod n >
|
|
Perform Measurement |
m(FirstBit, LastBit); or m;
|
This command measures the specified range of bits, causing that set
of bits to collapse to a single state with a probability of the square
magnitude of the amplitude of that state. Afterward, the entire system is then
renormalized.
|
If FirstBit and LastBit are not supplied, the reverse will be
performed on the entire system.
|
|
Run Script |
r(filename); |
This command will open the given file and consider its contents as
if it had been typed into the prompt. In this way one can create scripts for
performing certain tasks. A sample script Shor15.txt has been provided that
goes through the procedure of factoring 15 via Shor's algorithm.
|
|
Toggle Suppression of Menu |
s; |
This command will cause the program to cease output of the command menu and
notes section. These are automatically suppressed when executing multiple
commands separated by semicolons.
|
|
|