**4. Discrete quantum computing and Lagrange's four-square theorem**

Conjecture 1 can be generalized as follows.

**Conjecture 2.** Given a set of *n*�qubit discrete states of levels of the same parity and orthogonal two by two, it is possible to build all of them simultaneously (applying a given circuit to different states of the computational base), using the conforming gates *H* and *G*.

Observe that the conjecture also makes sense for 2�qubits, since in the previous subsection it has only been proved for sets of 4 discrete states. The conjecture is also interesting in the non-discrete case, since it asks about the possibility of simultaneously constructing up to 2*<sup>n</sup>* quantum states simultaneously. In this case the conjecture is obviously true. Simply complete the orthonormal base, for example using the Gram-Schmidt method, and decompose the resulting unitary matrix into product of basic quantum gates. Therefore, it makes sense to ask if it is in the case of discrete quantum computing.

Before continuing, let us relax the discrete state level definition given in the previous section to any value of *k* for which the discrete state verifies Eq. (26). We will call these values *widespread levels*. Note that if *k* is a widespread level of a discrete state then *k* þ 2 is also. Then, a discrete state has widespread level *k* if and only if it is of the form *k*<sup>0</sup> þ 2*j*, where *k*<sup>0</sup> is the level of the discrete state and *j* a natural number. This property allows to write all discrete states (with levels of the same parity) at the same widespread level.

Let us see that, somehow, building a set of orthogonal discrete states is equivalent to completing the set to an orthonormal base. For this reason we will focus in the following problem:

**Problem 1.** Given a natural number *k* and Ψ1, … , Ψ *<sup>j</sup> n*�qubit discrete states with widespread level *<sup>k</sup>*, 1<sup>≤</sup> *<sup>j</sup>*<2*<sup>n</sup>*, such that <sup>Ψ</sup>*<sup>i</sup>* h i¼ <sup>j</sup>Ψ*<sup>m</sup>* 0 for all 1≤*<sup>i</sup>* <sup>&</sup>lt; *<sup>m</sup>* <sup>≤</sup>*j*, then is there an *n*�qubit discrete state with widespread level *k*, Ψ, such that Ψ*<sup>i</sup>* h i jΨ ¼ 0 for all 1≤*i* ≤*j*?

Considering that every discrete 2�qubit quantum gate can be built from gates *H* and *G*, the following can be easily proved: for 2�qubits Conjecture 2 is true if and only if Problem 1 has an affirmative answer. Then the resolution of Problem 1 would allow us to build bases with special characteristics and it would help us to demonstrate the conjecture that any *n*�qubit discrete gate, with *n*≥ 3, can be generated from quantum gates *H* and *G*.

The fact that establishes the connection between discrete quantum computing and Lagrange's four-square theorem is that the discrete states have to satisfy Eq. (26). Lagrange's four-square theorem [44] says that every natural number is a sum of four squared integer numbers and, consequently, guarantees that there exist discrete states for any level *k*≥0 and for any number of qubits *n* ≥1.

Problem 1 is an orthogonal version of Lagrange's four-square theorem, i.e. the discrete state Ψ must verify the Diophantine Eq. (26) and the following orthogonality conditions:

$$
\langle \Psi\_i | \Psi \rangle = 0 \quad \text{for all} \quad \mathbf{1} \le \mathbf{i} \le \mathbf{j}. \tag{36}
$$

Note that given a value of *k*, if the Eq. (26) has a solution for a 1�qubit, then it has a solution for every number of qubits *n*≥2. Nevertheless, this generalization is not necessarily true for the Problem 1, because of orthogonality conditions. Therefore the problem has its own entity for any number of qubits *n*.

Problem 1 turns out to be a difficult question in Number Theory and has deep implications. For this reason we begin with the following simplification that most resembles Lagrange's four-square problem: *n* ¼ 2, integers as coordinates instead of Gaussian integers and normalization factor ffiffiffi *p* p , being *p* a prime number, instead of ffiffiffiffi <sup>2</sup>*<sup>k</sup>* <sup>p</sup> .

**Problem 2.** Given a prime number *p* and *v*1, … , *vk* ∈4, 1≤*k*≤ 3, such that <sup>∥</sup>*vi*∥<sup>2</sup> <sup>¼</sup> *<sup>p</sup>* for all 1≤*i*<sup>≤</sup> *<sup>k</sup>* and *vi*j*<sup>v</sup> <sup>j</sup>* � � <sup>¼</sup> 0 for all 1≤*<sup>i</sup>* <sup>&</sup>lt;*j*≤*k*, then is there a vector *<sup>v</sup>* <sup>¼</sup> ð Þ *<sup>x</sup>*1, *<sup>x</sup>*2, *<sup>x</sup>*3, *<sup>x</sup>*<sup>4</sup> <sup>∈</sup><sup>4</sup> such that *vi* h i¼ <sup>j</sup>*<sup>v</sup>* 0 for all 1≤*<sup>i</sup>* <sup>≤</sup>*<sup>k</sup>* and <sup>∥</sup>*v*∥<sup>2</sup> <sup>¼</sup> *<sup>x</sup>*<sup>2</sup> <sup>1</sup> <sup>þ</sup> *<sup>x</sup>*<sup>2</sup> 2 þ *x*2 <sup>3</sup> <sup>þ</sup> *<sup>x</sup>*<sup>2</sup> <sup>4</sup> ¼ *p*?

