1 Introduction

Quantum mechanics (cf. [1,2,3,4,5,6,7]) is an important physical theory to explain the quantum behaviors of the nature. Between the articles of research for constructing theoretical quantum algorithms [8] it may be mentioned as follows. In 1985, the Deutsch algorithm was introduced and constructed for the function property problem [9,10,11]. In 1993, the Bernstein–Vazirani algorithm was proposed for identifying linear functions [12, 13]. Generalization of the Bernstein–Vazirani algorithm beyond qubit systems is reported [14]. In 1994, Simon’s algorithm [15] and Shor’s algorithm [16] were discussed for period finding of periodic functions. In 1996, Grover [17] provided an algorithm for unordered object finding and the motivation for exploring the computational possibilities offered by quantum mechanics.

A simple algorithm for complete factorization of an N-partite pure quantum state is proposed by Mehendale and Joag [18]. Fujikawa, Oh, and Umetsu discuss a classical limit of Grover’s algorithm induced by dephasing: coherence versus entanglement [19]. Quantum dialogue protocol based on Grover’s search algorithms is presented by Yin, He, and Fan [20]. Efficient quantum arithmetic operation circuits for quantum image processing are discussed by Li et al. [21]. Gidney discusses halving the cost of quantum addition [22]. Li et al. discuss the circuit design and optimization of quantum multiplier and divider [23].

Some related references may be included on the high-dimensional case. Yan and Gao discuss Perfect NOT and conjugate transformations which are about the perfect NOT gate in d-dimensions [24]. Liu et al. discuss general scheme for superdense coding between multiparties [25]. Deconstructing dense coding is discussed by Mermin [26]. In high dimension, some of the operations are more complicated than that in the qubit case.

A quantum algorithm for a FULL adder operation based on registers of the CPU in a quantum-gated computer is discussed [27]. Even in quantum computers like electronic computers, “storing of programs and data” is the most important factor for data processing. Fortunately, we have discovered [28, 29] that the technique of using XOR based on Deutsch’s algorithm can be expandable to storing any Boolean function, of course, including XOR in “quantum memory” that automatically exists if we make use of the superposition and phase kickback concepts based upon XOR skillfully. It is important that such Boolean functions are regarded as “basics of programs” for a general purpose computing even on quantum-gated computers.

It is quite natural that we can step out into the wider world as researchers because of having such memory in even quantum-gated computers. By virtue of having such memory, we can draw any quantum logic circuits of ALU (Arithmetic and Logic Unit) and the control unit, as the hardware of the CPU (Central Processing Unit) of the quantum-gated computer. And then on such a whole hardware as a computer, we may run any program to be designed and constructed using the logical concept of Boolean functions. When we have efficient coupling between the hardware and programs with data, we will be happy in attaining a quantum-gated computer.

Fortunately, we have discovered an algorithm for storing the logical functions in a Boolean algebra. In other words, this corresponds to discovery of memory for logic functions in quantum-gated computers by means of multiple operations based on Exclusive OR with the two concepts, superposition and phase kickback. This theory is shown in Ref. [28].

In short, it is shown all the Boolean functions are set into the quantum computer just like the electronic computer. This fact means that all performances in logic of computing and control of itself are available even in quantum computers. Therefore, we could design any quantum-gated computer using the traditional design ways in logic of existing electronic computers [28].

Based upon the above, we reviewed concretely how to store logical functions in the memory of the quantum-gated computer, thinking of not only logic circuits but also programs in terms of logic. And naturally we demonstrated typical arithmetic calculations in the binary system. From this trial, we are going to lead a quantum-gated computer to be implemented commercially. This is theoretically and practically shown in Ref. [29].

In more details, we prove that the quantum computer can operate just like the electronic computer fundamentally through the operation of addition of two n-digit numbers. Therefore, the quantum computer can solve all the four basic operations of arithmetic, addition, subtraction, multiplication, and division. Further, it can be said that this quantum computer naturally operates not only arithmetic but also logic in terms of Boolean logic [29].

As a result, the theory proposed by Refs. [28, 29] can build a quantum-gated computer that is driven and operated by all software (all programs) used on existing electronic computers.

Finally, we say that such quantum-gated computers are much faster than existing electronic computers by virtue of quantum effectiveness that quantum mechanics consists of the most important concept of an elementary particle with the speed much higher than light’s. So, we can than could expand processing functionality of quantum-gated computers for wider range of applications based on physics and chemistry. In addition, we might guess that the energy consumption of quantum computers would be much smaller than that of electronic computers.

Generalization of Deutsch’s algorithm is reported [30]. Quantum algorithm for evaluating two of logical functions simultaneously is proposed [31]. Computational complexity in high-dimensional quantum computing is also discussed [32].

However, in the theory presented in Refs. [28,29,30], all the quantum states are not completely orthogonal to each other. Therefore, we have some error probability when we distinguish the quantum states [33, 34]. Nevertheless, we are able to construct our theory using orthogonal states.

In this article, we completely and simply expand Deutsch’s algorithm for determining all the mappings of a function using four orthogonal states. Using this, we propose a direct and simple method for a parallel computation for all of the combinations of values in variables of a logical function using sixteen orthogonal states. As an application of our algorithm, we demonstrate two typical arithmetic calculations in the binary system. We study an efficiency for operating a full adder/half adder by quantum-gated computing. The two typical arithmetic calculations are \((1+1)\) and \((2+3)\). The typical arithmetic calculation \((2+3)\) is faster than that of its classical apparatus which would require \(4^3=64\) steps when we introduce the full adder operation. Another typical arithmetic calculation \((1+1)\) is faster than that of its classical apparatus which would require \(4^2=16\) steps when we introduce only the half adder operation.

2 Expansion of Deutsch’s algorithm based on orthogonal states

Deutsch’s algorithm determines if the given function \(f:\mathbb Z_2 \rightarrow \mathbb Z_2\) is constant or balanced. The function is called to be constant if \(f(0)=f(1)\). The function is called to be balanced if \(f(0)\ne f(1)\). We expand Deutsch’s algorithm. Deutsch’s algorithm expanded determines all the mappings of the given function. We can determine simultaneously the following mappings:

$$\begin{aligned} f(0)=?, f(1)=?. \end{aligned}$$
(1)

2.1 Basic structure of quantum computing

Quantum superposition and quantum phase factor are fundamental features of many quantum algorithms. Both of them are necessary. They allow quantum computers to evaluate simultaneously the mappings of a function f(x) for many different x. Suppose

$$\begin{aligned} f:\{0,1\}\rightarrow \{0,1\} \end{aligned}$$
(2)

is a function with a one-bit domain and range. A convenient way of computing the function on a quantum computer is of considering a two-qubit quantum computer that starts with the state \(|x,y\rangle \), where x and y are variables used in mapping f. The abbreviation \(|x,y\rangle \) stands for \(|x\rangle \otimes |y\rangle \).

It is possible to transform the state \(|x,y\rangle \) into

$$\begin{aligned} |x,y\oplus f(x)\rangle , \end{aligned}$$
(3)

by applying the quantum oracle, where \(\oplus \) indicates addition modulo 2. We denote the transformation \(U_f\) defined by the map

$$\begin{aligned} U_f|x,y\rangle =|x,y\oplus f(x)\rangle . \end{aligned}$$
(4)

2.2 Deutsch’s algorithm

Let us review Deutsch’s formula as follows:

