1 Introduction

The double-slit experiment [1, 2] is an illustration of the wave-particle duality. The wave-particle duality is difficult to understand. We assume quantum is “energy”. Waves have energy. Particles have energy. So we may summarize the wave-particle duality is an appearance of energy. Let us consider the double-slit experiment by means of the energy interpretation. First a source emits a photon. It should be a particle. In fact it is energy. And we see interference fringes characteristic of waves. In fact it is the distribution of energy.

In the double-slit experiment, a beam of energy travels through a barrier with two slits removed. If one puts a detector screen on the other side, the pattern of detected energy shows interference fringes characteristic of waves; The detector screen responds to particles (energy). The system exhibits the behavior that both waves (interference patterns) and particles (dots on the screen) can be interpreted as energy.

In the energy interpretation, a quantum state is the distribution of energy. So quantum measurement theory would imply that we investigate the distribution of energy. The conjecture leads us to creating very true quantum algorithms.

Looking at studies of quantum computing, implementation of a quantum algorithm to solve Deutsch’s problem [3,4,5] on a nuclear magnetic resonance quantum computer is reported firstly [6]. An implementation of the Deutsch-Jozsa algorithm on an ion-trap quantum computer is also reported [7]. There are several attempts to use single-photon two-qubit states for quantum computing. Oliveira et al. implements Deutsch’s algorithm with polarization and transverse spatial modes of the electromagnetic field as qubits [8]. Also the decoherence-free implementation of Deutsch’s algorithm is introduced by using such single-photon and by using two logical qubits [9]. A one-way based experimental implementation of Deutsch’s algorithm is reported [10].

For a number of recent algorithmic developments we mention the following. In 1993, the Bernstein-Vazirani algorithm was published [11, 12]. The work can be considered an extension of the Deutsch-Jozsa algorithm. In 1994, Simon’s algorithm was published [13]. Implementation of a quantum algorithm to solve the Bernstein-Vazirani parity problem without entanglement in an ensemble quantum computer can be mentioned as an important quantum algorithm [14]. Fiber-optics implementation of the Deutsch-Jozsa and Bernstein-Vazirani quantum algorithms with three qubits was also discussed in the recent past [15]. The question whether or not quantum learning is robust against noise is a subject of intense study [16].

A quantum algorithm for approximating the influences of Boolean functions and its applications is recently studied [17]. In addition, quantum computation with coherent spin states and the close Hadamard problem [18] and the transport implementation of the Bernstein-Vazirani algorithm with ion qubits are studied [19]. Quantum Gauss-Jordan elimination and simulation of accounting principles on quantum computers are discussed [20]. We mention that the dynamical analysis of Grover’s search algorithm in arbitrarily high-dimensional search spaces is studied [21]. A method of computing many functions simultaneously by using many parallel quantum systems is reported [22].

We may wonder if we need all the previously mentioned studies to reach a good quantum computer. The earliest quantum algorithm, the Deutsch-Jozsa algorithm, is representative to show that quantum computation is faster than its classical counterpart. Its magnitude grows exponentially with the number of qubits. In 2015, it was discussed that the Deutsch-Jozsa algorithm can be used for quantum key distribution [23]. In 2017, it was discussed that secure quantum key distribution based on Deutsch’s algorithm using an entangled state [24]. Subsequently, a highly speedy secure quantum cryptography based on the Deutsch-Jozsa algorithm was proposed [25]. The relation between quantum computer and secret sharing with the use of quantum principles is discussed [26].

It can be stated that quantum computers presently are ˆˆ ˆˆ quantum estimators”. There are many open problems that we cannot solve them by using quantum estimators. By a case, quantum estimators cannot solve a problem that classical computers can solve correctly. Therefore, we need more rigorous quantum devices for computation of solving such a problem. Motivated by this conjecture, let us discuss the arbitrary high-dimensional quantum computer. And we solve very wide problem by using a new quantum device proposed here. It is first step to a true quantum computer.

