In this short contribution we present a generalization of the Bernstein-Vazirani algorithm. Givenhe set of real values
$\left\{{a}_{1},{a}_{2},{a}_{3},\mathrm{....}{a}_{N}\right\}$
and the function g: R → {0, 1}, we shall determinethe following values
$\left\{g\left({a}_{1}\right),g\left({a}_{2}\right),g\left({a}_{3}\right),\mathrm{.........},g\left({a}_{N}\right)\right\}$
*simultaneously*. We are thus generalizing theBernstein-Vazirani algorithm. We recover the usual algorithm when
$g:{a}_{i}\to {a}_{i}$
The speed ofdetermining the N values will be shown to outperform the classical case by a factor of N.PACS numbers: 03.67.Lx(Quantum computation architectures and implementations), 03.67.Ac(Quantum algorithms, protocols, and simulations).

Quantum mechanics [1-6] provides exact and frequently remarkably accurate numerical predictions, as reported for over a century. There has been a remarkable link in recent decades between the quantum theory and information theory, given rise to the rich field of quantum information theory (QIT), which novel proposals that outperform classical tasks or simply have no classical counterpart [6].One case that involves both quantum theory and information theory that can be found in the foundations o fthe quantum theory is the Leggett-type non-local variables theory [7], which has been experimentally explored [8-10]. These experiments report that quantum theory does not accept a Leggett-type non-local variables interpretation, although some controversy remains around the conclusions and interpretations of the experimental outcomes [11-13]. Applications of QIT also include the implementation of quantum algorithms. One such case is provided for stance by the Deutsch’s problem [14], first experimentally realized on a nuclear magnetic resonance proof-of principle quantum computer [15]. Implementation of the Deutsch-Jozsa algorithm on an ion-trap quantum computer has also been achieved [16]. There have been, as well, several other attempts to use single-photon two qubitstates for quantum computing. Oliveira et a implemented the Deutsch’s algorithm with polarization and transverse electromagnetic spatial modes as qubits [17]. Other achievements also include single-photon Bell states preparation and measurement [18], a decoherence free implementation of Deutsch’s algorithm using single photon and using two logical qubits [19] and, more recently,a one-way quantum computing implementation of the algorithm[20].These achievements involving the Deutsch-Jozsa algorithm are very well related to the so called Bernstein-Vazirani algorithm [21,22], which can be considered as an extended version of the previous one. After these two algorithms, Simon’s algorithm [23] was discovered, among others. There has been a experimental implementation of a quantum algorithm that solves the Bernstein-Vazirani parity problem without entanglement [24]. Additionally, fiber-optics implementations of the Deutsch-Jozsa and Bernstein-Vazirani quantum algorithms with three qubits have been realized [25]. Also, a variant of the algorithm for quantum learning being robust against noise has been introduced [26], as well as a quantum algorithm for approximating the influences of Boolean functions and its applications [27]. The Bernstein-Vaziranial growth has been also versatile in quantum key distribution [28] and transport implementation with ion qubits [29]. In the present work we shall extend the Bernstein-Vazirani algorithm a bit further. In what follows, we present in full detail our generalization and some conclusions are drawn. Let us suppose that we are given the following sequence of real values

${a}_{1},{a}_{2},{a}_{3},\mathrm{....},{a}_{N}.$
(1)

Let us now introduce the function

$g:R\to \left\{0,1\right\}.$
(2)

Our goal is to determine the following values:

$g\left({a}_{1}\right),g\left({a}_{2}\right),g\left({a}_{3}\right),\mathrm{....},g\left({a}_{N}\right)$
(3)

Recall that in the classical case, we need N queries, that is, N separate evaluations of the function (2). In our quantum algorithm, we shall require a single query. Suppose now that we introduce another function

$f:{\left\{0,1\right\}}^{N}\to \left\{0,1\right\},$
(4)

which is a function with a N-bit domain and a 1-bitrange. We construct the following function:

$f\left(x\right)=g\left(a\right).x={\displaystyle \sum _{i=1}^{N}g\left({a}_{i}\right)}{x}_{i}\left(\mathrm{mod}2\right)$

$\begin{array}{l}=g\left({a}_{1}\right){x}_{1}\oplus g\left({a}_{2}\right){x}_{2}\oplus g\left({a}_{3}\right){x}_{3}\oplus \mathrm{....}\oplus g\left({a}_{N}\right){x}_{N},\\ {x}_{i}\in {\left\{0,1\right\}}^{N},g\left({a}_{{}_{i}}\right)\in \left\{0,1\right\},a{i}_{}\in R\end{array}$
(5)

