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

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

  • View
    223

  • Download
    0

Embed Size (px)

Citation preview

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

New Approach to Quantum Calculation of Spectral

Coefficients

Marek PerkowskiDepartment of Electrical Engineering, 2005

Page 2: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

X Y

0

1

10

1

1

Data Function

X Y

0

1

10

Standard Trivial function for XOR of input variables

X Y

0

1

10

Standard Trivial Function for whole map

X Y

0

1

10

Standard Trivial function for input variable X

X Y

0

1

10

Standard Trivial function for input variable Y

As you remember from last lecture, rows of Hadamard transform correspond to some Boolean functions which are called Standard Trivial Functions.

Page 3: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

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.

Page 4: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

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.

Page 5: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

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

Obvious properties:

We disregard normalization for simplification.

Page 6: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

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

10

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;

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

Page 7: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

si = 2 * (a + d) - 2n, when i ≠ 0.

X Y

0

1

10

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;

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

Negation of the previous functionNegation of the previous function

Page 8: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

X Y

0

1

10

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;

Other functionsOther functions

1

1

s0 = 2n – 2 * a = 4 – 2 * 4 = - 4

X Y

0

1

10

0

0

0

0 s0 = 2n – 2 * a = 4 – 2 * 0 = + 4

Page 9: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

Butterflies

+

+

+

+-

--

-

0 0 = 1

1 1 = -1

2 1 = -1

3 0 = 1

0

2

0

-2

0

0

0

4

S encoding in complex number

XOR

Number of minterm

Boolean Value

+

- 2

This is kernel of butterfly. It corresponds to 2*2 unitary matrix of Hadamard (disregarding normalization coefficient).

This in red illustrates how kernels are repeated.

Page 10: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

Butterflies in S encoding

+

+

+

+-

--

-

0 0 = 1

1 1 = -1

2 1 = -1

3 0 = 1

0

2

0

-2

0

0

0

4

S encoding

XORBoolean Value

Page 11: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

Butterflies in S encoding

+

+

+

+-

--

-

0 1 = -1

1 0 = 1

2 0 = 1

3 1 = -1

0

-2

0

2

0

0

0

-4

S encoding

XNORBoolean value

Page 12: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

Butterflies in S encoding

+

+

+

+-

--

-

0 1 = -1

1 0 = 1

2 0 = 1

3 0 = 1

0

-2

2

0

2

-2

-2

-2

S encoding

X’ Y’

Boolean value

We cannot find anything from measurement since modules (probabilites) are equal

Page 13: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

Butterflies in S encoding

+

+

+

+-

--

-

0 0 = 1

1 1 = -1

2 0 = 1

3 0 = 1

0

2

2

0

2

2

-2

2

S encoding

X’ Y

Boolean value

Page 14: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

Butterflies in S encoding

+

+

+

+-

--

-

0 0 = 1

1 0 = 1

2 1 = -1

3 0 = 1

2

0

0

-2

2

-2

2

2

S encoding

X Y’

Boolean value

Page 15: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

Butterflies in S encoding

+

+

+

+-

--

-

0 0 = 1

1 0 = 1

2 0 = 1

3 1 = -1

2

0

0

2

2

2

2

-2

S encoding

X Y

Boolean value

Page 16: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

Butterflies in S encoding

+

+

+

+-

--

-

0 1 = -1

1 1 = -1

2 0 = 1

3 0 = 1

-2

0

2

0

0

0

-4

0

S encoding

X’

Boolean value

Page 17: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

Butterflies in S encoding

+

+

+

+-

--

-

0 0 = 1

1 0 = 1

2 1 = -1

3 1 = -1

2

0

-2

0

0

0

4

0

S encoding

X

Boolean value

Page 18: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

Butterflies in S encoding

+

+

+

+-

--

-

0 0 = 1

1 1 = -1

2 0 = 1

3 1 = -1

0

2

0

2

0

4

0

0

S encoding

Y

Boolean value

Page 19: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

Butterflies in S encoding

+

+

+

+-

--

-

0 1 = -1

1 0 = 1

2 1 = -1

3 0 = 1

0

-2

0

-2

0

-4

0

0

S encoding

Y’

Boolean value

Page 20: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

Butterflies in S encoding

+

+

+

+-

--

-

0 -1

1 -1

2 -1

3 -1

-2

0

-2

0

-4

0

0

0

S encoding

Constant 1

minterm

Page 21: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

Butterflies in S encoding

+

+

+

+-

--

-

0 0 = 1

1 0 = 1

2 0 = 1

3 0 = 1

2

0

2

0

4

0

0

0

S encoding

Constant 0

Boolean value

Page 22: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

Butterflies in R encoding

+

+

+

+-

--

-

0 0

1 0

2 0

3 0

2

0

2

0

0

0

0

0

