Write
153
edits
No edit summary |
No edit summary |
||
Line 112: | Line 112: | ||
* initialise array <math>R,r</math> of length <math>m</math> | * initialise array <math>R,r</math> of length <math>m</math> | ||
* For <math>i\leftarrow1</math> to <math>m</math>: | * For <math>i\leftarrow1</math> to <math>m</math>: | ||
** set <math>R[i]=True</math> with probability <math>1/l</math> (seed with | ** set <math>R[i]=True</math> with probability <math>1/l</math> (seed with <math>t^{(1)}</math>) | ||
* For <math>i\leftarrow1</math> to <math>m</math> do initialise array <math>r_i</math> of length <math>\kappa</math> | * For <math>i\leftarrow1</math> to <math>m</math> do initialise array <math>r_i</math> of length <math>\kappa</math> | ||
** If <math>R[i]</math>: | ** If <math>R[i]</math>: | ||
*** For <math>j\leftarrow1</math> to <math>\kappa</math>: | *** For <math>j\leftarrow1</math> to <math>\kappa</math>: | ||
**** prepare state <math>|\Psi^+\rangle</math> and share across devices <math>D_1</math> and <math>D_2</math> | **** prepare state <math>|\Psi^+\rangle</math> and share across devices <math>D_1</math> and <math>D_2</math> | ||
**** <math>a_j\leftarrow</math> measurement results from device <math>D_1</math> in basis <math> | **** <math>a_j\leftarrow</math> measurement results from device <math>D_1</math> in basis <math>A_{bases}[0]</math> | ||
**** <math>b_j\leftarrow</math> measurement results from device <math>D_2</math> in basis <math> | **** <math>b_j\leftarrow</math> measurement results from device <math>D_2</math> in basis <math>B_{bases}[0]</math> | ||
**** If <math>a\neq b</math>: | **** If <math>a\neq b</math>: | ||
***** <math>\textbf{abort}</math> | ***** <math>\textbf{abort}</math> | ||
Line 126: | Line 126: | ||
*** <math>x_i\leftarrow</math> draw next random bit from <math>t^{(1)}</math> | *** <math>x_i\leftarrow</math> draw next random bit from <math>t^{(1)}</math> | ||
*** <math>y_i\leftarrow</math> draw next random bit from <math>t^{(1)}</math> | *** <math>y_i\leftarrow</math> draw next random bit from <math>t^{(1)}</math> | ||
*** set device <math>D_1</math> to <math> | *** set device <math>D_1</math> to <math>A_{bases}[x_i]</math> | ||
*** set device <math>D_2</math> to <math> | *** set device <math>D_2</math> to <math>A_{bases}[0],B_{bases}[0]\}[y_i]</math> | ||
*** For <math>j\leftarrow1</ | *** For <math>j\leftarrow1</math> to <math>\kappa</math>: | ||
**** prepare state <math>|\Psi^+\rangle</math> and share across devices <math>D_1</math> and <math>D_2</math> | **** prepare state <math>|\Psi^+\rangle</math> and share across devices <math>D_1</math> and <math>D_2</math> | ||
**** <math>a_j\leftarrow</math> measurement results from device <math>D_1</math> in set basis <math> | **** <math>a_j\leftarrow</math> measurement results from device <math>D_1</math> in set basis <math>A_{bases}[0]</math> | ||
**** <math>b_j\leftarrow</math> measurement results from device <math>D_2</math> in set basis <math> | **** <math>b_j\leftarrow</math> measurement results from device <math>D_2</math> in set basis <math>B_{bases}[0]</math> | ||
**** <math>r_i[j]\leftarrow(a_j,b_j)</math> | **** <math>r_i[j]\leftarrow(a_j,b_j)</math> | ||
**** <math>d\leftarrow d+(a_j\oplus b_j)/\kappa</math> | **** <math>d\leftarrow d+(a_j\oplus b_j)/\kappa</math> | ||
Line 149: | Line 149: | ||
'''Output''': <math>u</math> | '''Output''': <math>u</math> | ||
* split <math>t | * split <math>t</math> evenly into <math>(t^{(1)},t^{(2)})</math> | ||
* <math>n\leftarrow\big\lfloor\frac{|t^{(1)}|}{2}\big\rfloor</math> | * <math>n\leftarrow\big\lfloor\frac{|t^{(1)}|}{2}\big\rfloor</math> | ||
* initialise arrays <math>r | * initialise arrays <math>r</math>, <math>s</math> of length <math>n</math> | ||
* <math>w\leftarrow0 | * <math>w\leftarrow0</math> | ||
* For <math>i\leftarrow1 | * For <math>i\leftarrow1</math> to <math>n</math>: | ||
** prepare state <math>|\Psi^+\rangle</math> and share across devices <math>D_1</math> and <math>D_2</math> | ** prepare state <math>|\Psi^+\rangle</math> and share across devices <math>D_1</math> and <math>D_2</math> | ||
** <math>x_i\leftarrow t^{(1)}_i</math> | ** <math>x_i\leftarrow t^{(1)}_i</math> | ||
** <math>y_i\leftarrow t^{(1)}_{i+1}</math> | ** <math>y_i\leftarrow t^{(1)}_{i+1}</math> | ||
** <math>a_i\leftarrow</math> measurement result from device <math>D_1 | ** <math>a_i\leftarrow</math> measurement result from device <math>D_1</math> in basis <math>A_{bases}[x_i]</math> | ||
** <math>b_i\leftarrow</math> measurement result from device <math>D_2 | ** <math>b_i\leftarrow</math> measurement result from device <math>D_2</math> in basis <math>B_{bases}[y_i]</math> | ||
** <math>s[i]\leftarrow(x_i,y_i)</math> | ** <math>s[i]\leftarrow(x_i,y_i)</math> | ||
** <math>r[i]\leftarrow(a_i,b_i)</math> | ** <math>r[i]\leftarrow(a_i,b_i)</math> | ||
Line 165: | Line 165: | ||
* If <math>w < n\cos^2(\pi/8)-\frac{1}{2\sqrt{2}}\sqrt{n\log{n}}</math>: | * If <math>w < n\cos^2(\pi/8)-\frac{1}{2\sqrt{2}}\sqrt{n\log{n}}</math>: | ||
** \textbf{abort} | ** \textbf{abort} | ||
* <math>\gamma_1\leftarrow</math> random number in range | * <math>\gamma_1\leftarrow</math> random number in range <math>\{0...n/N-1\}</math> (seed using <math>t^{(2)}</math>) | ||
* <math>\gamma_2\leftarrow</math> random number in range | * <math>\gamma_2\leftarrow</math> random number in range <math>\{1...\sqrt{N}-1\}</math> (seed using <math>t^{(2)}</math>) | ||
* initialise array <math>u</math> of length <math>\sqrt{N}</math> | * initialise array <math>u</math> of length <math>\sqrt{N}</math> | ||
* For <math>i\leftarrow0</math> to <math>\sqrt{N}</math>: | * For <math>i\leftarrow0</math> to <math>\sqrt{N}</math>: |