In this paper, we discuss an interpretation of quantum mechanics. We assume that quantum is energy. We discuss an algorithm by means of the energy interpretation. We present a method for fast determining a homogeneous linear function f(x) := s.x = s 1 x 1 + s 2 x 2 + ⋯ + s N x N . Here x = (x 1, … , x N ), x j R and the coefficients s = (s 1, … , s N ), s j N. Given the interpolation values \((f(1), f(2),...,f(N))=\vec {y}\), we shall determine the unknown coefficients \(s = (s_{1}(\vec {y}),\dots , s_{N}(\vec {y}))\) of the linear function, simultaneously. The speed of determining the values is shown to outperform the classical case by a factor of N. Our method is based on the generalized Bernstein-Vazirani algorithm [27] to qudit systems [28]. Next, by using M parallel quantum systems, we have M homogeneous linear functions, simultaneously. The speed of obtaining the set of M homogeneous linear functions is shown to outperform the classical case by a factor of N × M.

2 The Generalized Algorithm of Computing Many Functions

In this section, we propose a new algorithm to solve the generalized Bernstein-Vazirani problem in the modulo d [27, 28]. Our algorithm combines quantum parallelism with a property of quantum mechanics known as interference. Here the problem changes to finding N unknown values of N functions by a query

$$\begin{array}{@{}rcl@{}} s_{1}(\vec{y}),s_{2}(\vec{y}),...,s_{N}(\vec{y}), \end{array} $$
(1)

where \(\vec {y}\) is a real vector, \(s_{j}(\vec {y})\in \{0,1,...,d-1\}\), and we define

$$\begin{array}{@{}rcl@{}} s(\vec{y})=(s_{1}(\vec{y})s_{2}(\vec{y})...s_{N}(\vec{y})). \end{array} $$
(2)

Here \(s(\vec {y})\in \{0,1,...,d-1\}^{N}\).

We define \(f_{s(\vec {y})}(x)\) as follows;

$$\begin{array}{@{}rcl@{}} f_{s(\vec{y})}(x)=s(\vec{y})\cdot x\ \text{mod}\ d =s_{1}(\vec{y})x_{1}+ s_{2}(\vec{y})x_{2}+\dots+s_{N}(\vec{y})x_{N}\ \text{mod}\ d, \end{array} $$
(3)

where x = (x 1, … , x N ) ∈ {0, 1, ... , d −  1}N.

Let us follow the quantum states through the algorithm. The input state is;

$$\begin{array}{@{}rcl@{}} |\psi_{0}\rangle=|0\rangle^{\otimes N}|d-1\rangle. \end{array} $$
(4)

Subsequently let us define the wave function |ϕ〉 as follows;

$$\begin{array}{@{}rcl@{}} |\phi\rangle=\frac{1}{\sqrt{d}}(\omega^{d}|0\rangle +\omega^{d-1}|1\rangle +\cdots +\omega|d-1\rangle), \end{array} $$
(5)

where ω = e 2πi/d. In the following, we discuss the Fourier transform of |d −  1〉;

$$\begin{array}{@{}rcl@{}} |d-1\rangle \rightarrow \sum\limits_{z = 0}^{d-1}\frac{\omega^{z\cdot (d-1)}|z\rangle}{\sqrt{d}} =\sum\limits_{z = 0}^{d-1}\frac{\omega^{zd-z}|z\rangle}{\sqrt{d}} =\sum\limits_{z = 0}^{d-1}\frac{\omega^{d-z}|z\rangle}{\sqrt{d}}=|\phi\rangle. \end{array} $$
(6)

After the componentwise Fourier transforms on the state (4), we have

$$\begin{array}{@{}rcl@{}} |\psi_{1}\rangle=\sum\limits_{|x|= 0}^{d^{N}-1}\frac{|x\rangle}{\sqrt{d^{N}}} \frac{1}{\sqrt{d}}(\omega^{d}|0\rangle +\omega^{d-1}|1\rangle +\cdots +\omega|d-1\rangle). \end{array} $$
(7)