$$\begin{aligned}{} & {} U_f|0\rangle (|0\rangle -|1\rangle )/\sqrt{2}= |0\rangle (|0\oplus f(0)\rangle -|1\oplus f(0)\rangle )/\sqrt{2}\nonumber \\{} & {} ={\left\{ \begin{array}{ll} (-1)^{f(0)}|0\rangle (|0\rangle -|1\rangle )/\sqrt{2} &{}\textrm{if}\ \ f(0)=0,\\ (-1)^{f(0)}|0\rangle (|0\rangle -|1\rangle )/\sqrt{2} &{}\textrm{if}\ \ f(0)=1. \end{array}\right. }\end{aligned}$$
(5)
$$\begin{aligned}{} & {} U_f|1\rangle (|0\rangle -|1\rangle )/\sqrt{2}= |1\rangle (|0\oplus f(1)\rangle -|1\oplus f(1)\rangle )/\sqrt{2}\nonumber \\{} & {} ={\left\{ \begin{array}{ll} (-1)^{f(1)}|1\rangle (|0\rangle -|1\rangle )/\sqrt{2} &{}\textrm{if}\ \ f(1)=0,\\ (-1)^{f(1)}|1\rangle (|0\rangle -|1\rangle )/\sqrt{2} &{}\textrm{if}\ \ f(1)=1. \end{array}\right. } \end{aligned}$$
(6)

This is the phase kickback formation.

Let us introduce the Bloch sphere. We consider a quantum state lying in the x-axis and a quantum state lying in the z-axis. Deutsch’s formula does not use a quantum state lying in y-axis. f(0) and f(1) appear in the global phase factor, but we cannot obtain both of them at the same time.

We define the following notations:

$$\begin{aligned} |-\rangle _y=\frac{|0\rangle -i|1\rangle }{\sqrt{2}}, |+\rangle _y=\frac{|0\rangle +i|1\rangle }{\sqrt{2}}, |-\rangle _x=\frac{|0\rangle -|1\rangle }{\sqrt{2}}, |+\rangle _x=\frac{|0\rangle +|1\rangle }{\sqrt{2}}. \end{aligned}$$
(7)

In fact, we may define the input state as (8).

$$\begin{aligned} |\psi _0\rangle _d= \frac{1}{\sqrt{2}}|0\rangle |-\rangle _x +\frac{1}{\sqrt{2}}|1\rangle |-\rangle _x=|+\rangle _x|-\rangle _x, \quad _d \langle \psi _0|\psi _0\rangle _d=1. \end{aligned}$$
(8)

Applying \(U_{f_{i}}, (i=0,1,2,3)\) to \(|\psi _0\rangle _d\), \(U_{f_{i}}|\psi _0\rangle _d=|\psi _1\rangle _{id}\), therefore, leaves us with one of four cases:

$$\begin{aligned}{} & {} U_{f_{0}}|\psi _0\rangle _d=|\psi _1\rangle _{0d}= \frac{1}{\sqrt{2}} |0\rangle |-\rangle _x + \frac{1}{\sqrt{2}} |1\rangle |-\rangle _x=|+\rangle _x|-\rangle _x \quad \textrm{iff}\ \ f_0(0)=0, f_0(1)=0,\nonumber \\{} & {} U_{f_{1}}|\psi _0\rangle _d=|\psi _1\rangle _{1d}= \frac{1}{\sqrt{2}} |0\rangle |-\rangle _x -\frac{1}{\sqrt{2}} |1\rangle |-\rangle _x=|-\rangle _x|-\rangle _x \quad \textrm{iff}\ \ f_1(0)=0, f_1(1)=1,\nonumber \\{} & {} U_{f_{2}}|\psi _0\rangle _d=|\psi _1\rangle _{2d}=-\frac{1}{\sqrt{2}} |0\rangle |-\rangle _x +\frac{1}{\sqrt{2}} |1\rangle |-\rangle _x=-|-\rangle _x|-\rangle _x \quad \textrm{iff}\ \ f_2(0)=1, f_2(1)=0,\nonumber \\{} & {} U_{f_{3}}|\psi _0\rangle _d=|\psi _1\rangle _{3d}= -\frac{1}{\sqrt{2}}|0\rangle |-\rangle _x - \frac{1}{\sqrt{2}} |1\rangle |-\rangle _x=-|+\rangle _x|-\rangle _x \quad \textrm{iff}\ \ f_3(0)=1, f_3(1)=1. \end{aligned}$$
(9)

If we have (9), we do not obtain simultaneously both f(0) and f(1) by measuring the single output state.

By measuring \(|\psi _1\rangle _{id}\), we cannot determine simultaneously all the two mappings of \(f_i(x)\) for all x. But, we can determine if the given function is constant or balanced. This is faster than a classical apparatus, which would require at least 2 evaluations.

2.3 Expansion of Deutsch’s algorithm

We can expand Deutsch’s algorithm using a quantum state lying in the xy-plane. In what follows, we consider the Bloch sphere, especially, we consider a quantum state lying in the xy-plane. From Deutsch’s formula and the mapping \(U_f\), we arrive the following formulas:

$$\begin{aligned}{} & {} U_f|0\rangle (\cos \frac{\theta }{2}|0\rangle +e^{i \phi }\sin \frac{\theta }{2}|1\rangle ) =|0\rangle (\cos \frac{\theta }{2}|0\oplus f(0)\rangle +e^{i \phi }\sin \frac{\theta }{2}|1\oplus f(0)\rangle )\nonumber \\{} & {} ={\left\{ \begin{array}{ll} |0\rangle (\cos \frac{\theta }{2}|0\rangle +e^{i \phi }\sin \frac{\theta }{2}|1\rangle ) &{}\textrm{if}\ \ f(0)=0,\\ |0\rangle (\cos \frac{\theta }{2}|1\rangle +e^{i \phi }\sin \frac{\theta }{2}|0\rangle ) &{}\textrm{if}\ \ f(0)=1. \end{array}\right. }\end{aligned}$$
(10)
$$\begin{aligned}{} & {} U_f|1\rangle (\cos \frac{\theta '}{2}|0\rangle +e^{i \phi '}\sin \frac{\theta '}{2}|1\rangle ) = |1\rangle (\cos \frac{\theta '}{2}|0\oplus f(1)\rangle +e^{i \phi '}\sin \frac{\theta '}{2}|1\oplus f(1)\rangle )\nonumber \\{} & {} ={\left\{ \begin{array}{ll} |1\rangle (\cos \frac{\theta '}{2}|0\rangle +e^{i \phi '}\sin \frac{\theta '}{2}|1\rangle ) &{}\textrm{if}\ \ f(1)=0,\\ |1\rangle (\cos \frac{\theta '}{2}|1\rangle +e^{i \phi '}\sin \frac{\theta '}{2}|0\rangle ) &{}\textrm{if}\ \ f(1)=1. \end{array}\right. } \end{aligned}$$
(11)

This is enough to realize our main goal, but, to simplify, we suppose a quantum state lying in just the y-axis. Thus let \((\theta ,\phi )\) be \((\pi /2,\pi /2)\) and let \((\theta ',\phi ')\) be \((\pi /2,\pi /2)\) in giving

$$\begin{aligned}{} & {} U_f|0\rangle (|0\rangle +i|1\rangle )/\sqrt{2}= {\left\{ \begin{array}{ll} (i)^{f(0)}|0\rangle (|0\rangle +i|1\rangle )/\sqrt{2} &{}\textrm{if}\ \ f(0)=0,\\ (i)^{f(0)}|0\rangle (|0\rangle -i|1\rangle )/\sqrt{2} &{}\textrm{if}\ \ f(0)=1. \end{array}\right. }\end{aligned}$$
(12)
$$\begin{aligned}{} & {} U_f|1\rangle (|0\rangle +i|1\rangle )/\sqrt{2} = {\left\{ \begin{array}{ll} (i)^{f(1)}|1\rangle (|0\rangle +i|1\rangle )/\sqrt{2} &{}\textrm{if}\ \ f(1)=0,\\ (i)^{f(1)}|1\rangle (|0\rangle -i|1\rangle )/\sqrt{2} &{}\textrm{if}\ \ f(1)=1. \end{array}\right. } \end{aligned}$$
(13)

We define the input state as (14). Here we use a phase effect, which is a quantum phenomenon. We define the input state as follows:

$$\begin{aligned}{} & {} |\psi _0\rangle = \frac{1}{\sqrt{2}} |0\rangle |+\rangle _y +\frac{1}{\sqrt{2}} |1\rangle |+\rangle _y, \langle \psi _0|\psi _0\rangle =1. \end{aligned}$$
(14)

Applying \(U_{f_{i}}, (i=0,1,2,3)\) to \(|\psi _0\rangle \), \(U_{f_{i}}|\psi _0\rangle =|\psi _1\rangle _i\), therefore, leaves us with one of four cases:

$$\begin{aligned}{} & {} U_{f_{0}}|\psi _0\rangle =|\psi _1\rangle _0=\frac{1}{\sqrt{2}} |0\rangle |+\rangle _y + \frac{1}{\sqrt{2}} |1\rangle |+\rangle _y \quad \textrm{iff}\ \ f_0(0)=0, f_0(1)=0,\nonumber \\{} & {} U_{f_{1}}|\psi _0\rangle =|\psi _1\rangle _1= \frac{1}{\sqrt{2}} |0\rangle |+\rangle _y +i \frac{1}{\sqrt{2}}|1\rangle |-\rangle _y \quad \textrm{iff}\ \ f_1(0)=0, f_1(1)=1,\nonumber \\{} & {} U_{f_{2}}|\psi _0\rangle =|\psi _1\rangle _2=i\frac{1}{\sqrt{2}} |0\rangle |-\rangle _y +\frac{1}{\sqrt{2}}|1\rangle |+\rangle _y \quad \textrm{iff}\ \ f_2(0)=1, f_2(1)=0,\nonumber \\{} & {} U_{f_{3}}|\psi _0\rangle =|\psi _1\rangle _3=i\frac{1}{\sqrt{2}}|0\rangle |-\rangle _y + i\frac{1}{\sqrt{2}} |1\rangle |-\rangle _y \quad \textrm{iff}\ \ f_3(0)=1, f_3(1)=1. \end{aligned}$$
(15)

If we have (15), we know simultaneously both f(0) and f(1) by measuring the single output state.

Thus, by measuring \(|\psi _1\rangle _i\), we may determine simultaneously all the two mappings of \(f_i(x)\) for all x. This is faster than a classical apparatus, which would require at least 2 evaluations. However, the four states are not orthogonal in one another. Therefore, we have some error probability when we distinguish the four states [33, 34]. Nevertheless, we are able to eliminate the error probability into zero as show below.

2.4 Expansion of Deutsch’s algorithm based on orthogonal states

We present the expansion of Deutsch’s algorithm based on orthogonal states. We propose the following input state:

$$\begin{aligned} |\psi _0\rangle _d\otimes |\psi _0\rangle = |+\rangle _x|-\rangle _x \otimes |+\rangle _x|+\rangle _y. \end{aligned}$$
(16)

Applying \(U_{f_{i}}\otimes U_{f_{i}}, (i=0,1,2,3)\) to \(|\psi _0\rangle _d\otimes |\psi _0\rangle \), \(U_{f_{i}}\otimes U_{f_{i}}|\psi _0\rangle _d\otimes |\psi _0\rangle =|\psi _1\rangle _{id}\otimes |\psi _1\rangle _i\), therefore leaves us with one of four cases:

$$\begin{aligned}{} & {} U_{f_{0}}\otimes U_{f_{0}}|\psi _0\rangle _{d}\otimes |\psi _0\rangle =|\psi _1\rangle _{0d}\otimes |\psi _1\rangle _0 =|+\rangle _x|-\rangle _x\otimes ( \frac{1}{\sqrt{2}}|0\rangle |+\rangle _y +\frac{1}{\sqrt{2}} |1\rangle |+\rangle _y)\nonumber \\{} & {} \textrm{iff}\ \ f_0(0)=0, f_0(1)=0, \end{aligned}$$
(17)
$$\begin{aligned}{} & {} U_{f_{1}}\otimes U_{f_{1}}|\psi _0\rangle _{d}\otimes |\psi _0\rangle =|\psi _1\rangle _{1d}\otimes |\psi _1\rangle _1 =|-\rangle _x|-\rangle _x\otimes ( \frac{1}{\sqrt{2}}|0\rangle |+\rangle _y +i\frac{1}{\sqrt{2}} |1\rangle |-\rangle _y)\nonumber \\{} & {} \textrm{iff}\ \ f_1(0)=0, f_1(1)=1, \end{aligned}$$
(18)
$$\begin{aligned}{} & {} U_{f_{2}}\otimes U_{f_{2}}|\psi _0\rangle _{d}\otimes |\psi _0\rangle =|\psi _1\rangle _{2d}\otimes |\psi _1\rangle _2 = -|-\rangle _x|-\rangle _x\otimes (i\frac{1}{\sqrt{2}}|0\rangle |-\rangle _y +\frac{1}{\sqrt{2}}|1\rangle |+\rangle _y)\nonumber \\{} & {} \textrm{iff}\ \ f_2(0)=1, f_2(1)=0, \end{aligned}$$
(19)
$$\begin{aligned}{} & {} U_{f_{3}}\otimes U_{f_{3}}|\psi _0\rangle _{d}\otimes |\psi _0\rangle =|\psi _1\rangle _{3d}\otimes |\psi _1\rangle _3 =-|+\rangle _x|-\rangle _x\otimes ( i\frac{1}{\sqrt{2}}|0\rangle |-\rangle _y +i\frac{1}{\sqrt{2}} |1\rangle |-\rangle _y)\nonumber \\{} & {} \textrm{iff}\ \ f_3(0)=1, f_3(1)=1. \end{aligned}$$
(20)

If we have the relations above, we know simultaneously both f(0) and f(1) by measuring the single output state. The four states are orthogonal in one another. Therefore, we have zero error probability when we distinguish the four states. Thus, by measuring \(|\psi _1\rangle _{id}\otimes |\psi _1\rangle _i\), we may determine simultaneously all the two mappings of \(f_i(x)\) for all x. This is faster than a classical apparatus, which would require at least 2 evaluations.

Our algorithm is as follows:

  • Select a function \(f_i\) and do not know any mappings of it, that is,

    $$\begin{aligned} f_i(0)=?, f_i(1)=?. \end{aligned}$$
    (21)
  • Operate \(U_{f_{i}}\otimes U_{f_{i}}\) to \(|\psi _0\rangle _{d}\otimes |\psi _0\rangle \) in giving \(|\psi _1\rangle _{id}\otimes |\psi _1\rangle _i\).

  • From \(|\psi _1\rangle _{id}\otimes |\psi _1\rangle _i\), obtain the values of all the mappings concerning the function \(f_i\).

It is very interesting to consider the Deutsch–Jozsa algorithm expanded which uses N qubits.

2.5 Relation between set-theoretic atoms and Deutsch’s algorithm expanded

$$\begin{aligned} \begin{array}{|l|l|l|} \hline A &{} 0 \,\, 1 &{} \\ \hline f0 &{} 0\,\, 0 &{} 0 \\ f1 &{} 0 \,\, 1 &{} A \\ f2 &{} 1 \,\,0 &{} A' \\ f3 &{} 1 1 &{} 1\\ \hline \end{array} \end{aligned}$$

A Boolean algebra \(F_1\)

Let us discuss the relation between set-theoretic atoms [35] and Deutsch’s algorithm expanded. This A is a subset which is constructed using the atoms f1 and f2 that are disjoint one another. For example, newly using fi as an element of a Boolean algebra \(F_1\),

$$\begin{aligned}{} & {} f0 = 0, \nonumber \\{} & {} f1 = A, \nonumber \\{} & {} f2 = A', \nonumber \\{} & {} f3 = 1. \end{aligned}$$
(22)

We can introduce a Boolean algebra \(F_1\) as a power set of the atoms. \(F_1\) is based on the value \(``1''\) of the one-variable switching functions. An atom is a function including only one \(``1''\) as its mapped value, in the two combinations of the values of A for the one-variable function.

Clearly we notice a complete matching between the Boolean algebra \(F_1\) and Deutsch’s algorithm expanded. In fact we can see that Eqs. (18) and (19) are regarded as the two atoms of the Boolean algebra \(F_1\). For example, we notice (18) OR operation with (19) is equal to (20) and all elements are derived from the two atoms.

We see that the relation between set theory based upon atoms and our result in terms of a Boolean algebra. The important point is that we obtain all the elements of \(F_1\) by means of a power set of atoms when we get the two atoms. Thus we can say that next our aim is of getting simultaneously (18) and (19). That means we get simultaneously (17)–(20) (all four patterns!). This is now possible as we discuss: We can construct very clearly the following quantum state composed on two orthogonal states:

$$\begin{aligned} (|\psi _1\rangle _{1d}\otimes |\psi _1\rangle _1)\otimes (|\psi _1\rangle _{2d}\otimes |\psi _1\rangle _2). \end{aligned}$$
(23)

And we evaluate this quantum state of obtaining all the mappings. Especially, we have a quantum algorithm for evaluating two of logical functions simultaneously [31] and then we have

$$\begin{aligned} \frac{(|\psi _1\rangle _{1d}\otimes |\psi _1\rangle _1) +i (|\psi _1\rangle _{2d}\otimes |\psi _1\rangle _2)}{\sqrt{2}}. \end{aligned}$$
(24)

In this case, we evaluate the quantum state of obtaining all the mappings.

3 Theoretically organized algorithm for quantum computers based on orthogonal states

The key of this section is to develop the algorithms of quantum computers toward the ultimate parallel processing on them. The way to do is to find out the very true ultimate parallelism, thinking of the physical quantum phenomena. The algorithm developed here is toward the full uses of the features of quantum computers. The algorithm implies the ability of such computation based upon the concept of a Boolean algebra. Finally we have the ultimate computation for today’s quantum computers.

In this section, we propose herein a novel parallel computation, even though today’s algorithm methodology for quantum computing, for all of the combinations of values in variables of a logical function. Our concern so far has been to obtain an attribute of some function. In fact such a task is only for one task problem solving. However, we could treat positively the plural evaluations of some logical function in parallel instead of testing the function for finding out its attribute. In fact, these evaluations of the function are naturally included and evaluated, in parallel, in normal quantum computing discussing a function in a Boolean algebra stemmed from atoms in it. As is naturally understandable with mathematics, quantum computing naturally meets the category of a Boolean algebra. The reason why we positively introduce a Boolean algebra here is because we have multiple evaluations of a function in quantum computing general.

3.1 Quantum algorithm for determining the \(2^2\) mappings of a function based on orthogonal states

We propose a quantum algorithm for determining the \(2^2\) mappings of a function. Suppose newly

$$\begin{aligned} f:\{0,1\}^2\rightarrow \{0,1\} \end{aligned}$$
(25)

is a function. We want to know simultaneously the \(2^2\) mappings f(0, 0), f(0, 1), f(1, 0),  and f(1, 1). Later we see a complete matching between our results and a Boolean algebra \(F_2\). In the Boolean algebra \(F_2\), the function is a two-valuable function. For example, f(xy) is the function where x and y are variables used in mapping f. In what follows, the abbreviation f(xy) stands for f(xy). We see a combination between a unitary transformation theory and logic theory.

We define the input state as follows, using an application of Deutsch’s algorithm expanded:

$$\begin{aligned} |\Psi _0\rangle ={} & {} (\frac{1}{\sqrt{2}}|00\rangle |-\rangle _x +\frac{1}{\sqrt{2}}|01\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|00\rangle |+\rangle _y +\frac{1}{\sqrt{2}}|01\rangle |+\rangle _y)\nonumber \\{} & {} (\frac{1}{\sqrt{2}}|10\rangle |-\rangle _x +\frac{1}{\sqrt{2}}|11\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|10\rangle |+\rangle _y +\frac{1}{\sqrt{2}}|11\rangle |+\rangle _y). \end{aligned}$$
(26)

From the mapping \(U_f\), we can define the following formulas:

$$\begin{aligned}{} & {} U_f|00\rangle |+\rangle _y = {\left\{ \begin{array}{ll} (i)^{f(00)}|00\rangle |+\rangle _y &{}\textrm{if}\ \ f(00)=0,\\ (i)^{f(00)}|00\rangle |-\rangle _y &{}\textrm{if}\ \ f(00)=1. \end{array}\right. } \end{aligned}$$
(27)
$$\begin{aligned}{} & {} U_f|01\rangle |+\rangle _y = {\left\{ \begin{array}{ll} (i)^{f(01)}|01\rangle |+\rangle _y &{}\textrm{if}\ \ f(01)=0,\\ (i)^{f(01)}|01\rangle |-\rangle _y &{}\textrm{if}\ \ f(01)=1. \end{array}\right. } \end{aligned}$$
(28)
$$\begin{aligned}{} & {} U_f|10\rangle |+\rangle _y = {\left\{ \begin{array}{ll} (i)^{f(10)}|10\rangle |+\rangle _y &{}\textrm{if}\ \ f(10)=0,\\ (i)^{f(10)}|10\rangle |-\rangle _y &{}\textrm{if}\ \ f(10)=1. \end{array}\right. } \end{aligned}$$
(29)
$$\begin{aligned}{} & {} U_f|11\rangle |+\rangle _y = {\left\{ \begin{array}{ll} (i)^{f(11)}|11\rangle |+\rangle _y &{}\textrm{if}\ \ f(11)=0,\\ (i)^{f(11)}|11\rangle |-\rangle _y &{}\textrm{if}\ \ f(11)=1. \end{array}\right. } \end{aligned}$$
(30)
$$\begin{aligned}{} & {} U_f|00\rangle |-\rangle _x = {\left\{ \begin{array}{ll} (-1)^{f(00)}|00\rangle |-\rangle _x &{}\textrm{if}\ \ f(00)=0,\\ (-1)^{f(00)}|00\rangle |-\rangle _x &{}\textrm{if}\ \ f(00)=1. \end{array}\right. } \end{aligned}$$
(31)
$$\begin{aligned}{} & {} U_f|01\rangle |-\rangle _x = {\left\{ \begin{array}{ll} (-1)^{f(01)}|01\rangle |-\rangle _x &{}\textrm{if}\ \ f(01)=0,\\ (-1)^{f(01)}|01\rangle |-\rangle _x &{}\textrm{if}\ \ f(01)=1. \end{array}\right. } \end{aligned}$$
(32)
$$\begin{aligned}{} & {} U_f|10\rangle |-\rangle _x = {\left\{ \begin{array}{ll} (-1)^{f(10)}|10\rangle |-\rangle _x &{}\textrm{if}\ \ f(10)=0,\\ (-1)^{f(10)}|10\rangle |-\rangle _x &{}\textrm{if}\ \ f(10)=1. \end{array}\right. } \end{aligned}$$
(33)
$$\begin{aligned}{} & {} U_f|11\rangle |-\rangle _x = {\left\{ \begin{array}{ll} (-1)^{f(11)}|11\rangle |-\rangle _x &{}\textrm{if}\ \ f(11)=0,\\ (-1)^{f(11)}|11\rangle |-\rangle _x &{}\textrm{if}\ \ f(11)=1. \end{array}\right. } \end{aligned}$$
(34)

Applying \(U_{f_{i}}U_{f_{i}}U_{f_{i}}U_{f_{i}}, (i=0,1,2,...,2^{2^2}-1)\) to \(|\Psi _0\rangle \), \(U_{f_{i}}U_{f_{i}}U_{f_{i}}U_{f_{i}} |\Psi _0\rangle =|\Psi _1\rangle _i\), therefore leaves us with one of \(2^{2^2}\) cases:

$$\begin{aligned} |\Psi _1\rangle _0={} & {} (\frac{1}{\sqrt{2}}|00\rangle |-\rangle _x +\frac{1}{\sqrt{2}}|01\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|00\rangle |+\rangle _y +\frac{1}{\sqrt{2}}|01\rangle |+\rangle _y)\nonumber \\{} & {} (\frac{1}{\sqrt{2}}|10\rangle |-\rangle _x +\frac{1}{\sqrt{2}}|11\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|10\rangle |+\rangle _y +\frac{1}{\sqrt{2}}|11\rangle |+\rangle _y)\nonumber \\{} & {} \textrm{iff}\ \ f_0(00)=0, f_0(01)=0, f_0(10)=0, f_0(11)=0, \end{aligned}$$
(35)
$$\begin{aligned} |\Psi _1\rangle _1={} & {} (\frac{1}{\sqrt{2}}|00\rangle |-\rangle _x +\frac{1}{\sqrt{2}}|01\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|00\rangle |+\rangle _y +\frac{1}{\sqrt{2}}|01\rangle |+\rangle _y)\nonumber \\{} & {} (\frac{1}{\sqrt{2}}|10\rangle |-\rangle _x -\frac{1}{\sqrt{2}}|11\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|10\rangle |+\rangle _y +i\frac{1}{\sqrt{2}}|11\rangle |-\rangle _y)\nonumber \\{} & {} \textrm{iff}\ \ f_1(00)=0, f_1(01)=0, f_1(10)=0, f_1(11)=1, \end{aligned}$$
(36)
$$\begin{aligned} |\Psi _1\rangle _2={} & {} (\frac{1}{\sqrt{2}}|00\rangle |-\rangle _x +\frac{1}{\sqrt{2}}|01\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|00\rangle |+\rangle _y +\frac{1}{\sqrt{2}}|01\rangle |+\rangle _y)\nonumber \\{} & {} (-\frac{1}{\sqrt{2}}|10\rangle |-\rangle _x +\frac{1}{\sqrt{2}}|11\rangle |-\rangle _x) (i\frac{1}{\sqrt{2}}|10\rangle |-\rangle _y +\frac{1}{\sqrt{2}}|11\rangle |+\rangle _y)\nonumber \\{} & {} \textrm{iff}\ \ f_2(00)=0, f_2(01)=0, f_2(10)=1, f_2(11)=0, \end{aligned}$$
(37)
$$\begin{aligned} |\Psi _1\rangle _3={} & {} (\frac{1}{\sqrt{2}}|00\rangle |-\rangle _x +\frac{1}{\sqrt{2}}|01\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|00\rangle |+\rangle _y +\frac{1}{\sqrt{2}}|01\rangle |+\rangle _y)\nonumber \\{} & {} (-\frac{1}{\sqrt{2}}|10\rangle |-\rangle _x -\frac{1}{\sqrt{2}}|11\rangle |-\rangle _x) (i\frac{1}{\sqrt{2}}|10\rangle |-\rangle _y +i\frac{1}{\sqrt{2}}|11\rangle |-\rangle _y)\nonumber \\{} & {} \textrm{iff}\ \ f_3(00)=0, f_3(01)=0, f_3(10)=1, f_3(11)=1, \end{aligned}$$
(38)
$$\begin{aligned} |\Psi _1\rangle _4={} & {} (\frac{1}{\sqrt{2}}|00\rangle |-\rangle _x -\frac{1}{\sqrt{2}}|01\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|00\rangle |+\rangle _y +i\frac{1}{\sqrt{2}}|01\rangle |-\rangle _y)\nonumber \\{} & {} (\frac{1}{\sqrt{2}}|10\rangle |-\rangle _x +\frac{1}{\sqrt{2}}|11\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|10\rangle |+\rangle _y +\frac{1}{\sqrt{2}}|11\rangle |+\rangle _y)\nonumber \\{} & {} \textrm{iff}\ \ f_4(00)=0, f_4(01)=1, f_4(10)=0, f_4(11)=0, \end{aligned}$$
(39)
$$\begin{aligned} |\Psi _1\rangle _5={} & {} (\frac{1}{\sqrt{2}}|00\rangle |-\rangle _x -\frac{1}{\sqrt{2}}|01\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|00\rangle |+\rangle _y +i\frac{1}{\sqrt{2}}|01\rangle |-\rangle _y)\nonumber \\{} & {} (\frac{1}{\sqrt{2}}|10\rangle |-\rangle _x -\frac{1}{\sqrt{2}}|11\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|10\rangle |+\rangle _y +i\frac{1}{\sqrt{2}}|11\rangle |-\rangle _y)\nonumber \\{} & {} \textrm{iff}\ \ f_5(00)=0, f_5(01)=1, f_5(10)=0, f_5(11)=1, \end{aligned}$$
(40)
$$\begin{aligned} |\Psi _1\rangle _6={} & {} (\frac{1}{\sqrt{2}}|00\rangle |-\rangle _x -\frac{1}{\sqrt{2}}|01\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|00\rangle |+\rangle _y +i\frac{1}{\sqrt{2}}|01\rangle |-\rangle _y)\nonumber \\{} & {} (-\frac{1}{\sqrt{2}}|10\rangle |-\rangle _x +\frac{1}{\sqrt{2}}|11\rangle |-\rangle _x) (i\frac{1}{\sqrt{2}}|10\rangle |-\rangle _y +\frac{1}{\sqrt{2}}|11\rangle |+\rangle _y)\nonumber \\{} & {} \textrm{iff}\ \ f_6(00)=0, f_6(01)=1, f_6(10)=1, f_6(11)=0, \end{aligned}$$
(41)
$$\begin{aligned} |\Psi _1\rangle _7={} & {} (\frac{1}{\sqrt{2}}|00\rangle |-\rangle _x -\frac{1}{\sqrt{2}}|01\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|00\rangle |+\rangle _y +i\frac{1}{\sqrt{2}}|01\rangle |-\rangle _y)\nonumber \\{} & {} (-\frac{1}{\sqrt{2}}|10\rangle |-\rangle _x -\frac{1}{\sqrt{2}}|11\rangle |-\rangle _x) (i\frac{1}{\sqrt{2}}|10\rangle |-\rangle _y +i\frac{1}{\sqrt{2}}|11\rangle |-\rangle _y)\nonumber \\{} & {} \textrm{iff}\ \ f_7(00)=0, f_7(01)=1, f_7(10)=1, f_7(11)=1, \end{aligned}$$
(42)
$$\begin{aligned} |\Psi _1\rangle _8={} & {} (-\frac{1}{\sqrt{2}}|00\rangle |-\rangle _x +\frac{1}{\sqrt{2}}|01\rangle |-\rangle _x) (i\frac{1}{\sqrt{2}}|00\rangle |-\rangle _y +\frac{1}{\sqrt{2}}|01\rangle |+\rangle _y)\nonumber \\{} & {} (\frac{1}{\sqrt{2}}|10\rangle |-\rangle _x +\frac{1}{\sqrt{2}}|11\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|10\rangle |+\rangle _y +\frac{1}{\sqrt{2}}|11\rangle |+\rangle _y)\nonumber \\{} & {} \textrm{iff}\ \ f_8(00)=1, f_8(01)=0, f_8(10)=0, f_8(11)=0, \end{aligned}$$
(43)
$$\begin{aligned} |\Psi _1\rangle _9={} & {} (-\frac{1}{\sqrt{2}}|00\rangle |-\rangle _x +\frac{1}{\sqrt{2}}|01\rangle |-\rangle _x) (i\frac{1}{\sqrt{2}}|00\rangle |-\rangle _y +\frac{1}{\sqrt{2}}|01\rangle |+\rangle _y)\nonumber \\{} & {} (\frac{1}{\sqrt{2}}|10\rangle |-\rangle _x -\frac{1}{\sqrt{2}}|11\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|10\rangle |+\rangle _y +i\frac{1}{\sqrt{2}}|11\rangle |-\rangle _y)\nonumber \\{} & {} \textrm{iff}\ \ f_9(00)=1, f_9(01)=0, f_9(10)=0, f_9(11)=1, \end{aligned}$$
(44)
$$\begin{aligned} |\Psi _1\rangle _{10}={} & {} (-\frac{1}{\sqrt{2}}|00\rangle |-\rangle _x +\frac{1}{\sqrt{2}}|01\rangle |-\rangle _x) (i\frac{1}{\sqrt{2}}|00\rangle |-\rangle _y +\frac{1}{\sqrt{2}}|01\rangle |+\rangle _y)\nonumber \\{} & {} (-\frac{1}{\sqrt{2}}|10\rangle |-\rangle _x +\frac{1}{\sqrt{2}}|11\rangle |-\rangle _x) (i\frac{1}{\sqrt{2}}|10\rangle |-\rangle _y +\frac{1}{\sqrt{2}}|11\rangle |+\rangle _y)\nonumber \\{} & {} \textrm{iff}\ \ f_{10}(00)=1, f_{10}(01)=0, f_{10}(10)=1, f_{10}(11)=0, \end{aligned}$$
(45)
$$\begin{aligned} |\Psi _1\rangle _{11}={} & {} (-\frac{1}{\sqrt{2}}|00\rangle |-\rangle _x +\frac{1}{\sqrt{2}}|01\rangle |-\rangle _x) (i\frac{1}{\sqrt{2}}|00\rangle |-\rangle _y +\frac{1}{\sqrt{2}}|01\rangle |+\rangle _y)\nonumber \\{} & {} (-\frac{1}{\sqrt{2}}|10\rangle |-\rangle _x -\frac{1}{\sqrt{2}}|11\rangle |-\rangle _x) (i\frac{1}{\sqrt{2}}|10\rangle |-\rangle _y +i\frac{1}{\sqrt{2}}|11\rangle |-\rangle _y)\nonumber \\{} & {} \textrm{iff}\ \ f_{11}(00)=1, f_{11}(01)=0, f_{11}(10)=1, f_{11}(11)=1, \end{aligned}$$
(46)
$$\begin{aligned} |\Psi _1\rangle _{12}={} & {} (-\frac{1}{\sqrt{2}}|00\rangle |-\rangle _x -\frac{1}{\sqrt{2}}|01\rangle |-\rangle _x) (i\frac{1}{\sqrt{2}}|00\rangle |-\rangle _y +i\frac{1}{\sqrt{2}}|01\rangle |-\rangle _y)\nonumber \\{} & {} (\frac{1}{\sqrt{2}}|10\rangle |-\rangle _x +\frac{1}{\sqrt{2}}|11\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|10\rangle |+\rangle _y +\frac{1}{\sqrt{2}}|11\rangle |+\rangle _y)\nonumber \\{} & {} \textrm{iff}\ \ f_{12}(00)=1, f_{12}(01)=1, f_{12}(10)=0, f_{12}(11)=0, \end{aligned}$$
(47)
$$\begin{aligned} |\Psi _1\rangle _{13}={} & {} (-\frac{1}{\sqrt{2}}|00\rangle |-\rangle _x -\frac{1}{\sqrt{2}}|01\rangle |-\rangle _x) (i\frac{1}{\sqrt{2}}|00\rangle |-\rangle _y +i\frac{1}{\sqrt{2}}|01\rangle |-\rangle _y)\nonumber \\{} & {} (\frac{1}{\sqrt{2}}|10\rangle |-\rangle _x -\frac{1}{\sqrt{2}}|11\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|10\rangle |+\rangle _y +i\frac{1}{\sqrt{2}}|11\rangle |-\rangle _y)\nonumber \\{} & {} \textrm{iff}\ \ f_{13}(00)=1, f_{13}(01)=1, f_{13}(10)=0, f_{13}(11)=1, \end{aligned}$$
(48)
$$\begin{aligned} |\Psi _1\rangle _{14}={} & {} (-\frac{1}{\sqrt{2}}|00\rangle |-\rangle _x -\frac{1}{\sqrt{2}}|01\rangle |-\rangle _x) (i\frac{1}{\sqrt{2}}|00\rangle |-\rangle _y +i\frac{1}{\sqrt{2}}|01\rangle |-\rangle _y)\nonumber \\{} & {} (-\frac{1}{\sqrt{2}}|10\rangle |-\rangle _x +\frac{1}{\sqrt{2}}|11\rangle |-\rangle _x) (i\frac{1}{\sqrt{2}}|10\rangle |-\rangle _y +\frac{1}{\sqrt{2}}|11\rangle |+\rangle _y)\nonumber \\{} & {} \textrm{iff}\ \ f_{14}(00)=1, f_{14}(01)=1, f_{14}(10)=1, f_{14}(11)=0, \end{aligned}$$
(49)
$$\begin{aligned} |\Psi _1\rangle _{15}={} & {} (-\frac{1}{\sqrt{2}}|00\rangle |-\rangle _x -\frac{1}{\sqrt{2}}|01\rangle |-\rangle _x) (i\frac{1}{\sqrt{2}}|00\rangle |-\rangle _y +i\frac{1}{\sqrt{2}}|01\rangle |-\rangle _y)\nonumber \\{} & {} (-\frac{1}{\sqrt{2}}|10\rangle |-\rangle _x -\frac{1}{\sqrt{2}}|11\rangle |-\rangle _x) (i\frac{1}{\sqrt{2}}|10\rangle |-\rangle _y +i\frac{1}{\sqrt{2}}|11\rangle |-\rangle _y)\nonumber \\{} & {} \textrm{iff}\ \ f_{15}(00)=1, f_{15}(01)=1, f_{15}(10)=1, f_{15}(11)=1. \end{aligned}$$
(50)

Thus, by measuring \(|\psi _1\rangle _i\), we may determine simultaneously all the \(2^2\) mappings of \(f_i(x,y)\) for all x and y. This is faster than a classical apparatus, which would require at least \(2^2\) evaluations.

Later we discuss the relation between set theory [35] based upon atoms and our results in terms of a Boolean algebra. Especially the result reveals a complete matching between quantum computing and a Boolean algebra. As is naturally understandable with mathematics, quantum computing belongs to the category of a Boolean algebra. We positively mention that the fundamental structures of quantum computing and von Neumann architecture are the same in terms of the category of a Boolean algebra. However, the main different is based on parallelism for determining all the mappings used especially in quantum computing.

3.2 Example using a logical function

Let us consider the case where \(i=1\). The logical function is as follows [35]:

$$\begin{aligned} f_1(x,y)=A\wedge B, \end{aligned}$$
(51)

where x and y are variables used in mapping f. \(x(=0,1)\) is variable for A. \(y(=0,1)\) is variable for B. We want to evaluate simultaneously all the mappings:

$$\begin{aligned} f_1(0,0), f_1(0,1), f_1(1,0), f_1(1,1). \end{aligned}$$
(52)

In classical case we require \(2^{2}\) evaluations. In quantum case, we require just one query.

The input state is as follows:

$$\begin{aligned} |\Psi _0\rangle ={} & {} (\frac{1}{\sqrt{2}}|00\rangle |-\rangle _x +\frac{1}{\sqrt{2}}|01\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|00\rangle |+\rangle _y +\frac{1}{\sqrt{2}}|01\rangle |+\rangle _y)\nonumber \\{} & {} (\frac{1}{\sqrt{2}}|10\rangle |-\rangle _x +\frac{1}{\sqrt{2}}|11\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|10\rangle |+\rangle _y +\frac{1}{\sqrt{2}}|11\rangle |+\rangle _y). \end{aligned}$$
(53)

Applying \(U_{f_{1}}U_{f_{1}}U_{f_{1}}U_{f_{1}}\) to \(|\Psi _0\rangle \), \(U_{f_{1}}U_{f_{1}}U_{f_{1}}U_{f_{1}}|\Psi _0\rangle =|\Psi _1\rangle _1\), we have the following output state:

$$\begin{aligned} |\Psi _1\rangle _1={} & {} (\frac{1}{\sqrt{2}}|00\rangle |-\rangle _x +\frac{1}{\sqrt{2}}|01\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|00\rangle |+\rangle _y +\frac{1}{\sqrt{2}}|01\rangle |+\rangle _y)\nonumber \\{} & {} (\frac{1}{\sqrt{2}}|10\rangle |-\rangle _x -\frac{1}{\sqrt{2}}|11\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|10\rangle |+\rangle _y +i\frac{1}{\sqrt{2}}|11\rangle |-\rangle _y). \end{aligned}$$
(54)

Therefore, we evaluate simultaneously all the mappings of \(f_{1}(x,y)\):

$$\begin{aligned} f_1(0,0)=0, f_1(0,1)=0, f_1(1,0)=0, f_1(1,1)=1. \end{aligned}$$
(55)

This is faster than a classical apparatus, which would require at least \(2^{2}\) evaluations. Likewise, we can evaluate the sixteen functions in a Boolean algebra \(F_2\).

3.3 Relation between set-theoretic atoms and the result in Sect. 3

Let us discuss the relation between set-theoretic atoms [35] and the result in Sect. 3. These A and B are subsets which are constructed using the atoms f1 through f4 that are disjoint one another. For example, newly using fi as an element of a Boolean algebra \(F_2\),

$$\begin{aligned}{} & {} A = f1 \vee f3 = \{f1, f3\},\nonumber \\{} & {} B = f1 \vee f2 = \{f1, f2\}, \end{aligned}$$
(56)

where,

$$\begin{aligned}{} & {} f1 = A \wedge B,\nonumber \\{} & {} f2 = A' \wedge B,\nonumber \\{} & {} f3 = A \wedge B',\nonumber \\{} & {} f4 = A' \wedge B'. \end{aligned}$$
(57)

We can introduce a Boolean algebra \(F_2\) as a power set of the atoms. \(F_2\) is based on the value \(``1''\) of the two-variable switching functions. An atom is a function including only one \(``1''\) as its mapped value, in the four combinations of the values of A and B for the two-variable function.

Clearly we notice a complete matching between the Boolean algebra \(F_2\) and our result in Sect. 3. In fact, we can see that Eqs. (36), (37), (39), and (43) are regarded as the four atoms of the Boolean algebra \(F_2\). For example, we notice (36) OR operation with (37) is equal to (38) and all elements are derived from the four atoms.

We see that the relation between set theory based upon atoms and our result in terms of a Boolean algebra. The important point is that we obtain all the elements of \(F_2\) by means of a power set of atoms when we get the four atoms. Thus, we can say that next our aim is of getting simultaneously (36), (37), (39), and (43). That means we get simultaneously (35)–(50) (all sixteen patterns!). This is now possible as we discuss: We can construct very clearly the following quantum state composed on four orthogonal states:

$$\begin{aligned} |\Psi _1\rangle _1\otimes |\Psi _1\rangle _2\otimes |\Psi _1\rangle _4\otimes |\Psi _1\rangle _8. \end{aligned}$$
(58)

And we evaluate this quantum state of obtaining all the mappings. Especially, we have a quantum algorithm for evaluating two of logical functions simultaneously [31] and then we have

$$\begin{aligned} \frac{|\Psi _1\rangle _1 +i |\Psi _1\rangle _2}{\sqrt{2}}\otimes \frac{|\Psi _1\rangle _4 +i |\Psi _1\rangle _8}{\sqrt{2}}. \end{aligned}$$
(59)

In this case, we evaluate the quantum state of obtaining all the mappings.

We positively stress that the fundamental structures of quantum computing and von Neumann architecture are the same in terms of the category of a Boolean algebra. However, the main different is based on parallelism for determining all the mappings used especially in quantum computing. We hope our discussions conclude the very true ultimate importance of the quantum parallelism to construct quantum computers beyond von Neumann architecture.

4 Toward practically mathematical evaluations

From (36), we have

$$\begin{aligned} |\Psi _1\rangle _1={} & {} (\frac{1}{\sqrt{2}}|00\rangle |-\rangle _x +\frac{1}{\sqrt{2}}|01\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|00\rangle |+\rangle _y +\frac{1}{\sqrt{2}}|01\rangle |+\rangle _y)\nonumber \\{} & {} (\frac{1}{\sqrt{2}}|10\rangle |-\rangle _x -\frac{1}{\sqrt{2}}|11\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|10\rangle |+\rangle _y +i\frac{1}{\sqrt{2}}|11\rangle |-\rangle _y) \nonumber \\{} & {} \textrm{iff}\ \ f_1(00)=0, f_1(01)=0, f_1(10)=0, f_1(11)=1. \end{aligned}$$
(60)

Hence, we evaluate the mappings of the logical function [35]:

$$\begin{aligned} f_1(x, y) = A\wedge B. \end{aligned}$$
(61)

From (41), we have

$$\begin{aligned} |\Psi _1\rangle _6={} & {} (\frac{1}{\sqrt{2}}|00\rangle |-\rangle _x -\frac{1}{\sqrt{2}}|01\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|00\rangle |+\rangle _y +i\frac{1}{\sqrt{2}}|01\rangle |-\rangle _y)\nonumber \\{} & {} (-\frac{1}{\sqrt{2}}|10\rangle |-\rangle _x +\frac{1}{\sqrt{2}}|11\rangle |-\rangle _x) (i\frac{1}{\sqrt{2}}|10\rangle |-\rangle _y +\frac{1}{\sqrt{2}}|11\rangle |+\rangle _y) \nonumber \\{} & {} \textrm{iff}\ \ f_6(00)=0, f_6(01)=1, f_6(10)=1, f_6(11)=0. \end{aligned}$$
(62)

Hence, we evaluate the mappings of the logical function [35]:

$$\begin{aligned} f_6(x, y) = \mathrm{Exclusive\ OR}(A,B). \end{aligned}$$
(63)

From (42), we have

$$\begin{aligned} |\Psi _1\rangle _7={} & {} (\frac{1}{\sqrt{2}}|00\rangle |-\rangle _x -\frac{1}{\sqrt{2}}|01\rangle |-\rangle _x) (\frac{1}{\sqrt{2}}|00\rangle |+\rangle _y +i\frac{1}{\sqrt{2}}|01\rangle |-\rangle _y)\nonumber \\{} & {} (-\frac{1}{\sqrt{2}}|10\rangle |-\rangle _x -\frac{1}{\sqrt{2}}|11\rangle |-\rangle _x) (i\frac{1}{\sqrt{2}}|10\rangle |-\rangle _y +i\frac{1}{\sqrt{2}}|11\rangle |-\rangle _y)\nonumber \\{} & {} \textrm{iff}\ \ f_7(00)=0, f_7(01)=1, f_7(10)=1, f_7(11)=1. \end{aligned}$$
(64)

Hence, we evaluate the mappings of the logical function [35]:

$$\begin{aligned} f_7(x, y) = A \vee B. \end{aligned}$$
(65)

We have studied quantum operations based upon the quantum mechanics. First, we have used Deutsch’s algorithm with the usual phase kickback formation to develop the very true overbridging between usual quantum mechanics (and then quantum computing) and a Boolean algebra. In this, we have confirmed that usual quantum operations are useful, beyond the quantum computing only for quantum mechanics operations, for very true mathematical evaluations just like an arithmetic operation. We demonstrate two typical arithmetic calculations in the binary system.

As an example of a simple addition \(1+1\) in the binary system, we are going to develop the process of how to calculate this:

To solve it, fortunately we have a formula here

$$\begin{aligned}{} & {} f_6(x, y) = \mathrm{Exclusive\ OR}(A,B).\end{aligned}$$
(66)
$$\begin{aligned}{} & {} f_1(x, y) = A\wedge B. \end{aligned}$$
(67)
$$\begin{aligned}{} & {} 1+1 =??.\end{aligned}$$
(68)
$$\begin{aligned}{} & {} \textrm{Sum} = \mathrm{Exclusive\ OR}(1,1) = 0.\end{aligned}$$
(69)
$$\begin{aligned}{} & {} \textrm{Carry} = 1 \wedge 1 = 1. \end{aligned}$$
(70)

Hence, we have very clearly

$$\begin{aligned} 1 + 1 = 10 \end{aligned}$$
(71)

according to the algorithm for addition in the binary system. The concrete and specific calculation (\(1+1\)) is faster than that of a classical apparatus which would require \(4^2=16\) steps when we introduce only the half adder operation.

In more details, we must use the rule of a half adder that is composed of using some formulae in the Boolean algebra [35]. In the half adder, the function of it is the SUM and a Carry to the next digit position. The circuit consists of two Boolean functions (69) and (70).

Further, we could mention a little bit complicated example

\(2 + 3\) in the decimal system.

In addition of the half adder operation, we need one more operation the full adder [35]. As for the full adder, it is by the two half adders and the “OR” operation \(A \vee B\) \((A, B \in \{0, 1\})\) in the Boolean algebra to take out the result from the previous digit. The operation is left here because it is obvious mathematically. Anyhow we can obtain the result 5 in the decimal system.

To solve it, fortunately we have a formula here

$$\begin{aligned}{} & {} f_6(x, y) = \mathrm{Exclusive\ OR}(A,B).\end{aligned}$$
(72)
$$\begin{aligned}{} & {} f_1(x, y) = A\wedge B.\end{aligned}$$
(73)
$$\begin{aligned}{} & {} f_7(x, y) = A\vee B. \end{aligned}$$
(74)
$$\begin{aligned}{} & {} 10+11 =???.\end{aligned}$$
(75)
$$\begin{aligned}{} & {} \textrm{Sum} = \mathrm{Exclusive\ OR}(0,1) = 1.\end{aligned}$$
(76)
$$\begin{aligned}{} & {} \textrm{Carry} = 0 \wedge 1 = 0. \end{aligned}$$
(77)

Thus, we have

$$\begin{aligned}{} & {} 10+11 =??1. \end{aligned}$$
(78)

Also we see

$$\begin{aligned}{} & {} \mathrm{Carry\ C_i} = 0. \end{aligned}$$
(79)

Our second aim is of calculating \(1+1\) considering \(\mathrm{Carry\ C_i} = 0\) using a full adder. The first half adder says

$$\begin{aligned}{} & {} \mathrm{Exclusive\ OR}(1,1) = 0.\end{aligned}$$
(80)
$$\begin{aligned}{} & {} \textrm{Carry}=1 \wedge 1 =1. \end{aligned}$$
(81)

The second half adder says

$$\begin{aligned}{} & {} \textrm{Sum} = \mathrm{Exclusive\ OR} (\mathrm{Carry\ C_i},\mathrm{Exclusive\ OR}(1,1)) = 0.\end{aligned}$$
(82)
$$\begin{aligned}{} & {} \textrm{Carry}=\mathrm{Carry\ C_i} \wedge \mathrm{Exclusive\ OR}(1,1)=0. \end{aligned}$$
(83)

Thus, we see \(10+11 =?01\). We have finally the carry \(\mathrm{Carry\ C_0}\) as follows: (This is (81) \(\vee \) (83)).

$$\begin{aligned}{} & {} \mathrm{Carry\ C_0}=0 \vee 1=1. \end{aligned}$$
(84)

Hence, we have very clearly

$$\begin{aligned} 10 + 11 = 101 \end{aligned}$$
(85)

according to the algorithm for addition in the binary system. The concrete and specific calculation (\(2+3\)) is faster than that of a classical apparatus which would require \(4^3=64\) steps when we introduce the full adder operation. The quantum advantage increases when two numbers we treat become very large. Toward practical quantum-gated computers, experimental demonstrations of our argumentations are going to be interested.

5 Conclusions

In conclusion, we have expanded Deutsch’s algorithm for determining all the mappings of a function using four orthogonal states. Using this, we have proposed a parallel computation for all of the combinations of values in variables of a logical function using sixteen orthogonal states. As an application of our algorithm, we have demonstrated two typical arithmetic calculations in the binary system. We have studied an efficiency for operating a full adder/half adder by quantum-gated computing. The two typical arithmetic calculations have been \((1+1)\) and \((2+3)\). The typical arithmetic calculation \((2+3)\) has been faster than that of its classical apparatus which would require \(4^3=64\) steps when we introduce the full adder operation. Another typical arithmetic calculation \((1+1)\) has been faster than that of its classical apparatus which would require \(4^2=16\) steps when we introduce only the half adder operation.