Universität Karlsruhe
Fakultät für Informatik
IAKS Homepage
IST/FET
Project Q-ACTA (IST-1999-10596)

QuaSi User Documentation Links
IAKS-Homepage


Simulator QuaSi :
About QuaSi
User Documentation
Screenshots
Applet-Version
EISS-Report


Simulator QuaSi2 :
Improvements
Screenshots
User documentation
XML file format
Applet-Version
Full-Version

User documentation

Starting QuaSi2

Starting QuaSi2 as an applet

Just click the start button on the applet page:

http://iaks-www.ira.uka.de/QIV/QuaSi/applet.html

Starting QuaSi2 as an application

The full version of the simulator QuaSi2 (a Java program which needs Java) can be downloaded under the following world wide web address:

http://iaks-www.ira.uka.de/QIV/QuaSi/fullversion.html

After QuaSi2 is downloaded as a jar file it will have to be started using:
java -cp Quasi2.jar Quark2.Quark

After QuaSi2 is downloaded as a zip file, unzip the file, enter the directory Quasi2 and start QuaSi2 using:
java Quark2.Quark

Main windows



The graphical user interface consists of four main windows. The upper left Circuit window displays the quantum circuit to simulate. The qubits are numbered from 1 to n beginning at the top of the circuit. The first qubit is the most significant qubit and the n-th qubit is the least significant qubit. The gates are applied to the initial state (|00..0>) from left to right. The blue vertical line shows the current position of the simulation.

The upper right window displays the current system state expressed in the standard basis (|00..0>,|00..1>...|11..1>). Only states with non zero amplitudes are shown.

The lower windows display these amplitudes graphically from left to right. The first amplitude belongs to the state |00..0> and the last to |11..1>.

The left window shows the absolute value (length) and the relative phase (direction) of the amplitudes of the basis states. The phase is indicated by the color and the absolute value by the length of each line.

In the right window the amplitudes are shown splitted into real (blue) and imaginary (red) parts.

Creating circuits in QuaSi2

There are two possibilities to build a quantum circuit: Either by choosing the desired number of qubits and then adding the gates wanted or by using the demo circuits included in the simulator QuaSi2.

Loading XML files

Another possibility is to load circuits from XML files. The advantage is that some features can not be created in the graphical user interface, but only in XML files (containers and prepared states). For the exact specification of the XML file format please refer to the XML file format.

Building circuits

A new circuit

Building a circuit first choose the number of qubits wanted in this circuit. Note that it is not possible to add or to remove qubits after gates are introduced in the circuit.

To choose the number of qubits select the menu item New in the Circuit menu. A dialog box will appear to give the possibility for selecting the desired number of qubits from the list.

Adding gates

To add gates select the menu Gates which allows to choose the type of the gate to append.

In each dialog box there are three buttons: Add this Gate will add the selected quantum gate to the circuit; Remove last Gate will delete the most recently added gate; Ready will close the dialog box.

Adding standard gates

This dialog box covers the most commonly used quantum gates. After choosing the gate wanted from the list, select the target qubit and one or two control qubits if necessary (only CNot or CCNot). The selected gate will then be applied to the target qubit conditioned on the values of the control qubits.

Adding user defined gates

It is possible to enter any arbitrarily controlled one-qubit gate. In the upper part of the dialog box the matrix entries can be entered wherein complex numbers (e.g., 1+i) and numbers in the GAP format and the common matrix normalization factor (only floats allowed) can be used. The GAP format is used in the computer algebra system GAP (Groups, Algorithms and Programming) and any complex number is described as a linear combination (with fractions) of powers of primitive n-th roots of unity. The primitive n-th roots of unity have to be written like E(n). A number in the GAP format is for example:
1/2*E(8)-1/2*E(8)^3-1/4*E(37740)^7227-1/5*E(1887)^56
The GAP format was included in QuaSi2 for better exchange with the computer algebra system GAP. It is further expected that the matrix is unitary.

Then enter two lists of control qubits (separated by spaces). If not needed these areas can be left empty.

Finally choose a display style and if box is chosen the name will be written in the box.

Adding matrix gates

Very similar to the input of user defined gates is the definition of matrix gates. The only difference is that the number of qubits the matrix should span (excluding control qubits) can be chosen in a first dialog box and depending on this coice a matrix of the appropriate size is shown. Enter the target qubits as a list separated by spaces. Note that the order is important. It is also expected that the matrix is unitary and it is possible to enter complex numbers or GAP formated numbers as matrix entries.

Adding function gates

A function gate realizes the operation |x,y> -> |x,y (+) f(x)>.

Enter the qubits of the x- and y-registers in the first two text fields beginning with the most significant qubit (separated by spaces).

Enter the list of values of f(x) for any x in the third text field values. Note that 2^k numbers, where k is the size of the x-register, have to be entered.

Adding permutation gates

A permutation gate changes the order of the qubits (or quantum wires) according to the given permutation.

Enter the permutation as a list of numbers (separated by spaces). The i-th number indicates the new position of the i-th qubit.

Therefore the list must contain every number of from 1 to n in any order. (E.g., Considering a circuit with 5 qubits the permutation could be: 5 4 3 1 2)

Building demo circuits

For ease of use we included three demo circuits in the simulator. The default entries are a rather good choice if the user is not much familiar with the algorithms.

Shor's algorithm

Choose the number to factorize, a random number, and the number of qubits in the x-register.

Grover's algorithm

Enter the size of the x-register and the marking function with values from the set {0,1} for any basis-state in the x-register.

The Deutsch-Josza algorithm

Similar to Grover's algorithm choose the size of the x-register and enter the function with values from the set {0,1}. For proper execution it is necessary that the entered function is either constant or balanced.

Interacting with the circuit

If the circuit consists of one or more containers it is possible to collapse or uncollapse these just by clicking on them in the upper part of the Circuit View possibly hiding unnecessary parts of the circuit. Please note that after the simulation is started any collapsing / uncollapsing of containers will reset the simulation.

It is also possible to get more detailed informations about gates. Just select a gate by clicking on it with the left mouse button and select View information about selected gate form the Gates menu.

Simulating circuits

After building the circuit it can be simulated by using the buttons at the bottom of the Circuit window.
  • Prepared State: sets the state to an eventually defined state in the XML file.
  • Ground State: resets the state to |00..0>.
  • To the Start: goes back to the start (without changing the system state).
  • Forward: goes one step forward.
  • 5 Forward: goes five steps forward.
  • First to real: The first basis state (with amplitude = 0) will afterwards have a positive real amplitude (by multiplying the state with complex number).
  • To the End: simulates the circuit up to the end.
Quantum Computer Simulators
Maintained by Julia Wallace

Matthias Eck (udqo@rz.uni-karlsruhe.de), Pawel Wocjan (wocjan@ira.uka.de), Robert Michael Zeier (zeier@ira.uka.de)