1 / 64

New Approach to Quantum Calculation of Spectral Coefficients

New Approach to Quantum Calculation of Spectral Coefficients. Marek Perkowski Department of Electrical Engineering, 2005. X Y. X Y. 0. 1. 0. 1.

Download Presentation

New Approach to Quantum Calculation of Spectral Coefficients

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

  2. X Y X Y 0 1 0 1 As you remember from last lecture, rows of Hadamard transform correspond to some Boolean functions which are called Standard Trivial Functions. 0 0 1 1 1 1 Standard Trivial function for XOR of input variables Data Function X Y X Y 0 1 X Y 0 1 0 1 0 0 0 1 1 1 Standard Trivial function for input variable Y Standard Trivial function for input variable X Standard Trivial Function for whole map

  3. Important ideas • Values of spectral coefficients of function F represent correlations of this function to each of the spectral coefficients. • May be this correlation can be found differently than shown before.

  4. New Notation = Symbols • a -- the number of true minterms of Boolean function F, where both the function F and the standard trivial function have the logical values 1; • b -- the number of false minterms of Boolean function F, where the function F has the logical value 0 and the standard trivial function has the logical value 1; • c -- the number of true minterms of Boolean function F, where the function F has the logical value 1 and the standard trivial function has the logical value 0; • d -- the number of false minterms of Boolean function F, where both the function F and the standard trivial function have the logical values 0, and e be the number of don't care minterms of Boolean function F.

  5. Obvious properties: Then, for completely specified Boolean functions having n variables, this formula holds: a + b + c + d = 2n Accordingly, for incompletely specified Boolean functions, having n variables, holds: a + b + c + d + e = 2n We disregard normalization for simplification.

  6. The spectral coefficients for completely specified Boolean function can be defined in the following way: s0 = 2n – 2 * a si = 2 * (a + d) - 2n, when i ≠ 0. X Y 0 1 a -- the number of true minterms of Boolean function F, where both the function F and the standard trivial function have the logical values 1; 0 1 1 1 d -- the number of false minterms of Boolean function F, where both the function F and the standard trivial function have the logical values 0 a = 2, d = 2, n =2 s0 = 2n – 2 * a = 4 – 2 * 2 = 0 s3 = 2 * (a + d) - 2n = 2(2+2)– 4 = 4 best correlation

  7. Negation of the previous function si = 2 * (a + d) - 2n, when i ≠ 0. X Y 0 1 1 a -- the number of true minterms of Boolean function F, where both the function F and the standard trivial function have the logical values 1; 0 1 1 d -- the number of false minterms of Boolean function F, where both the function F and the standard trivial function have the logical values 0 a = 2, d = 2, n =2 s3 = 2 * (a + d) - 2n = 2(0+0)– 4 = - 4 worst correlation

  8. Other functions s0 = 2n – 2 * a = 4 – 2 * 4 = - 4 X Y 0 1 1 1 a -- the number of true minterms of Boolean function F, where both the function F and the standard trivial function have the logical values 1; 0 1 1 1 X Y 0 1 0 0 0 s0 = 2n – 2 * a = 4 – 2 * 0 = + 4 0 0 1

  9. Butterflies S encoding in complex number This in red illustrates how kernels are repeated. 0 0 + + 0 0 = 1 0 2 - 1 1 = -1 + 0 0 - 2 1 = -1 + -2 4 - 3 0 = 1 - This is kernel of butterfly. It corresponds to 2*2 unitary matrix of Hadamard (disregarding normalization coefficient). XOR Boolean Value + Number of minterm 2 -

  10. Butterflies in S encoding S encoding 0 0 + + 0 0 = 1 0 2 - 1 1 = -1 + 0 0 - 2 1 = -1 + -2 4 - 3 0 = 1 - XOR Boolean Value

  11. Butterflies in S encoding S encoding 0 0 + + 0 1 = -1 0 -2 - 1 0 = 1 + 0 0 - 2 0 = 1 + 2 -4 - 3 1 = -1 - XNOR Boolean value

  12. Butterflies in S encoding S encoding 0 2 + + 0 1 = -1 -2 -2 - 1 0 = 1 + -2 2 - 2 0 = 1 + 0 -2 - 3 0 = 1 - X’ Y’ Boolean value We cannot find anything from measurement since modules (probabilites) are equal

  13. Butterflies in S encoding S encoding 0 2 + + 0 0 = 1 2 2 - 1 1 = -1 + -2 2 - 2 0 = 1 + 0 2 - 3 0 = 1 - X’ Y Boolean value

  14. Butterflies in S encoding S encoding 2 2 + + 0 0 = 1 -2 0 - 1 0 = 1 + 2 0 - 2 1 = -1 + -2 2 - 3 0 = 1 - X Y’ Boolean value

  15. Butterflies in S encoding S encoding 2 2 + + 0 0 = 1 2 0 - 1 0 = 1 + 2 0 - 2 0 = 1 + 2 -2 - 3 1 = -1 - X Y Boolean value

  16. Butterflies in S encoding S encoding -2 0 + + 0 1 = -1 0 0 - 1 1 = -1 + -4 2 - 2 0 = 1 + 0 0 - 3 0 = 1 - X’ Boolean value

  17. Butterflies in S encoding S encoding 2 0 + + 0 0 = 1 0 0 - 1 0 = 1 + 4 -2 - 2 1 = -1 + 0 0 - 3 1 = -1 - X Boolean value

  18. Butterflies in S encoding S encoding 0 0 + + 0 0 = 1 4 2 - 1 1 = -1 + 0 0 - 2 0 = 1 + 2 0 - 3 1 = -1 - Y Boolean value

  19. Butterflies in S encoding S encoding 0 0 + + 0 1 = -1 -4 -2 - 1 0 = 1 + 0 0 - 2 1 = -1 + -2 0 - 3 0 = 1 - Y’ Boolean value

  20. Butterflies in S encoding S encoding -2 -4 + + 0 -1 0 0 - 1 -1 + 0 -2 - 2 -1 + 0 0 - 3 -1 - Constant 1 minterm

  21. Butterflies in S encoding S encoding 2 4 + + 0 0 = 1 0 0 - 1 0 = 1 + 0 2 - 2 0 = 1 + 0 0 - 3 0 = 1 - Constant 0 Boolean value

  22. Butterflies in R encoding R encoding 2 0 + + 0 0 0 0 - 1 0 + 0 2 - 2 0 + 0 0 - 3 0 - Constant 0 minterm

  23. Butterflies in R encoding R encoding 2 4 + + 0 1 0 0 - 1 1 + 0 2 - 2 1 + 0 0 - 3 1 - Constant 1 minterm

  24. Butterflies in R encoding R encoding 1 2 + + 0 0 0 -1 - 1 1 + 0 1 - 2 1 + 1 -2 - 3 0 - XOR minterm

  25. Butterflies in R encoding R encoding 1 2 + + 0 1 0 1 - 1 0 + 0 1 - 2 0 + -1 2 - 3 1 - XNOR minterm

  26. Butterflies in R encoding R encoding 1 3 + + 0 0 -1 -1 - 1 1 + -1 2 - 2 1 + 0 -1 - 3 1 - X OR Y minterm

  27. Butterflies in S encoding S encoding 0 -2 + + 0 1 2 2 - 1 -1 + 2 -2 - 2 -1 + 0 2 - 3 1 - X OR Y Boolean value

  28. Butterflies in S encoding S encoding -2 -2 + + 0 -1 2 0 - 1 -1 + -2 0 - 2 1 + 2 -2 - 3 -1 - X’ OR Y Y X 1 1 1

  29. si = 2 * (a + d) - 2n, when i ≠ 0. X Y 0 1 a -- the number of true minterms of Boolean function F, where both the function F and the standard trivial function have the logical values 1; 0 1 1 1 d -- the number of false minterms of Boolean function F, where both the function F and the standard trivial function have the logical values 0 a = 2, d = 2, n =2 s2 = 2 * (a + d) - 2n = 2(1+1)– 4 = 0

  30. si = 2 * (a + d) - 2n, when i ≠ 0. X Y 0 1 a -- the number of true minterms of Boolean function F, where both the function F and the standard trivial function have the logical values 1; 0 1 1 1 d -- the number of false minterms of Boolean function F, where both the function F and the standard trivial function have the logical values 0 a = 2, d = 2, n =2 s1 = 2 * (a + d) - 2n = 2(1+1)– 4 = 0

  31. Since each standard function has the same number of true and false minterms that is equal to 2n-1, then we can have alternative definitions of spectral coefficients. • Please note that only for the spectral coefficient s0, is the above rule not valid and the appropriate standard function is a tautology, • i.e. the logical function that is true for all its minterms. • Thus, we have: a + b = c + d = 2n-1 and si = 2 *(c + b) - 2n

  32. or si = 2 * (a + d) - 2n = 2 * (a + 2n-1 - c) - 2n or si = 2 * (a + d) - 2n = 2 * (a + d) - (a + b + c + d) = (a + d) - (b + c), when i ≠ 0. and s0 = 2n – 2 * a = a + b + c + d – 2 * a = b + c + d - a = b - a, since for s0, c and d are always equal to 0.

  33. The spectral coefficients for incompletely specified Boolean function, having n variables, can be defined in the following way: s0 = 2n – 2 * a - e and si = 2 * (a + d) + e - 2n, when i ≠ 0. As we can see, for the case when e = 0, i.e. for completely specified Boolean function, the above formulas reduce to the formulas presented previously.

  34. All but S0 coefficients And again, by easy mathematical transformations, we can define all but s0 spectral coefficients in the following way: si = 2 * (a +d) + e - 2n = 2 * (a+d) + e - (a+b+c+d+e) = (a+d) - (b+c),when i≠ 0

  35. s0 spectral coefficient Simultaneously, the s0 spectral coefficient can be rewritten in the following way: s0 = 2n - 2*a – e = a+b+c+d+e - 2*a – e = b+c+d-a = b - a,since for s0, c and d are alwaysequal to 0.

  36. Thus, in the final formulas, describing all spectral coefficients, the number of don't care minterms e can be eliminated from them. • Moreover, the final formulas are exactly the same as the ones for completely specified Boolean function. • Of course, it does not mean, that the spectral coefficients for incompletely specified Boolean function do not depend on the number of don't care minterms. • They do depend on those numbers, but the problem is already taken into account in the last two formulas themselves. • Simply, the previously stated formula for the numbers a, b, c, d, and e bonds all these values together.

  37. Conclusion • If we have a method to calculate the coefficients a, b, c, d, e then we can calculate Hadamard spectral transform coefficients with full accuracy, not only some and not probabilistically, as shown b before. • This can be done using quantum counting algorithm, which will be introduced in future.

  38. Properties of Transform Matrices • The transform matrix is complete and orthogonal, and therefore, there is no information lost in the spectrum S, concerning the minterms in Boolean function F. • Only the Hadamard-Walsh matrix has the recursive Kroneckerproduct structure • and for this reason is preferred over other possible variants of Walsh transform known in the literature as Walsh-Kaczmarz, Rademacher-Walsh, and Walsh-Paley transforms. • Only the Rademacher-Walsh transform is not symmetric; • all other variants of Walsh transform are symmetric, • so that, disregarding a scaling factor, the same matrix can be used for both the forward and inverse transform operations.

  39. Properties of Transform Matrices • When the classical matrix multiplication method is used to generate the spectral coefficients for different Walsh transforms, then the only difference is the order in which particular coefficients are created. • The values of all these coefficients are the same for every Walsh transform. • Each spectral coefficient sI gives a correlation value between the function F and a standard trivial function eIcorresponding to this coefficient. • The standard trivial functions for the spectral coefficients are, respectively, • for the coefficient s0 ( dc coefficient ) - the universe of the Boolean function denoted by e0, • for the coefficient si ( first order coefficient ) – the variable xi of the Boolean function denoted by ei,

  40. Properties of Transform Matrices cont • for the coefficient sij ( second order coefficient ) - the exclusive-or function between variables xi and xj of the Boolean function denoted by eij, • for the coefficient sijk ( third order coefficient ) - the exclusive-or function between variables xi, xj, and xk of the Boolean function denoted by eijk, etc.

  41. Properties of Transform Matrices • The sum of all spectral coefficients sIof spectrum S for any completely specified Boolean function is  2n. • The sum of all spectral coefficients sI of spectrum S for any incompletely specified Boolean function is not 2n.

  42. Properties of Transform Matrices • The maximum value of any individual spectral coefficient sI in spectrum S is  2n. • This happens when the Boolean function is equal to either a standard trivial function eI ( sign + ) or to its complement ( sign - ). • In either case, all the remaining spectral coefficients have zero values because of the orthogonality of the transform matrix T. • Each but e0 standard trivial function eI corresponding to n variable Boolean function has the same number of true and false minterms equal to 2n-1.

  43. Probabilistic measurements • If function is known to be affine, we can find which affine class it belongs to in one measurement with Hadamard gates after oracle. • If function is unknown, we can find if it is affine or not in few measurements with high probability. (this result is new, although obvious).

  44. EXAMPLE Properties of Transform Matrices S encoding -2 • The spectrum S of each true minterm of n variable Boolean function is given by s0 = 2n - 2, and all remaining 2n - 1 spectral coefficients sI are equal to  2. 0 0 + + + m0= -1 0 0 0 - m1= -1 + + -4 - 8 2 - + m2= 1 + 0 0 0 - m3= 1 + - -2 0 0 + + m4= -1 - 0 0 0 - - m5= -1 + 0 -4 2 - - m6= 1 + 0 0 0 - - m7= 1 -

  45. EXAMPLE Properties of Transform Matrices S encoding 6 = 23 - 2 0 • The spectrum S of each true minterm of n variable Boolean function is given by s0 = 2n - 2, and all remaining 2n - 1 spectral coefficients sI are equal to  2. 2 + + + m0= -1 - 2 -2 -2 - m1= 1 + + - 2 -2 2 - + m2= 1 + - 2 0 -2 - m3= 1 + - 2 - 2 4 + + m4= 1 - - 2 0 0 - - m5= 1 + - 2 0 2 - - m6= 1 + - 2 0 0 - - m7= 1 -

  46. EXAMPLE probabilities Complex amplitude (not normalized) In Hilbert Space state |000> |001> |010> |011> |100> |101> |110> |111> +6 -2 -2 -2 -2 -2 -2 -2 9/16 1/16 1/16 1/16 1/16 1/16 1/16 1/16 measurement

  47. Probabilities Selected coefficient, in this case S0 for SAT testing S encoding Sum p= 36 + 7*4 = 64 p=9/16 6=23 - 2 0 2 p=36/64 + + + m0= -1 - 2 p=4/64 -2 -2 - m1= 1 + + - 2 -2 p=4/64 2 - + m2= 1 + - 2 0 -2 p=4/64 - m3= 1 + - 2 - 2 p=4/64 4 + + m4= 1 - - 2 p=4/64 0 0 - - m5= 1 + - 2 p=4/64 0 2 - - m6= 1 + - 2 p=4/64 0 0 - - m7= 1 - p=4/64=1/16

  48. What is the probability that there is a single minterm being “one”? I measure always first coefficient 9/16 7/16 0 9/16 New state, other than previous 7/16 0 0 9/16 New state, other than previous 7/16 0 New state, other than previous 9/16 7/16 0 How many times I have to measure and obtain first spectral coefficient to be sure 99,99% that my function is constant? Is it possible? If I measure K times, and every time get the selected coefficient then the probability that my function is not the standard trivial function of this coefficient is (9/16)K which I can make arbitrarily close to 0 by increasing K.

  49. measurement • Probability(satisfied) = (7/16) + (9/16)*(7/16) + (9/16)2 * (7/16) +… • 7/16=0.4375 • 0.246 • 0.138 • 0.77 • 0.04 • 0.02 • SUM = 0.902 after 5 measurement. Conclusions: Measuring five times and not getting other coefficient than 0 we have more than 90 probability that function is constant

  50. Properties of Transform Matrices • The spectrum S of each true minterm of n variable Boolean function is given by s0 = 2n - 2, and all remaining 2n - 1 spectral coefficients sI are equal to  2. • The spectrum S of each don't care minterm of n variable Boolean function is given by s0 = 2n - 1, • and all remaining 2n - 1 spectral coefficients sI are equal to  1. • The spectrum S of each false minterm of n variable Boolean function is given by sI = 0.

More Related