We introduce \(SUM_{f_{s(\vec {y})}(x)}\) gate;

$$\begin{array}{@{}rcl@{}} |x\rangle|j\rangle \rightarrow |x\rangle|(f_{s(\vec{y})}(x)+j)\ \text{mod}\ d\rangle. \end{array} $$
(8)

Here,

$$\begin{array}{@{}rcl@{}} f_{s(\vec{y})}(x)=s(\vec{y})\cdot x\ \text{mod}\ d. \end{array} $$
(9)

We have

$$\begin{array}{@{}rcl@{}} SUM_{s(\vec{y})\cdot x}|x\rangle|\phi\rangle=\omega^{s(\vec{y})\cdot x}|x\rangle|\phi\rangle. \end{array} $$
(10)

In what follows, we discuss the reason of the above relation (10).

Now consider applying the SUM gate to the state |x〉|ϕ〉. Each term in |ϕ〉 is of the form ω dj|j〉. We see

$$\begin{array}{@{}rcl@{}} SUM\omega^{d-j}|x\rangle|j\rangle \rightarrow\omega^{d-j}|x\rangle|(j+s(\vec{y})\cdot x)\ \text{mod}\ d\rangle. \end{array} $$
(11)

We introduce k such as \(s(\vec {y})\cdot x+j=k\Rightarrow d-j=d+s(\vec {y})\cdot x-k\).

Hence (11) becomes,

$$\begin{array}{@{}rcl@{}} SUM\omega^{d-j}|x\rangle|j\rangle \rightarrow\omega^{s(\vec{y})\cdot x}\omega^{d-k}|x\rangle|k\ \text{mod}\ d\rangle. \end{array} $$
(12)

Now, when k < d we have |k mod d〉 = |k〉 and thus, the terms in |ϕ〉 such that k < d are

$$\begin{array}{@{}rcl@{}} SUM\omega^{d-j}|x\rangle|j\rangle \rightarrow\omega^{s(\vec{y})\cdot x}\omega^{d-k}|x\rangle|k\rangle. \end{array} $$
(13)

Also, as \(s(\vec {y})\cdot x\) and j are bounded above by d −  1, k is strictly less than 2d. Hence, when dk <  2d we have |k mod d〉 = |kd〉.

Now, we introduce m such that kd = m then we have

$$\begin{array}{@{}rcl@{}} \omega^{s(\vec{y})\cdot x}\omega^{d-k}|x\rangle|k\ \text{mod}\ d\rangle =\omega^{s(\vec{y})\cdot x}\omega^{-m}|x\rangle|m\rangle =\omega^{s(\vec{y})\cdot x}\omega^{d-m}|x\rangle|m\rangle. \end{array} $$
(14)

Hence the terms in |ϕ〉 such that kd are

$$\begin{array}{@{}rcl@{}} SUM\omega^{d-j}|x\rangle|j\rangle \rightarrow\omega^{s(\vec{y})\cdot x}\omega^{d-m}|x\rangle|m\rangle. \end{array} $$
(15)

Hence from (13) and (15) we have

$$\begin{array}{@{}rcl@{}} SUM |x\rangle|\phi\rangle=\omega^{s(\vec{y})\cdot x}|x\rangle|\phi\rangle. \end{array} $$
(16)

Therefore, the relation (10) holds.

We have |ψ 2〉 by operating \(SUM_{f_{s(\vec {y})}(x)}\) to |ψ 1〉;

$$\begin{array}{@{}rcl@{}} SUM_{s(\vec{y})\cdot x}|\psi_{1}\rangle= |\psi_{2}\rangle\!=\sum\limits_{|x|= 0}^{d^{N}-1}\frac{\omega^{s(\vec{y})\cdot x}|x\rangle}{\sqrt{d^{N}}} \frac{1}{\sqrt{d}}(\omega^{d}|0\rangle +\omega^{d-1}|1\rangle +\cdots +\omega|d-1\rangle). \end{array} $$
(17)

