next up previous contents index
Next: Non-monotonic reasoning Up: Exclusive OR (XOR) Problem Previous: Experimental setup   Contents   Index

Result and analysis

In a typical experiment run, the training goal can be easily achieved. This is the case both when the input qubits are in phase and when they are not in phase (in which there is a constant phase difference between the coefficients of the two input eigenstates). If the input is prepared exactly as in the training process, the system implements the classical XOR operation, subject to small contingent fluctuation ($\approx 2\%$ statistical error). If a threshold is applied to the output ensemble (that is, whenever an eigenstate has a relative probability greater than the threshold, say 80%, it is taken as the output), an accuracy of 100% is achieved.

As is common in many ``bottom-up'' approaches to cognition at first sight, there is an annoying small error. In two out of a hundred experiments, the system gives a wrong answer. Since XOR is a very primitive logical operator, one might expect that the performance should be as crisp as in classical logic. But a closer look at human reasoning suggests that this is not the case. For one thing, humans do err. If human reasoning works according to classical logic, one will build a reasoning chain by putting one error-free logical block upon another. But where does the error come from? It seems a quantum account can accommodate this better.

Furthermore, there are many interesting cases in natural language where even very simple utterances can get us very confused. For instance, if the initial states are symbols that are not well defined (e.g. oxymora -- ``either cruel kindness or kind cruelty,'' etc.); or if the initial states are well defined but ``interfere'' with each other (e.g. ``Psychology is a discipline either of sciences or humanities.''), the outcome of an XOR operation may fluctuate. The reason that classical logic treats the XOR function as an accurate operation is perhaps because it regards XOR as an atomic symbol. And this symbol is associated with an operation. (N.B. an operation is not a symbol). In this regard, the performance of quantum computational XOR is in fact more similar to that of a human.

If, however, the input state is not prepared exactly as in the training process, with the classical logic value maintained, the system shows phenomena that are not to be found in its classical or connectionist counterpart.

The analysis is done on a result trained with all input qubits prepared in phase, that is, when $c_{0,m}=c_{1,n}={e^{i\theta}/\sqrt 2}$. In fact, $\theta $ can be set to zero without losing generality since $U$ is a linear operator. (See Appendix A for the numerical result used in this section.)

For example, if the input states are prepared in such a way that the arguments (phases) of the two input qubits' coefficients vary independently, while the absolute value of every qubit remains the same as in the training process (since the coefficient of one of each qubit pair must be zero, we have only two independent parameters instead of four), we then record the deviation compared to the targeted output. The result is shown in Figure 6.1. In this figure, the input state is prepared as:


\begin{displaymath}
{e^{i\theta_1}\over {\sqrt 2}} {\left\vert x_1 \right\rangle...
...e^{i\theta_2}\over {\sqrt 2}} {\left\vert x_2 \right\rangle}_2
\end{displaymath} (6.4)

where $x_1, x_2 \in \left\{0,1\right\}$. There are four combinations in total. The four graphics in the figure are labeled with their classical logic truth-table counterparts at the top. The error (deviation from classical result) is defined as in Equation (6.3). In the figure we can see that if the input state consists of eigenstates that do not have the same phase-difference as in the training process, the deviation of the quantum computational result from its classical counterpart can be very large. The maximum is located at $\left\vert \theta_1-\theta_2 \right\vert=\pi$. A classical XOR can be found only within a small area where the two coefficients are almost in phase (viz. $\left\vert \theta_1-\theta_2 \right\vert$ is small). If ${\left\vert x_1 \right\rangle}_1$ and ${\left\vert x_2 \right\rangle}_2$ have coefficients that are not in phase, the output can be flipped. In fact, Figure 6.1 suggests that a phase difference of $\pi$ has a similar effect, flipping $\vert 1 \rangle$ to $\vert 0 \rangle$ and vice versa. The meaning of phase is at this moment unclear. A hypothetical interpretation of phase angle will be presented in Section 6.4.

Figure 6.1: The deviation from the targets due to phase-difference in preparing the input state ( $\theta _1, \theta _2$)
\begin{figure}\centering\indent{\epsfig{figure=xor_error.epsi,scale=1.0}}
\end{figure}

