Reference
Guide
System Requirements
In order to run jaQuzzi
a JAVA virtual machine of version 1.3 or higher is required. The virtual
machine is provided e.g. by the JAVA 2 SDK, Standard Edition, v1.3 or by
the JAVA Plug-in 1.3 for web browsers, which both can be obtained from
the SUN Microsystems web site
http://java.sun.com/j2se/
Compiling & Source Code
Generally, the source code of
the simulator does not need to be recompiled unless changes are done to
the source code. The platform portability of the compiled program is a
feature of JAVA.
The source code of the simulator
and the hypertext documentation can be found together with the compiled
version and this thesis on the following web site
http://www.physics.buffalo.edu/~phygons/jaQuzzi/
Starting the Simulator
The simulator can operate in
two modes:
-
interactive mode the
interactive mode provides a graphical user interface for the design and
test of quantum circuits.
To start the simulator in
this mode issue the following command:
java -jar jaQuzzi.jar
or access the embedded version
on
http://www.physics.buffalo.edu/~phygons/jaQuzzi/jaQuzzi/applet.html
-
batch mode the batch
mode allows to run a simulation of a circuit from the command line without
graphical output. This mode can be used to automize quantum calculations.
Interactive Mode
Circuit Management
The toolbar provides basic
circuit management functionality such as 'create', 'load', 'save' or 'save
as'. Circuits are saved in a clear text data format, which can be parsed
by the math engine of the simulator. Data files usually have the extension
'*.jaq'. Circuits can be exported to the LaTeX figure environment by choosing
the file type '*.tex' in the 'save as' dialog. Circuits cannot be re-imported
from this data format.
Circuit management capabilities
are reduced when the program is executed within a web site.
Building a Circuit
A circuit can be thought
of being arranged in rows and columns of a table. Each row represents a
qubit, each column a gate operation. To setup a gate operation to a certain
qubit simply create a new gate column, select the corresponding qubit cell
in this column an make a right mouse click. The program uses different
ways to translate the user selection into an adequate gate (see specify
gate).
For the purpose of building
more complex circuits and controlling simulation properties locally, gates
can be grouped into gate groups. Gates within gate groups cannot be changed
unless ungrouped.
-
add/remove qubit a right
mouse click on the qubit area on the left hand side reveals a popup menu
which allows to add/insert or remove a qubit. The qubit over which the
click occured is affected.
-
add/remove gate a right
mouse click on the gate headers reveals a popup menu with functionality
for gate management, such as add/insert or remove. Selected gates are affected.
-
specify gate a right
click on the gate area reveals a popup menu where different kinds of gates
can be chosen. There are basically three different ways of how the program
translates a qubit selection into a gate:
-
controllable gates. The first
section in the popup menu allows to generate controlled gates. Depending
on the number of qubits selected and the dimension of the chosen gate operation,
remaining qubits are assigned as control qubits.
example 1 two selected
qubits and the NOT gate make the other selected qubit a control qubit
example 2 two selected
qubits and a 2-qubit gate just generate the 2-qubit gate
The order of the selection
determines which of the qubits are controlling and which are controlled.
The qubits selected last are the controlled qubits.
example 3 a left
click on the first qubit and dragging the mouse down to the last qubit
and then choosing the NOT gate creates a multiple controlled NOT gate operating
on the last qubit
example 4 a left
click on the first qubit, a CTRL-left click on the last qubit and a CTRL-left
click to a middle qubit in combination with the NOT gate generates a NOT
gate operating on the middle qubit controlled by the first and last qubit
-
variable size gates. The middle
section in the popup menu contains gates which are variable in size. This
does not mean that the gates themselves are variable in size, rather instead
of filling controll qubits in, the gates are applied to all the selected
qubits.
example 5 selecting
all qubits and choosing the Hadamard gate will apply the single-qubit Hadamard
operation to all qubits
example 6 selecting
all qubits and choosing QFT will generate a Fourier transform of the given
number of qubits
Since only one gate per
column can be applied, sometimes additional columns need to be added (this
is done automatically).
-
fixed size gates. The last section
in the popup menu holds gates which only apply to a fixed number of qubits,
such as the exchange gate or predefined templates (right now only a compare
circuit is implemented).
-
grouping gates In order
to group gates select the gate columns by pressing CTRL or SHIFT and left
clicking on the gate headers. Click right on the selected headers and choose
group. Single gates in a gate group cannot be modiefied unless ungrouped.
Gate properties overwrite group properties which again overwrite circuit
properties. To ungroup simply click right and select ungroup. During ungrouping
it might be necessary to rename gates to avoid name conflicts. This is
handled automatically by the program.
-
controlling properties
single gates/gate groups can have additional properties such as name, repetition
or settings for the simulation. The properties are accessed with a right
mouse click on the gate header under 'properties'. Global simulation properties
are accessed by the button on the left hand side of the info panel in the
toolbar.
Running a Circuit
-
Initialization with a
single click on a qubit arrows on the left hand side, a qubit can be initialized
to spin up or spin down. Superpositions are generated with gate operations.
-
Reset the simulation
can be reset by either initializing a qubit or clicking on the left arrow
in the simulation control panel.
-
Stepping the simulation
can be performed step by step or in whole. To step through the circuit
use the left/right symbols in the simulation control panel.
-
Running to automatically
step through the whole circuit use the button with the zeros and ones in
the simulation control panel. The simulation can be stopped by pressing
the same button again.
-
Measurement the simulation
control panel provides a button for performing a complete measurement.
Partial measurements are implemented via measurement gates within a circuit.
Visualization
The simulator offers several
ways of visualizing the progress or result of a computation. Most of the
information displayed though would not be accessible in a real physical
system. But it is the purpose of the simulator to increase transparency
of quantum computations.
-
info panel the info panel
is located in the toolbar and provides general information for the progress
of the computation. Clicks on the info panel reveal different information
(such as, average time per gate operation, estimated remaining time, etc.).
-
chart center the chart
center allows to display probability distribution, phases and the fidelity
of a computation for any choice of qubits. To specify the qubits to display
just select the qubits in the gate area and press the chart button in the
toolbar. The char center allows automatic refresh (which can be computationally
expensive and therefore is not activated upon start-up) to follow computations.
It is possible to save the probability distribution and fidelity into a
file which can be processed with the GNUplot program. For that simply load
the generated files (the naming convention is 'circuitname+number+.fid/prob')
with the command ``load'' into GNUplot.
-
data center the data
center allows to display numerical values of the probability distribution,
phases and fidelity. Since the data center usually is accessed through
the chart center, it uses the same qubit selection. When the data center
is called with the enlarge button right next to the state vector information
row in the main window, all qubits are seclected.
Batch Mode
This mode allows it to simulate
a circuit without graphical output. The only output generated is the probability
distribution and the fidelity, which are automatically dumped into two
files (the naming convention is `circuitname+number+.fid/prob').
The syntax is as follows:
java -jar jaQuzzi.jar [options] circuit.jaq
The following options are
implemented:
-
-mode simMode
This option allows it to explicitly set the simulation mode. Possible values
for simMode are: 0 = ideal simulation, 1 = operational errors only,
2 = decoherence errors only, 3 = operational and decoherence errors. If
this option is not specified, the simulation mode is determined from the
simulation properties saved in the circuit file, or if `-sigma', `-rate'
or `-decay' is specified, a mode is chosen to accomodate the parameters
(e.g., if only `-sigma' is specified, mode 1 is chosen).
-
-init bitString
This option allows to initialize the qubit ket to a specified basis ket.
The
bitString needs to have the same length as numbers of qubits
in the circuit. E.g., `-init 010' initializes a 3-qubit circuit to the
ket |010>.
-
-plot bitString
This option allows to specify the qubits that are plotted in the probability
distribution. This is useful for circuit where the Fourier qubits are of
interest and not necessarily the other work qubits. The bitString
needs to have the same length as numbers of qubits in the circuit. E.g.,
`-plot 011' outputs the probability distribution of the two lowest order
qubits.
-
-sigma start:end:steps:reps
This option allows it to vary the standard deviation sigma which controls
the noise error. Not all values need to be specified. E.g., `-sigma 0.01:::5'
causes 5 repetitive runs with sigma=0.01, `-sigma 0.01:0.02' will cause
2 runs, one with sigma=0.1 and one with sigma=0.02. If this option is given
without `-mode', `-rate' or `-decay', the simulation mode is automatically
set to 1.
-
-rate start:end:steps:reps
This option allows it to vary the error rate per gate which controls the
decoherence error. Not all values need to be specified. E.g., `-rate 0.001:0.002:3'
causes 3 runs, one with rate=0.01, one with rate=0.0015 and the last with
rate=0.002. If the option `-decay' is not specified, first the properties
of the circuit are checked. If there is no decay probability specified,
either, a decay probability of p=0.5 is assumed. If the `-rate' option
is given without `-mode' or `-sigma', the simulation mode is automatically
set to 2.
-
-decay start:end:steps:reps
This option allows it to vary the decay probability in case of a decoherence
event. Not all values need to be specified. E.g., `-decay 0.6' just sets
the decay probability to p=0.6. If the option `-decay' is specified without
the option `-rate', the circuit properties are checked. If there is no
decoherence rate given, either, the decoherence rate is set to 10^{-4}.
If the `-decay' option is given without `-mode' or `-sigma', the simulation
mode is automatically set to 2.
Decoherence errors and operational
errors can be combined by simply specifying the `-sigma' as well as the
`-rate' option.