Difference between revisions of "JQ Manual"
(→prob([signature1, signature2, ..., signaturen])) |
(spelling/grammar corrections) |
||
Line 10: | Line 10: | ||
=== 1st input - init state === | === 1st input - init state === | ||
[[File:1st.png]] | [[File:1st.png]] | ||
− | You enter init state of qubits here. | + | You enter init state of qubits here. A decimal integer is required here. Its binary representation defines the start states of qubits in qregister. '''Qubit 0 is at the top'''. |
=== 2nd input - qubit signature === | === 2nd input - qubit signature === | ||
[[File:2nd.png]] | [[File:2nd.png]] | ||
− | You enter list of integers here in the following format: [qubit1, qubit2, ..., qubitn]. This qubit signature is used for displaying probabilities. | + | You enter a list of integers here in the following format: [qubit1, qubit2, ..., qubitn]. This qubit signature is used for displaying probabilities. |
− | Assume you entered here [3,4] and assume that list of | + | Assume you entered here [3,4] and assume that list of probabilities is like the following: |
<pre> | <pre> | ||
Line 25: | Line 25: | ||
It simply means that a lot of hypothetical measurements would show that '''Prob(qubit 4 is in state 0 AND qubit 3 is in state 1) = 0.3''' and '''Prob(qubit 4 is in state 1 AND qubit 3 is in state 0) = 0.7'''. | It simply means that a lot of hypothetical measurements would show that '''Prob(qubit 4 is in state 0 AND qubit 3 is in state 1) = 0.3''' and '''Prob(qubit 4 is in state 1 AND qubit 3 is in state 0) = 0.7'''. | ||
− | Formally, the result is a list of integers with given probability. The n-th bit of chosen integer (from right) represents the state of | + | Formally, the result is a list of integers with a given probability. The n-th bit of the chosen integer (from the right) represents the state of the qubit which is listed as n-th in the qubit signature (from the left) after the hypothetical measurement. Note these integers are given in binary and in decimal in (). |
− | The same result for signature [4,3] would | + | The same result for the signature [4,3] would obviously be |
<pre> | <pre> | ||
01 : 0.7 (1) | 01 : 0.7 (1) | ||
Line 36: | Line 36: | ||
[[File:3rd.png]] | [[File:3rd.png]] | ||
− | You enter a list of quantum gates here in the following format [gate1, gate2, ..., gaten]. You can also add | + | You enter a list of quantum gates here in the following format [gate1, gate2, ..., gaten]. You can also add measurements to this list, they are represented by M(.). |
===Run Button=== | ===Run Button=== | ||
− | + | OK, after you've entered the initial state (if you don't, the default state is 0) and quantum circuit, you press the Run button, which applies the quantum circuit to the qregister and displays the end state and probabilities after a hypothetical measurement of the qubits listed in qubit signature (2nd input). For example: | |
<pre> | <pre> | ||
Line 49: | Line 49: | ||
</pre> | </pre> | ||
− | The first list are probabilities described in [[#2nd input - qubit signature|2nd input - qubit signature]] section. The second list is just a state of | + | The first list are probabilities described in [[#2nd input - qubit signature|2nd input - qubit signature]] section. The second list is just a state of the qregister (a complex vector). |
===Load Button=== | ===Load Button=== | ||
− | When you create some more complex and long circuit you want to have it in saved text file. You can. Write your circuit in text file using your favorite editor, save it on your drive and then just press '''Load''' to load | + | When you create some more complex and long circuit, you want to have it in a saved text file. You can. Write your circuit in a text file using your favorite editor, save it on your drive and then just press '''Load''' to load it into the Quantum Simulator. |
Doesn't work under IE, so please use some other browser for this feature. | Doesn't work under IE, so please use some other browser for this feature. |
Revision as of 16:14, 22 May 2013
Quick Overview
For quick start, please note 3 inputs. We we will name them: 1st, 2nd and 3rd — from left to right. Please also note 2 buttons: Run and Load.
1st input - init state
You enter init state of qubits here. A decimal integer is required here. Its binary representation defines the start states of qubits in qregister. Qubit 0 is at the top.
2nd input - qubit signature
You enter a list of integers here in the following format: [qubit1, qubit2, ..., qubitn]. This qubit signature is used for displaying probabilities.
Assume you entered here [3,4] and assume that list of probabilities is like the following:
01 : 0.3 (1) 10 : 0.7 (2)
It simply means that a lot of hypothetical measurements would show that Prob(qubit 4 is in state 0 AND qubit 3 is in state 1) = 0.3 and Prob(qubit 4 is in state 1 AND qubit 3 is in state 0) = 0.7.
Formally, the result is a list of integers with a given probability. The n-th bit of the chosen integer (from the right) represents the state of the qubit which is listed as n-th in the qubit signature (from the left) after the hypothetical measurement. Note these integers are given in binary and in decimal in ().
The same result for the signature [4,3] would obviously be
01 : 0.7 (1) 10 : 0.3 (2)
3rd input - quantum circuit
You enter a list of quantum gates here in the following format [gate1, gate2, ..., gaten]. You can also add measurements to this list, they are represented by M(.).
Run Button
OK, after you've entered the initial state (if you don't, the default state is 0) and quantum circuit, you press the Run button, which applies the quantum circuit to the qregister and displays the end state and probabilities after a hypothetical measurement of the qubits listed in qubit signature (2nd input). For example:
01 : 0.5 (1) 10 : 0.5 (2) (0.707106781187,0)|1> (0.707106781187,0)|2>
The first list are probabilities described in 2nd input - qubit signature section. The second list is just a state of the qregister (a complex vector).
Load Button
When you create some more complex and long circuit, you want to have it in a saved text file. You can. Write your circuit in a text file using your favorite editor, save it on your drive and then just press Load to load it into the Quantum Simulator.
Doesn't work under IE, so please use some other browser for this feature.
Specification
Supported gates
H(bit) [Hadamard Gate]
Defined on base vectors :
X(bit) [Pauli X-gate]
Defined on base vectors :
Y(bit) [Pauli Y-gate]
Defined on base vectors :
Z(bit) [Pauli Z-gate]
Defined on base vectors :
R(n, bit) [Phase Shift Gate]
Defined on base vectors :
CNot(control, bit) [Controled Not Gate]
Defined on base vectors :
CCNot(control1, control2, bit) [Toffoli Gate]
Defined on base vectors :
C(control, gate) [Universal Control Gate]
Defined on base vectors :
U([argbit0, ...,argbitn],[valbit0, ...,valbitm], function) [Universal Function Gate]
Defined on base vectors :
Hidden Console
jQ has additional advanced feature — Hidden Console. When you place cursor in the last file of the black window in the left you can enter some special directives. Bellow you will find a full list of Hidden Console directives:
clr()
Clears window.
load()
The same as button Load.
measure(bit)
Performs measurement on chosen bit. To see result you need to type prob([[bit]]). Changes qregister state.
prob([signature1, signature2, ..., signaturen])
Displays states of chosen qubits with probabilities after series of hypothetical measurements. Doesn't change the qregister state. The value of state is binary grouped. Each group is defined by corresponding signature. Consider following example. Assume that the qregister state is:
(0.5,0)|0> (0.5,0)|1> (0.5,0)|4> (0.5,0)|5>
Corresponding probabilities are:
000 : 0.25 (0) 001 : 0.25 (1) 100 : 0.25 (4) 101 : 0.25 (5)
After typing in Hidden Console prob( [ [0], [1,2] ] )
You will see the same result in different representation:
|0>|0>:0.25 |0>|1>:0.25 |2>|0>:0.25 |2>|1>:0.25
For prob( [ [0,1], [2] ]):
|0>|0>:0.25 |0>|1>:0.25 |1>|0>:0.25 |1>|1>:0.25
reset(n)
Set initial state of qregister to n.
run()
The same as button Run.
state()
Displays current state (complex vector) of qregister.