The Fourier transform of |x〉 is as follows;

$$\begin{array}{@{}rcl@{}} |x_{1}...x_{N}\rangle &&\rightarrow \sum\limits_{z_{1}= 0}^{d-1}\dots\sum\limits_{z_{N}= 0}^{d-1} \frac{\omega^{z_{1}x_{1}}|z_{1}\rangle}{\sqrt{d}} \dots \frac{\omega^{z_{N}x_{N}}|z_{N}\rangle}{\sqrt{d}}. \end{array} $$
(18)

Thus we have

$$\begin{array}{@{}rcl@{}} |x\rangle\rightarrow \sum\limits_{|z|= 0}^{d^{N}-1}\frac{\omega^{z\cdot x}|z\rangle}{\sqrt{d^{N}}}. \end{array} $$
(19)

After the Fourier transform on |x〉, using the previous (17) and (19) we can now evaluate |ψ 3〉,

$$\begin{array}{@{}rcl@{}} |\psi_{3}\rangle=\sum\limits_{|z|= 0}^{d^{N}-1}\sum\limits_{|x|= 0}^{d^{N}-1} \frac{(\omega)^{x\cdot z+s(\vec{y})\cdot x}|z\rangle}{d^{N}} \frac{1}{\sqrt{d}}(\omega^{d}|0\rangle +\omega^{d-1}|1\rangle +\cdots +\omega|d-1\rangle). \end{array} $$
(20)

We notice

$$\begin{array}{@{}rcl@{}} \sum\limits_{|x|= 0}^{d^{N}-1} (\omega)^{x\cdot(z+s(\vec{y}))}= d^{N}\delta_{z+s(\vec{y}),0}=d^{N}\delta_{z,-s(\vec{y})}. \end{array} $$
(21)

Thus,

$$\begin{array}{@{}rcl@{}} &&|\psi_{3}\rangle= \sum\limits_{|z|= 0}^{d^{N}-1}\sum\limits_{|x|= 0}^{d^{N}-1} \frac{(\omega)^{x\cdot z+s(\vec{y})\cdot x}|z\rangle}{d^{N}} \frac{1}{\sqrt{d}}(\omega^{d}|0\rangle +\omega^{d-1}|1\rangle +\cdots +\omega|d-1\rangle)\\ &&=\sum\limits_{|z|= 0}^{d^{N}-1} \frac{d^{N}\delta_{z,-s(\vec{y})}|z\rangle}{d^{N}} \frac{1}{\sqrt{d}}(\omega^{d}|0\rangle +\omega^{d-1}|1\rangle +\cdots +\omega|d-1\rangle)\\ &&=-|s_{1}(\vec{y})s_{2}(\vec{y})...s_{N}(\vec{y})\rangle \frac{1}{\sqrt{d}}(\omega^{d}|0\rangle +\omega^{d-1}|1\rangle +\cdots +\omega|d-1\rangle), \end{array} $$
(22)

from which

$$\begin{array}{@{}rcl@{}} |s_{1}(\vec{y})s_{2}(\vec{y})...s_{N}(\vec{y})\rangle \end{array} $$
(23)

can be obtained. That is to say, if we measure \(|s_{1}(\vec {y})s_{2}(\vec {y})...s_{N}(\vec {y})\rangle \) then we can retrieve the following values

$$\begin{array}{@{}rcl@{}} s_{1}(\vec{y}),s_{2}(\vec{y}),...,s_{N}(\vec{y}) \end{array} $$
(24)

using a single query. All we have to do is to perform one quantum measurement. How do we perform it? All we have to do is to investigate the distribution of energy.