R encoding

Constant 0

minterm

Page 23: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

Butterflies in R encoding

+

+

+

+-

--

-

0 1

1 1

2 1

3 1

2

0

2

0

4

0

0

0

R encoding

Constant 1

minterm

Page 24: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

Butterflies in R encoding

+

+

+

+-

--

-

0 0

1 1

2 1

3 0

1

-1

1

1

2

0

0

-2

R encoding

XOR

minterm

Page 25: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

Butterflies in R encoding

+

+

+

+-

--

-

0 1

1 0

2 0

3 1

1

1

1

-1

2

0

0

2

R encoding

XNOR

minterm

Page 26: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

Butterflies in R encoding

+

+

+

+-

--

-

0 0

1 1

2 1

3 1

1

-1

2

0

3

-1

-1

-1

R encoding

X OR Y

minterm

Page 27: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

Butterflies in S encoding

+

+

+

+-

--

-

0 1

1 -1

2 -1

3 1

0

2

-2

0

-2

2

2

2

S encoding

X OR Y

Boolean value

Page 28: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

Butterflies in S encoding

+

+

+

+-

--

-

0 -1

1 -1

2 1

3 -1

-2

0

0

2

-2

2

-2

-2

S encoding

X’ OR Y

1 11

XY

Page 29: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

si = 2 * (a + d) - 2n, when i ≠ 0.

X Y

0

1

10

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;

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

Page 30: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

si = 2 * (a + d) - 2n, when i ≠ 0.

X Y

0

1

10

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;

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

Page 31: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

• 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

Page 32: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

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.

Page 33: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

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.

Page 34: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

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

Page 35: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

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 always equal to 0.

Page 36: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

• 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.

Page 37: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

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.

Page 38: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

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 Kronecker product 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.

Page 39: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

• 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 eI corresponding 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,

Properties of Transform Matrices

Page 40: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

• 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.

Properties of Transform Matrices cont

Page 41: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

• The sum of all spectral coefficients sI of 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 notis not 2n.

Properties of Transform Matrices

Page 42: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

• 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.

Properties of Transform Matrices

Page 43: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

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).

Page 44: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

• 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.

Properties of Transform Matrices

+

+

+

+-

--

-

m0= -1

m1= -1

m2= 1

m3= 1

-2

0

2

0

0

0

-4

0

S encoding

+

+

+

+-

--

-

m4= -1

m5= -1

m6= 1

m7= 1

-2

0

2

0

0

0

-4

0

+

+

+

+

--

-

-

0

0

- 8

0

0

0

0

0

EXAMPLE

Page 45: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

• 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.

Properties of Transform Matrices

+

+

+

+-

--

-m0= -1

m1= 1

m2= 1

m3= 1

0

-2

2

0

2

-2

-2

-2

S encoding

+

+

+

+-

--

-

m4= 1

m5= 1

m6= 1

m7= 1

2

0

2

0

4

0

0

0

+

+

+

+

--

-

-

6 = 23 - 2

- 2

- 2

- 2

- 2

- 2

- 2

- 2

EXAMPLE

Page 46: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

In Hilbert Space

+6 -2 -2 -2 -2 -2 -2 -2

|000>

|001>

|010>

|011>

|100>

|101>

|110>

|111>

stateComplex amplitude (not normalized)

measurement

9/16

1/16

1/16

1/16

1/16

1/16

1/16

1/16

probabilitiesprobabilitiesEXAMPLE

Page 47: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

Probabilities

+

+

+

+-

--

-

m0= -1

m1= 1

m2= 1

m3= 1

0

-2

2

0

2

-2

-2

-2

S encoding

+

+

+

+-

--

-

m4= 1

m5= 1

m6= 1

m7= 1

2

0

2

0

4

0

0

0

+

+

+

+

--

-

-

6=23 - 2

- 2

- 2

- 2

- 2

- 2

- 2

- 2

p=36/64

Sum p= 36 + 7*4 = 64

p=4/64

p=4/64

p=4/64

p=4/64

p=4/64

p=4/64

p=4/64

p=4/64=1/16

p=9/16

Selected coefficient, in this case S0 for SAT testing

Page 48: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

What is the probability that there is a single minterm being “one”?

9/160

New state, other than previous

7/16

9/160

7/16

New state, other than previous

09/1607/16

New state, other than previous

9/1607/16

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?

I measure always first coefficient

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.

Page 49: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

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:Conclusions:

Measuring Measuring five timesfive times and not getting other and not getting other coefficient than 0 we have coefficient than 0 we have more than 90 probabilitymore than 90 probability that function is that function is constantconstant

Page 50: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

• 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.

Properties of Transform Matrices

Page 51: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

What we achieved?

• 1. If the function is known to be linear or affine, by measuring once we can distinguish which one is the linear function in the box. We cannot distinguish a linear function from its negation. They differ by sign that is lost in measurement.