Given a natural number 1≤*k*≤4 and a set of vectors *v*1, … , *vk* ∈<sup>4</sup> such that <sup>∥</sup>*vi*∥<sup>2</sup> <sup>¼</sup> *<sup>p</sup>* for all 1≤*i*<sup>≤</sup> *<sup>k</sup>* and *vi*j*<sup>v</sup> <sup>j</sup>* � � <sup>¼</sup> 0 for all 1≤*<sup>i</sup>* <sup>&</sup>lt;*j*≤*k*, we will say that *<sup>S</sup>* <sup>¼</sup> f g *v*1, … , *vk* is a *p*�*orthonormal system* and, if *k* ¼ 4, that *S* is a *p*�*orthonormal base*.

Given a *p*�*orthonormal system S*, we will call *support of S*, *supp S*ð Þ, to f*i* ∣ ∃*j* fsuch that theg *i*-fcoordinate ofg *v <sup>j</sup>* 6¼ 0g and we will say that ∣*supp S*ð Þ∣ is the *support size of S*.

In this context, the problem we are dealing with (Problem 2) is stated as follows: given a prime number *p* and a *p*�orthonormal system *S* ¼ f g *v*1, … , *vk* , 1≤ *k*≤3, prove that there exists *<sup>v</sup>*∈<sup>4</sup> such that *vi* h i <sup>j</sup>*<sup>v</sup>* <sup>¼</sup> 0 for all 1≤*<sup>i</sup>* <sup>≤</sup>*<sup>k</sup>* and <sup>∥</sup>*v*∥<sup>2</sup> <sup>¼</sup> *<sup>p</sup>*.

To prove the result, the authors consider four cases. Three of them are solved with basic linear algebra techniques. However the fourth case is much more difficult, and requires the use of lattices and some Number Theory results.

Case 1: one vector *p*�orthonormal systems.

If the *p*�orthonormal system *S* has a single vector *v*<sup>1</sup> ¼ ð Þ *x*1, *x*2, *x*3, *x*<sup>4</sup> , the solution (valid for all *p*≥1) is trivial: the required vector is, for example, *v* ¼ ð Þ *x*2, �*x*1, *x*4, �*x*<sup>3</sup> . Case 2: two vectors *p*�orthonormal systems with support size 2.

If the *p*�orthonormal system *S* has two vectors with ∣suppð Þ*S* ∣ ¼ 2, the solution (valid for all *p* ≥1) is as well trivial. Suppose, without loss of generality, that suppð Þ¼ *<sup>S</sup>* f g 1, 2 , *<sup>v</sup>*<sup>1</sup> <sup>¼</sup> ð Þ *<sup>x</sup>*1, *<sup>x</sup>*2, 0, 0 and *<sup>v</sup>*<sup>2</sup> <sup>¼</sup> *<sup>y</sup>*1, *<sup>y</sup>*2, 0, 0 � �. Then, the required vector is, for example, *v* ¼ ð Þ 0, 0, *x*1, *x*<sup>2</sup> .

Case 3: three vectors *p*�orthonormal systems.

If the *p*�orthonormal system *S* has three vectors, their exterior product allows us to obtain the required vector (valid for all *p*≥ 1). It is enough to prove that all the coordinates of the exterior product are multiples of *p* and divide this vector by *p* to obtain the vector we are looking for.

So far, attempts to extend the proof of Problem 2 to arbitrary values of the natural number *p* have been unsuccessful, despite having been proven with a computer that the result is true up to *p* ¼ 10000. This fact shows that the problem has a deep relationship with Number Theory. For discrete quantum computing the affirmative answer to Problem 1, as well as the proof of Conjectures 1 and 2, are very important. It would mean that discrete quantum computing maintains the most important properties relative to orthogonal and orthonormal vector systems and unitary transformations.

If we generalize Problem 2 by applying it to other dimensions, we see that counterexamples can be found for every dimension *n* that is not a multiple of 4. Thus, from Problem 2, we arrive at the following conjecture.

**Conjecture 3.** Given *n* � 0mod4 (*n*≥ 1) and *p* ≥1 and a *p*�orthonormal system in *<sup>n</sup>*, *<sup>S</sup>*, then *<sup>S</sup>* can be extended to a *<sup>p</sup>*�orthonormal base.

In all the problems raised and the conjectures established, the parities of the coordinates are important and, where appropriate, their parity patterns. It is also interesting to note that if we only want orthogonal systems, without specifying the norm or level of the vector with which we want to extend the system, all problems and conjectures are solved affirmatively.

Finally, we want to comment that the authors of the work in which discrete quantum computing is related to Lagrange's four-square theorem [21], conjecture that Problem 1 has an affirmative answer.
