3 ms·
algorias: I finally managed to simulate the algorithm on a handy quantum simulator jaQuzzi 0.1(http://www.eng.buffalo.edu/~phygons/jaQuzzi/ http://www.eng.buffa
by sim_man 11y ago
algorias: I finally managed to simulate the algorithm on a handy quantum simulator jaQuzzi 0.1(http://www.eng.buffalo.edu/~phygons/jaQuzzi/ http://www.eng.buffalo.edu/~phygons/jaQuzzi/).
As I can see, the algorithm really works. Below is the code for the example shown in Fig 5, (x0 v x1 v x2)&(~x0 v ~x1 v ~x2). You can try it by yourself and here are the steps:
1- copy the below code to a text editor and save it with extension .jaq.
2- open the file with jaQuzzi.
3- set |c0>=|1>,|c1>=|1>,|d0>=|1>
4- run the circuit.
5- select |c0> and |c1> and press on "plot probability chart" to open the "chart center" and see the correct answer for c's.
6- select |x0>, |x1> and |x2> and press on "plot probability chart" to open the "chart center" and see the probability for the superposition of the correct answer of x's.
Hints:
-You can trace the circuit by selecting |c0> and |c1> and press on "plot probability chart" to open the "chart center", reset the circuit and start pressing on "step forward" to watch the probability of the solution increases during the loop.
-Don't forget to select auto in the "chart center".
If you want to play around,
1-set the number of x’s and c’s as required.
2-add the dummy qubits.
3-initialize c’s and d’s to |1> (required number of d’s calculated using equations in the paper)
4- set V = [0.5(1+exp((ipi)/k)),0.5(1-exp((ipi)/k));0.5(1-exp((ipi)/k)),0.5(1+exp((ipi)/k))], where k is the number of c’s and d’s.
(you have to ungroup the set of gates before you modify V, and group again)
5- set the number of iterations in the properties of the group.
The code in another comment...have fun!!!
- sim_man 11y agoV=[0.75+0.4330127018922193i 0.24999999999999994-0.4330127018922193i , 0.24999999999999994-0.4330127018922193i 0.75+0.4330127018922193i ] qubit_0="x0" qubit_1="x1" qubit_2="x2" qubit_3="c0" qubit_4="c1" qubit_5="d0" qubit_6="ax" gateproperty("group_gate10gate11gate12gate13gate14_6068",reps=10.0) gate0={H:-:-:-:-:-:-} gate1={-:H:-:-:-:-:-} gate2={-:-:H:-:-:-:-} gate3={1:1:1:NOT:-:-:-} gate4={NOT:-:-:-:-:-:-} gate5={-:NOT:-:-:-:-:-} gate6={-:-:NOT:-:-:-:-} gate7={1:1:1:-:NOT:-:-} gate8={-:-:NOT:-:-:-:-} gate9={-:NOT:-:-:-:-:-} group_gate10gate11gate12gate13gate14_6068.gate10={-:-:-:1:-:-:V} group_gate10gate11gate12gate13gate14_6068.gate11={-:-:-:-:1:-:V} group_gate10gate11gate12gate13gate14_6068.gate12={-:-:-:-:-:1:V} group_gate10gate11gate12gate13gate14_6068.gate13={-:-:-:-:-:-:!} group_gate10gate11gate12gate13gate14_6068.gate14_6068={-:-:-:-:-:-:NOT} gate17={-:-:-:!:-:-:-} gate14={-:-:-:-:!:-:-}
- Strilanc 11y agoIs the "!" showing in some of the gate definitions a post-selection operation on the corresponding qubit?
- sim_man 11y agoThe "!" is the "partial measurement" operator. I am not expert in the field but as far as I understand the partial measurement is to collapse the superposition to one of the states relative to its amplitude (probability), while the post-selection operation is to choose the output state regardless its amplitude (probability). For example, measurement on a qubit in state 1/sqrt(2)(|0>+|1>) might give |0> or |1> with 50% chance, while to postselect |0> is to get |0> with 100% regardless its amplitude. Postselection gives you the power to choose the outcomes of certain measurements while normal measurement doesn't give you that power.