The speed to determine the N values improves by a factor of N as compared to the classical counterpart. Notice that we recoiver the generalized Bernstein-Vazirani algorithm when d = 2 [27].

3 Quantum Algorithm Determining a Homogeneous Linear Function

Suppose f is a homogeneous linear function f(x) := s.x = s 1 x 1 + s 2 x 2 + ⋯ + s N x N . Here x = (x 1, … , x N ), x j R and the coefficients s = (s 1, … , s N ), s j N.

Our goal is of determining the unknown coefficients s 1, … , s N from knowing the interpolation values

$$\begin{array}{@{}rcl@{}} f(1), f(2),...,f(N) \end{array} $$
(25)

simultaneously. Because the function is linear, we need to know exactly N points

$$\begin{array}{@{}rcl@{}} (1,f(1)), \dots, (N,f(N)) \end{array} $$
(26)

to interpolate the function in the classical case, i.e., we need N steps of computing. However as we will show in the quantum mechanical case, we need a query.

Here we are given the interpolation values f(1), f(2),..., f(N)

$$\begin{array}{@{}rcl@{}} &&f(1)=s_{1}a_{1}+ s_{2}a_{2}+\dots+s_{N} a_{N}=y^{1}\\ &&f(2)=s_{1}b_{1}+ s_{2}b_{2}+\dots+s_{N}b_{N}=y^{2}\\ &&\cdots\\ &&f(N)=s_{1}c_{1}+ s_{2}c_{2}+\dots+s_{N} c_{N}=y^{N}. \end{array} $$
(27)

We are given the following values

$$\begin{array}{@{}rcl@{}} \vec{y}=(y^{1},y^{2},...,y^{N}). \end{array} $$
(28)

Our aim is of determining the following values, simultaneously

$$\begin{array}{@{}rcl@{}} s=(s_{1}(\vec{y}),s_{2}(\vec{y}),...,s_{N}(\vec{y}))= (s_{1},\dots, s_{N}). \end{array} $$
(29)

Following Kronecker’s Theorem, the system (27) of linear equations has a unique solution s = (s 1, … , s N ) if and only if the augmented coefficient matrix

$$(A|\mathbf b) := \left( \begin{array}{ccccc} a_{1} & a_{2} & {\dots} &a_{N} & y^{1}\\ b_{1} & b_{2} & {\dots} &b_{N} & y^{2}\\ \cdot\,\cdot & \cdot\,\cdot & \cdot\,\cdot & \cdot\,\cdot & \cdot\,\cdot\\ c_{1} & c_{2} & {\dots} &c_{N} & y^{N}\end{array}\right).$$

has rank N, i.e., the interpolation points (a, y 1),(b, y 2), … , (c, y N) are in generic position. The problem can be solved by the new algorithm in the modulo d that is discussed in previous section. Here we assume

$$\begin{array}{@{}rcl@{}} \max\{s_{1}, \dots,s_{N}\}\le d-1. \end{array} $$
(30)

Therefore, we arrive at the goal of finding out the unknown coefficients s = (s 1, … , s N ) from the given

$$\begin{array}{@{}rcl@{}} (f(1), f(2),..., f(N)). \end{array} $$
(31)

So, we know the unknown coefficients s = (s 1, … , s N ) of the linear function f(x) = s.x, if we know the interpolation values (f(1), f(2),..., f(N)).

4 Quantum Algorithm Determining M Homogeneous Linear Functions

By using M parallel quantum systems, we have M homogeneous linear functions, simultaneously.

Suppose f 1, f 2,..., f M is M homogeneous linear functions

$$\begin{array}{@{}rcl@{}} &&f^{1}(x)={s_{1}^{1}}x_{1}+ {s_{2}^{1}}x_{2}+\dots+{s_{N}^{1}}x_{N}\\ &&f^{2}(x)={s_{1}^{2}}x_{1}+ {s_{2}^{2}}x_{2}+\dots+{s_{N}^{2}}x_{N}\\ &&{\cdots} \\ &&f^{M}(x)={s_{1}^{M}}x_{1}+ {s_{2}^{M}}x_{2}+\dots+{s_{N}^{M}}x_{N}. \end{array} $$
(32)