At first sight this seems to be a disadvantage because the result of a computation is sensitive to the phase-difference of inputs. What kind of logic is this if the result of the same input, say $XOR(1,1) $ is sometimes 1, sometimes 0? (We are talking about the ``wrong'' answer, which is almost always the result when inputs are out of phase, say if $\theta_1-\theta_2=\pi$, not statistical errors.) A question then is, how can a system ``know'' how to prepare the input ``correctly?'' This appears puzzling because even if these symbols have difference in phases, they have the same symbolic interpretation. In fact, without knowing the underlying complex coefficient, one cannot tell the difference between various kinds of input states with any physically possible method. Without going to the quantum level, there can be many degenerate states that have the same ``phenotype.'' They may heavily influence the outcomes of a computation. That is, symbols which, roughly speaking, have different ``meanings'' degenerate to an identical appearance. They are some sort of ``homonyms.'' In logic study, we are in fact advocating truth values that have different ``fine structures'' -- i.e. logical homonyms of truth and falsity. It turns out that if we restrict the preparation process so that the components with respect to each eigenstate are in phase, we have a quite stable classical system. In this sense, our quantum computational scheme implements the classical one. However, the fine structure allows the system to go beyond its classical counterpart and therefore extends the classical logic.

To explore this idea further, a linear preparation function is introduced to prepare the quantum input states from a given symbolic representation. More specifically, the input state is generated as follows: first the symbolic representation of the input is subject to a linear function:


\begin{displaymath}\Phi : \{1,0\}^4 \to [0,2\pi)^4\end{displaymath}

to generate four phases $\left(\phi_1,\phi_2,\phi_3,\phi_4 \right)$. Then the actual input state is prepared as:


\begin{displaymath}\left\langle x_1e^{i\phi_1}, x_2e^{i\phi_2}, x_3e^{i\phi_3}, x_4e^{i\phi_4} \right\rangle,\end{displaymath}

where $x_1, x_2, x_3, x_4 \in \{0,1\}^4$ is the symbolic representation of the input. Note that each component of the input state prepared in this way has the same absolute value as its classical symbolic counterpart. They are therefore all ``classical symbolic equivalents.'' The experimental arrangement is not altered, so the unitary operator remains the same in the following discussion, as in the bare XOR system.

The linear mapping function $\Phi$ can be represented by a 4 by 4 matrix resulting in 16 real parameters, in total, which are to be found by using a standard minimization procedure (we use a random walk algorithm [41]6.5). The cost function is as defined in Equation (6.3). But this time, instead of XOR, we now set the target function to AND. Interestingly, the system can still be trained to achieve the goal (a stochastic error of $\approx 0.01\%$, 100% if threshold is used). Now if we prepare the input state by varying the phase of each component in the ``raw'' symbolic representation and multiplying each component with a complex number with unit length, but independently varying phase (again, since exactly two of the relevant input qubits have non-zero component, the number of independent variables is two ( $\theta _1, \theta _2$) instead of four, see Equation (6.4)), the deviation from the target is illustrated in Figure 6.2. Unlike the bare-XOR, this system delivers the correct answer only in the vicinity of the origin (or multiples of $2\pi$).

Figure 6.2: The deviation of the output of $U$ from the target (the classical AND-function) w.r.t phase difference of inputs. The linear preparation function is trained for AND data.
\begin{figure}\centering\indent{\epsfig{figure=xor_and.epsi,scale=1.0}}
\end{figure}

In the same vein, $\Phi$ can also be prepared such that the classical OR function can be implemented (a stochastic error of $\approx 0.01\%$, 100% if threshold is used). The result is shown in Figure 6.3. As shown in these figures, the phase-``landscape'' of a simple quantum computational scheme can be very complex.

Figure 6.3: The deviation of the output of $U$ to the target (the classical OR-function) w.r.t phase difference of inputs. The linear preparation function is trained for OR data.
\begin{figure}\centering\indent{\epsfig{figure=xor_or.epsi,scale=1.0}}
\end{figure}

In fact, it is possible to achieve different classical functions with the same quantum mechanical arrangement. There we can see a feature of quantum computation: although the input is prepared in such a way that no physical observation can tell the difference between two experimental preparations of inputs, the underlying structure (a complex vector) may deliver significantly different results. Moreover, the outcomes still remain crisp and well-defined. This is different from what is suggested by connectionist or statistical approaches. In these approaches, the output is a real number given by a smooth function of input. This is quite unnatural as far as logic is concerned.

A more interesting implication is the fine structure of symbols. A particular input (e.g. $\left\langle {1,1} \right\rangle$, read: $\left\langle True, True \right\rangle$) does not have to be realized identically. The difference manifests itself only at a deeper level, namely when it is described by a state vector that has complex numbers as components.