where ai is a real value. Here
$g\left(a\right)$
symbolizes

$g\left({a}_{1}\right)g\left({a}_{2}\right)\mathrm{....}g\left({a}_{N}\right).$
(6)

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

${\psi}_{1}=\rangle {\oplus}^{N}|1\rangle $
(7)

After the Hadamard transform on the state, we have

$\psi {}_{1}\rangle ={\displaystyle \sum _{x\in {\left\{0,1\right\}}^{N}}\frac{|x\rangle}{{\sqrt{2}}^{N}}}\left[\frac{|0\rangle -|1\rangle}{\sqrt{2}}\right]$
(8)

Next, the function f is evaluated using

$Uf:|x,y\rangle \to |x,y\oplus f\left(x\right)\rangle $
(9)

Givening

$|\psi {}_{{}_{{}_{2}}}\rangle =\pm {\displaystyle \sum _{x}\frac{{\left(-1\right)}^{f\left(x\right)}|x\rangle}{{\sqrt{2}}^{N}}}\left[{\frac{|0\rangle -|1\rangle}{\sqrt{2}}}^{}\right]$
(10)

After the Hadamard transform, using the previous equation and (10) we can now evaluate
$|\psi {}_{3}\rangle $

$|\psi {}_{{}_{3}}\rangle =\pm {\displaystyle \sum _{z}{\displaystyle \sum _{x}\frac{{\left(-1\right)}^{{}^{x.z+f\left(x\right)}}|z\rangle}{{2}^{N}}}}\left[\frac{|0\rangle -|1\rangle}{\sqrt{2}}\right]$
(11)

Thus,

$|\psi {}_{{}_{{}_{3}}}\rangle =\pm {\displaystyle \sum _{z}{\displaystyle \sum _{x}\frac{{\left(-1\right)}^{{}^{x.z+g\left(a\right).x}}|z\rangle}{{2}^{N}}}}\left[\frac{|0\rangle -|1\rangle}{\sqrt{2}}\right]$
(12)

${{\displaystyle \sum _{x}\left(-1\right)}}^{x.z}{}^{+g\left(a\right).x}={2}^{N}{\delta}_{g}{}_{\left(a\right),z.}$
(13)

Thus,

$|\psi {}_{{}_{{}_{3}}}\rangle =\pm {\displaystyle \sum _{z}{\displaystyle \sum _{x}\frac{{\left(-1\right)}^{{}^{x.z+g\left(a\right).x}}|z\rangle}{{2}^{N}}}}\left[\frac{|0\rangle -|1\rangle}{\sqrt{2}}\right]$

$=\pm {\displaystyle \sum _{z}\frac{{}^{2N\delta}g\left(a\right),{z}^{|z\rangle}}{{2}^{N}}}\left[\frac{|0\rangle -|1\rangle}{\sqrt{2}}\right]$

$=\pm |g\left(a\right)\rangle \left[\frac{|0\rangle -|1\rangle}{\sqrt{2}}\right]$

$=\pm |g\left({a}_{1}\right)g\left({a}_{2}\right)\mathrm{...}g\left({a}_{N}\right)\rangle \left[\frac{|0\rangle -|1\rangle}{\sqrt{2}}\right]$
(14)

from which

$g\left({a}_{1}\right),g\left({a}_{2}\right)\mathrm{...}g\left({a}_{N}\right)\rangle $
(15)

can be obtained. That is to say, if we measure
$g\left({a}_{1}\right),g\left({a}_{2}\right)\mathrm{...}g\left({a}_{N}\right)\rangle $
then we can retrieve the following values

$g\left({a}_{1}\right),g\left({a}_{2}\right),g\left({a}_{3}\right),\mathrm{...}g\left({a}_{N}\right)$
(16)

Using a single query. All we have to do is to perform one quantum measurement. The speed to determine N values improves by a factor of N as compared to the classical counterpart. Notice that we receive the Bernstein-Vazirani algorithm when
$g:ai\to ai$

In the present work we have presented a generalization of the Bernstein-Vazirani algorithm. The advantage that is promised over its classical counterpart is
$O\left(N\right)$
, much like in the vein of quantum parallelism, where the *N* coefficients of a pure state
$\psi N\rangle $
can be known in one single quantum query.