Here x = (x 1, … , x N ), x j R and the coefficients \({s_{j}^{k}}\in \{0,1,...,d-1\}\). We have to be given the set of the interpolation values

$$\begin{array}{@{}rcl@{}} &&\vec{y}^{1}=({y^{1}_{1}},{y^{2}_{1}},...,{y^{N}_{1}})\\ &&\vec{y}^{2}=({y^{1}_{2}},{y^{2}_{2}},...,{y^{N}_{2}})\\ &&\cdots\\ &&\vec{y}^{M}=({y^{1}_{M}},{y^{2}_{M}},...,{y^{N}_{M}}). \end{array} $$
(33)

Our aim is of determining the coefficients, simultaneously

$$\begin{array}{@{}rcl@{}} &&{s_{1}^{1}}(\vec{y}^{1}),{s_{2}^{1}}(\vec{y}^{1}),...,{s_{N}^{1}}(\vec{y}^{1}) = {s_{1}^{1}},\dots, {s_{N}^{1}}\\ &&{s_{1}^{2}}(\vec{y}^{2}),{s_{2}^{2}}(\vec{y}^{2}),...,{s_{N}^{2}}(\vec{y}^{2}) = {s_{1}^{2}},\dots, {s_{N}^{2}}\\ &&\cdots\\ &&{s_{1}^{M}}(\vec{y}^{M}),{s_{2}^{M}}(\vec{y}^{M}),...,{s_{N}^{M}}(\vec{y}^{M}) = {s_{1}^{M}},\dots, {s_{N}^{M}}. \end{array} $$
(34)

The problem can be solved by the new algorithm by using many parallel quantum systems. In the case, we measure the following quantum state;

$$\begin{array}{@{}rcl@{}} &&|{s_{1}^{1}}(\vec{y}^{1}){s_{2}^{1}}(\vec{y}^{1})...{s_{N}^{1}}(\vec{y}^{1}))\rangle\otimes\\ &&|{s_{1}^{2}}(\vec{y}^{2}){s_{2}^{2}}(\vec{y}^{2})...{s_{N}^{2}}(\vec{y}^{2}))\rangle\otimes \\ &&\cdots\\ &&\otimes|{s_{1}^{M}}(\vec{y}^{M}){s_{2}^{M}}(\vec{y}^{M})...{s_{N}^{M}}(\vec{y}^{M}))\rangle. \end{array} $$
(35)

That is to say, if we measure the quantum state (35) then we can retrieve the coefficients of the M functions by using a single query.

The speed of obtaining the set of M homogeneous linear functions is shown to outperform the classical case by a factor of N × M.

5 Conclusions

In conclusion, we have discussed an interpretation of quantum mechanics. We have assumed that quantum is energy. We have discussed an algorithm by means of the energy interpretation. We have presented a method for fast determining a homogeneous linear function f(x) := s.x = s 1 x 1 + s 2 x 2 + ⋯ + s N x N . Here x = (x 1, … , x N ), x j R and the coefficients s = (s 1, … , s N ), s j N. Given the interpolation values \((f(1), f(2),...,f(N))=\vec {y}\), we shall have determined the unknown coefficients \(s = (s_{1}(\vec {y}),\dots , s_{N}(\vec {y}))\) of the linear function, simultaneously. The speed of determining the values has been shown to outperform the classical case by a factor of N. Our method has been based on the generalized Bernstein-Vazirani algorithm [27] to qudit systems [28]. Next, by using M parallel quantum systems, we have had M homogeneous linear functions, simultaneously. The speed of obtaining the set of M homogeneous linear functions has been shown to outperform the classical case by a factor of N × M.