So far we have only discussed the cases in which classical truth values do not confer differences while the quantum schemes do. In these cases, the truth values of input states are well-defined in the sense that the probability of finding a particular symbol ($\mathbb{T}$ or $\mathbb{F}$) is either zero or one. There are other features in common-sense reasoning which a quantum scheme can easily accommodate -- fuzziness and uncertainty, for example. In quantum mechanics, these concepts are involved in an ``impure'' superposition of eigenstates. For example, if the input state is prepared in a totally undetermined state such as:

\begin{displaymath}\left\langle {{{e^{i\theta _1}} \over {\sqrt 4}},{{e^{i\theta...
...r {\sqrt 4}},{{e^{i\theta _2}} \over {\sqrt 4}}} \right\rangle,\end{displaymath}

the system can still draw a probabilistic conclusion. In this preparation, the first qubit (consisting of the first two components) is kept in phase with phase $\theta_1$. Likewise, the second qubit (consisting of the last two components) is kept in phase with phase $\theta_2$. The output is illustrated in Figure 6.4. In this figure the outputs are shown where $\theta_1$ is set to zero and $\theta_2$ (the horizontal axis) is allowed to vary independently. The vertical axis is the probability of the output being asserted (dotted curve -- absolute square of the assertion output state) or refuted (solid curve -- absolute square of the refutation output state). It is clear that under a totally undetermined situation, the system is still able to deliver results. Interestingly, when phase difference is near $\pi$, the classical output (suppose we apply a threshold to obtain a deterministic classical output) is flipped over. Such a thing happens only when the phase difference is in the vicinity of $\pi$. This suggests that under a totally undetermined situation, the phase difference plays a very important role. The intuition of this ``out-of-phase'' condition is at this moment unclear. The implication of phases can be more clearly conjectured when we come to counterfactual reasoning. We will come back to this issue in Section 6.4.

Figure 6.4: The output of a totally undetermined input state w.r.t phase difference.
\begin{figure}\centering\indent{\epsfig{figure=xor_cross.epsi,scale=1.0}}
\end{figure}

Another important difference of the quantum computational scheme used in this chapter is that the unitary operator is time-dependent. For simplicity, we harvest the results of a computation at $t=1$ (arbitrary unit). Nevertheless, the result can be taken at a $t$ other than $t=1$. To explore this issue further, the relation of the total error of the XOR function to time is shown in Figure 6.5. In Figure 6.6, the error of the individual input is shown for the first 16 time-units. It can be seen in the figures that the system can deliver correct results only in the vicinity of $t=1$. The error begins to fluctuate wildly as time goes by. The performance of the system therefore depends critically on when the result is measured.

At first sight, this may be a drawback. But we can still find some interesting implications. According to Equation (6.2), the unitary function is, in general, an aperiodic function of time. In fact, $U$ is periodic only if the eigenvalues of $H$ are multiples or rational fractions of each other. This can be verified by considering the calculation of $e^{-iH/\hbar}$, since the exponent of the unitary operator $U$ is ``pure-imaginary'' ($i$ times a Hermitian matrix $H$). Consequently, if the eigenvalues of $H$ are non-rational numbers and/or not multiples or fractions of each other (I believe this is usually the case), the evolution of the system may penetrate a very large portion of the possible unitary transformations. This suggests that the same experimental arrangement may implement a wide variety of logical functions, each of which has very different characteristics (as shown in their corresponding phase-landscapes). Indeed, by varying the time $t$ at which the results of the computation are taken, we can implement the classical AND function, with the system originally trained for XOR, to a certain accuracy. The relation of total error as AND function to time using the same data trained for XOR target is shown in Figure 6.7.

Figure 6.5: The relation of the error of the XOR function to the time at which the outcome is measured. The error is defined as in Equation 6.3.
\begin{figure}\centering\indent{\epsfig{figure=xor_in_t_all.epsi,scale=1.0}}
\end{figure}

Figure 6.6: The relation of the error of the XOR function to the time at which the outcome is measured. The relation of each input in the training set is shown here separately.
\begin{figure}\centering\indent{\epsfig{figure=xor_in_t.epsi,scale=1.0}}
\end{figure}

Figure 6.7: The relation of the error of the AND function to the time at which the outcome is measured.
\begin{figure}\centering\indent{\epsfig{figure=and_in_t.epsi,scale=1.0}}
\end{figure}


next up previous contents index
Next: Non-monotonic reasoning Up: Exclusive OR (XOR) Problem Previous: Experimental setup   Contents   Index
Joseph Chen 2002-09-05