• 2. If function is a constant (zero for satisfiability and one for tautology) we can find with high probability that it is constant. – Thus we can solve SAT with high probability but without knowing

which input minterm satisfies. (a single one in a Kmap of zeros)– Thus we can solve Tautology with high probability but without

knowing which input minterm fails (a single zero in kmap of ones).

Page 52: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

What we achieved?

• 3. We can find the highest spectral coefficients by generating them using quantum oracles. Those coefficients that have high values will be generated with high probability.– In terms of signals and images it gives the basic

harmonics or patterns in signal, such as textures.– This can have applications to image processing and

speech processing. It is known that animals’ hearing apparatus does spectral transform.

• 4. Instead of using Hadamard gates in the transform we can use V to find a separation of some Boolean functions.

• But we were not able to extend this to more variables.

Page 53: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

measure

Here, after oracle we have all information about the function (Kmap) but we cannot access it as is

Common to many quantum algorithms

I promised to discuss how can be generalized!

V

V

Now we insert gates V instead of gates H

V = 1/21+i 1-i

1-i 1+i

Page 54: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

What we achieved?• 4. Instead of using Hadamard gates in the

transform we can use V to find a separation of some Boolean functions.

• But we were not able to extend this to more variables.

0 1

1 1

Group 1-symmetric not affine

Group 2-non-symmetric not affine

0 0

0 1

1 1

1 0

1 0

0 00 0

1 0

1 0

1 1

1 1

0 1

0 1

0 0

We can separate these two classes in single measurement

Page 55: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

What we achieved?

• 5. Knowing some high coefficients, we can calculate their values exactly, one evaluation (called also one run or one measurement) for each spectral coefficient.

Page 56: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

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.

1 1

1 1

1 1

1 1

0 0

0 0

0 0

0 0

a=8 b=0

c=0 d=8

Page 57: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

si = 2 * (a + d) - 2n =

2 * (a + d) - (a + b + c + d) =

(a + d) - (b + c), when i ≠ 0.

1 1

1 1

1 1

1 1

0 0

0 0

0 0

0 0

a=8

c=0 d=8

b=0

si = (a + d) - (b + c) = 16

Page 58: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

si = 2 * (a + d) - 2n =

2 * (a + d) - (a + b + c + d) =

(a + d) - (b + c), when i ≠ 0.

1 0

1 1

1 1

1 1

0 0

0 0

0 0

0 0

a=7

c=0 d=8

b=1

si = (a + d) - (b + c) = 16

Ones inside

Zeros outside

zeros inside

Ones outside

(7+8 ) - (1+0) = 14

Page 59: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

si = 2 * (a + d) - 2n =

2 * (a + d) - (a + b + c + d) =

(a + d) - (b + c), when i ≠ 0.

1 1

1 1

1 1

1 1

0 0

0 0

0 0

0 0

a=0

c=8 d=0

b=8

si = (a + d) - (b + c) = -16

Page 60: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

si = 2 * (a + d) - 2n =

2 * (a + d) - (a + b + c + d) =

(a + d) - (b + c), when i ≠ 0.

1 1

1 1

1 1

1 1

0 0

0 0

0 0

0 0

a=4

c=4 d=4

b=4

si = (a + d) - (b + c) = 0

Page 61: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

si = 2 * (a + d) - 2n =

2 * (a + d) - (a + b + c + d) =

(a + d) - (b + c), when i ≠ 0.

1 1

1 1

1 1

1 1

0 0

0 0

0 0

0 0

a=4

c=4 d=4

b=4

si = (a + d) - (b + c) = 0

Page 62: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

si = 2 * (a + d) - 2n =

2 * (a + d) - (a + b + c + d) =

(a + d) - (b + c), when i ≠ 0.

1 0

1 1

1 1

1 1

0 0

0 0

0 0

0 0

a=3

c=4 d=4

b=4

si = (a + d) - (b + c) = (3+4) – (4+4) = -1

Page 63: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

Architecture for arbitrary coefficients

Using the formulas developed above we can measure the correlation to every standard trivial function.

Moreover, we can measure the number of minterms in arbitrary function that we create as an additional oracle XORed with the original oracle.

This way we can calculate all cofactors and use methods of synthesis and analysis of Boolean functions based on cofactors.

Page 64: New Approach to Quantum Calculation of Spectral Coefficients Marek Perkowski Department of Electrical Engineering, 2005

a

b

ff (ab)

Quantum circuitFor calculation

of numbers of ones

We calculate the number of ones (true minterms) in the XOR of function f and standard trivial function (ab).

If this number is zero, then there is a maximum correlation and function f is (ab).

If there are 2n true minterms, then the function is (ab).

Example to calculate the value of the coefficient Sab