Skip to main content
Log in

Discrete quantum computation and Lagrange’s four-square theorem

  • Published:
Quantum Information Processing Aims and scope Submit manuscript

Abstract

We study a problem that arises naturally in the discrete quantum computation model introduced in Gatti and Lacalle (Quantum Inf Process 17:192, 2018). Given an orthonormal system of discrete quantum states of level k \((k\in \mathbb {N})\), can this system be extended to an orthonormal basis of discrete quantum states of the same level? This question turns out to be a difficult problem in number theory with very deep implications. In this article, we focus on the simplest version of the problem, 2-qubit systems with integers (instead of Gaussian integers) as coordinates, but with normalization factor \(\sqrt{p}\) \((p\in \mathbb {N}^*)\), instead of \(\sqrt{2^k}\), being p a prime number. With these simplifications, we prove the following orthogonal version of Lagrange’s four-square theorem: Given a prime number p and \(v_1,\dots ,v_k\in \mathbb {Z}^4\), \(1\le k\le 3\), such that \(\Vert v_i\Vert ^2=p\) for all \(1\le i\le k\) and \(\langle v_i|v_j\rangle =0\) for all \(1\le i<j\le k\), then there exists a vector \(v=(x_1,x_2,x_3,x_4)\in \mathbb {Z}^4\) such that \(\langle v_i|v\rangle =0\) for all \(1\le i\le k\) and

$$\begin{aligned} \Vert v\Vert ^2=x_1^2+x_2^2+x_3^2+x_4^2=p. \end{aligned}$$

This means that, in \(\mathbb {Z}^4\), any system of orthogonal vectors of norm p can be completed to a basis. Besides, we conjecture that the result holds for every integer norm \(p\ge 1\) and for every space \(\mathbb {Z}^n\) where \(n\equiv 0\,\text {mod}\,4\), and that the initial question has a positive answer.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Cassels, J.W.S.: An Introduction to the Geometry of Numbers. Springer, Berlin (1997)

    MATH  Google Scholar 

  2. Chou, T.-W.J., Collins, G.E.: Algorithms for the solution of systems of linear Diophantine equations. SIAM J. Comput. 11, 687–708 (1982)

    Article  MathSciNet  Google Scholar 

  3. Eum, I.S., Shin, D.H., Yoon, D.S.: Representations by \(x^2_1+2x^2_2+ x^2_3+ x^2_4 + x_1x_3 + x_1x_4 + x_2x_4\). J. Number Theory 131, 2376–2386 (2011)

    Article  MathSciNet  Google Scholar 

  4. Gauss, C.F.: Disquisitiones Arithmeticae. Yale University Press, New Haven (1966)

    MATH  Google Scholar 

  5. Gatti, L.N., Lacalle, J.: A model of discrete quantum computation. Quantum Inf. Process. 17, 192 (2018)

    Article  ADS  MathSciNet  Google Scholar 

  6. Jones, G.A., Jones, J.M.: Elementary Number Theory. Springer, Berlin (1998)

    Book  Google Scholar 

  7. Ju, J., Oh, B.-K.: Universal sums of generalized octagonal numbers. J. Number Theory 190, 292–302 (2018)

    Article  MathSciNet  Google Scholar 

  8. Lagrange, J.L.: Demonstration d’un theoreme d’arithmétique. Oeuvres Complètes 3, 189–201 (1869)

    Google Scholar 

  9. Mordell, L.J.: A new Waring’s problem with squares of linear forms. Q. J. Math. Oxf. 1, 276–288 (1930)

    Article  ADS  Google Scholar 

  10. Ramanujan, S.: On the expression of a number in the form \(ax^2+by^2 +cz^2 +du^2\). Proc. Camb. Philos. Soc. 19, 11–21 (1917)

    MATH  Google Scholar 

  11. Smith, H.J.S.: On systems of linear indeterminate equations and congruences. Philos. Trans. Lond. 151, 293–326 (1861)

    Article  ADS  Google Scholar 

  12. Sun, Y.-C., Sun, Z.-W.: Some variants of Lagrange’s four squares theorem. arXiv:1605.03074v7 [math.NT] 14 Mar (2018)

  13. Sun, Z.-W.: A result similar to Lagrange’s theorem. J. Number Theory 162, 190–211 (2016)

    Article  MathSciNet  Google Scholar 

  14. Sun, Z.-W.: Refining Lagrange’s four-square theorem. J. Number Theory 175, 167–190 (2017)

    Article  MathSciNet  Google Scholar 

  15. Ye, D.: Representations of integers by certain 2k-ary quadratic forms. J. Number Theory 179, 50–64 (2017)

    Article  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to J. Lacalle.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Appendices

Appendix A: Main results related to Lagrange’s four-square problem

Long before Lagrange proved his theorem, Diophantus had asked whether every positive integer could be represented as the sum of four perfect squares greater than or equal to zero. This question later became known as Bachet’s conjecture, after the 1621 translation of Diophantus by Bachet. In parallel, Fermat proposed the problem of representing every positive integer as a sum of at most n n-gonal numbers. Lagrange [8] proved the square case of the Fermat polygonal number theorem in 1770, also solving Bachet’s conjecture. Gauss [4] proved the triangular case in 1796 and the full polygonal number theorem was not solved until it was finally proved by Cauchy in 1813. Later, in 1834, Jacobi discovered a simple formula for the number of representations of an integer as the sum of four integer squares.

The same year in which Lagrange proved his theorem, Waring asked whether each natural number k has an associated positive integer s such that every natural number is the sum of at most s natural numbers to the power of k. For example, every natural number is the sum of at most 4 squares, 9 cubes or 19 fourth powers. The affirmative answer to the Waring’s problem, known as the Hilbert–Waring theorem, was provided by Hilbert in 1909.

A natural generalization of Lagrange’s problem is the following: Given natural numbers a, b, c and d, can we solve \(n=ax_1^2+bx_2^2+cx_3^2+dx_4^2\) for all positive integers n in integers \(x_1\), \(x_2\), \(x_3\) and \(x_4\)? Lagrange’s four-square theorem answered in the positive the case \(a=b=c=d=1\) and the general solution was given by Ramanujan [10]. He proved that if we assume that \(a\le b\le c\le d\) then there are exactly 54 possible choices for a, b, c and d such that the problem is solvable in integers \(x_1\), \(x_2\), \(x_3\) and \(x_4\) for all \(n\in \mathbb {N}\). Ye [15] establishes formulas for the number of representations of integers by the quadratic forms \(x_1^2+\cdots +x_k^2+m(x_{k+1}^2+\cdots +x_{2k}^2)\) for \(m=2,4\), and Eum et al. [3] study the representation number of a nonnegative integer by the quaternary quadratic form \(x_1^2+2x_2^2+x_3^2+x_4^2+x_1x_3+x_1x_4+x_2x_4\). Sun [13] and Ju et al. [7] have studied a generalization of the problems of Lagrange and Remanujan, in which \(x_1\), \(x_2\), \(x_3\) and \(x_4\) are replaced by generalized octagonal numbers.

Another generalization, due to Mordel [9], tries to represent positive definite integral binary quadratic forms instead of positive integers. He proved that the quadratic form \(x_1^2+x_2^2+x_3^2+x_4^2+x_5^2\) represents all positive definite integral binary quadratic forms.

Sun et al. [12, 14] has proposed some refinements of Lagrange’s theorem such as, for example, the following: \(n\in \mathbb {N}\) can be written as \(x_1^2+x_2^2+x_3^2+x_4^2\) with \(x_1,x_2,x_3,x_4\in \mathbb {Z}\) such that \(x_1+x_2+x_3\) (or \(x_1+2x_2\), or \(x_1+x_2+2x_2\)) is a square (or a cube).

Appendix B: Case 4—two-vector p-orthonormal system with support size \(>2\)

1.1 Notations and basic properties

We consider \(\mathbb {Z}^4\) as a part of the vector space \(\mathbb {R}^4\) provided with the inner product \(\langle v|w\rangle =x_1y_1+x_2y_2+x_3y_3+x_4y_4\), where \(v=(x_1,x_2,x_3,x_4)\) and \(w=(y_1,y_2,y_3,y_4)\) are vectors of \(\mathbb {R}^4\), and with the canonical basis \(\{e_1,\dots ,e_4\}\).

Given a set of linearly independent vectors \(v_1,\dots ,v_k\in \mathbb {R}^4\), they generate the lattice \(\varLambda =\{\,b_1v_1+\cdots +b_kv_k\ |\ b_1,\dots ,b_k\in \mathbb {Z}\,\}\) [1] and constitute a basis of \(\varLambda \), B. So the dimension of \(\varLambda \) will be k. From now on, we will only consider bases whose vectors belong to \(\mathbb {Z}^4\), i.e., \(\varLambda \) will always be an integral lattice.

Given a point \(v\in \varLambda \), described by its coordinates in B, \(v=(b_i)_B\), the number \(N(v)=\Vert v\Vert ^2=\langle v|v\rangle \) is called the norm of v and can be calculated by the expression \(N(v)=b^tGb\), where G is the Gram matrix of the vectors of B. The determinant of G, \(\text {det}(G)\), is an invariant of \(\varLambda \) whose square root is denoted by \(\text {det}(\varLambda )\). So \(\text {det}(\varLambda )=\sqrt{\text {det}(G)}\), and geometrically, it is interpreted as the volume of the fundamental parallelepiped of \(\varLambda \). The matrix G is symmetric and positive definite and is associated with a quadratic form that collects the main properties of \(\varLambda \).

Let us consider the coordinate matrix V, formed by the vectors of the basis B of \(\varLambda \) placed by rows. If V is a square matrix, we can compute the determinant of \(\varLambda \) from V, \(\text {det}(\varLambda )=|\text {det}(V)|\), and it holds that \(\text {det}^2(V)=\text {det}(G)\).

However, we are not interested in \(\varLambda \), but rather in its orthogonal lattice

$$\begin{aligned} \varLambda ^{\bot }=\{\,v\in \mathbb {Z}^4\ |\ \langle v_i|v\rangle =0\,\, \text {for all}\,\, 1\le i\le k\,\}. \end{aligned}$$

The resolution method of systems of linear Diophantine equations [2] computes a basis of \(\varLambda ^{\bot }\) with \(4-k\) vectors. Then the dimension of \(\varLambda ^\bot \) will be \(k^\bot =4-k\). In order to do this we have to solve the linear system \(VX=0\), computing the Smith normal form [11] of V and its invariant factors \(\alpha _1,\dots ,\alpha _k\):

$$\begin{aligned} L\,VR = \left( \begin{array}{cccc} \alpha _1 &{} &{} \\ &{} \ddots &{} \\ &{} &{} \alpha _k \end{array}\right) = N \quad \text {such that}\quad \begin{array}{l} L\in GL_k(\mathbb {Z}) \\ R\in GL_4(\mathbb {Z}) \\ 0<\alpha _1,\dots ,\alpha _k \\ \alpha _1 | \alpha _2,\,\dots \,\alpha _{k-1} | \alpha _k. \end{array} \end{aligned}$$

Lemma 1

Given a number \(p\ge 1\) and a p-orthonormal system \(S=\{\,v_1,\dots ,\) \(v_k\,\}\), \(1\le k\le 3\), with associated lattice \(\varLambda \), then the last \(4-k\) columns of the matrix R, in the Smith normal form of V, constitute a basis of \(\varLambda ^\bot \).

Proof

It holds that \(\,VX=0\,\Leftrightarrow \,L\,VR\,R^{-1}\,X=L\,0=0\), and considering \(Y=R^{-1}\,X\), we have that \(\,VX=0\,\Leftrightarrow \,N\,Y=0\,\Leftrightarrow \,y_1=\cdots =y_k=0\). So, the basis that generates the solutions of \(VX=0\) is \(B^\bot =\{\,R\,e_{k+1},\dots ,R\,e_4\,\}\), i.e., the set with the last \(4-k\) columns of R. \(\square \)

We will use again the polynomial checking introduced in Sect. 2 Case 3, specifically in Propositions 3 and 4 and in Lemma 3.

Proposition 3

Given a prime number p and a p-orthonormal system \(S=\{\,v_1,v_2\,\}\), \(v_1=(x_1,\dots ,x_4)\) and \(v_2=(y_1,\dots ,y_4)\), with \(|\text {supp}(S)|>2\), then \(\text {gcd}(x_1,\dots ,x_4)=\text {gcd}(y_1,\dots ,y_4)=1\) and the invariant factors of V also verify \(\alpha _1=\alpha _2=1\).

Proof

Suppose, by contradiction, that \(\text {gcd}(x_1,\dots ,x_4)=g>1\). Then \(N(v_1)=g^2(x_1^{\prime \,2}+\cdots +x_4^{\prime \,2})=p\), where \(\displaystyle x_i^\prime =\frac{x_i}{g}\) for all \(1\le i\le 4\), and this fact contradicts the primality of p. So, we have that \(\text {gcd}(x_1,\dots ,x_4)=1\), and in the same way, we conclude that \(\text {gcd}(y_1,\dots ,y_4)=1\). Applying these results, together with the property of the first invariant factor, we get \(\alpha _1=1\).

In order to obtain the value of \(\alpha _2\), we will use the following identity, that can be proved by polynomial checking:

$$\begin{aligned} N(v_1)N(v_2)-\langle v_1|v_2\rangle ^2= \left| \begin{array}{cc} x_1 &{}\quad x_2 \\ y_1 &{}\quad y_2 \end{array} \right| ^2+ \left| \begin{array}{cc} x_1 &{}\quad x_3 \\ y_1 &{}\quad y_3 \end{array} \right| ^2+ \cdots + \left| \begin{array}{cc} x_3 &{}\quad x_4 \\ y_3 &{}\quad y_4 \end{array} \right| ^2. \end{aligned}$$

By hypothesis, \(N(v_1)N(v_2)-\langle v_1|v_2\rangle ^2=p^2\). Suppose, again by contradiction, that \(g=\text {gcd}(m_{12},\dots ,m_{34})>1\), where

$$\begin{aligned} m_{ij}=\left| \begin{array}{cc} x_i &{}\quad x_j \\ y_i &{}\quad y_j \end{array} \right| \qquad \text {and}\qquad m_{ij}^\prime =\frac{m_{ij}}{g}. \end{aligned}$$

Then \(p^2=g^2(m_{12}^{\prime \,2}+\cdots +m_{34}^{\prime \,2})\) and there are, at least, two minors different from 0 because \(|\text {supp}(S)|>2\). These facts contradict the primality of p. So, we have that \(\text {gcd}(m_{12},\dots ,m_{34})=1\), and since this value matches the second invariant factor, we get \(\alpha _2=1\). \(\square \)

Finally, we introduce the fundamental result of the branch of number theory called the geometry of numbers, proved by Minkowski in 1889.

Theorem 2

([1]) Let K be a convex set in \(\mathbb {R}^n\) which is symmetric with respect to the origin. If the volume of K is greater than \(2^n\) times the volume of the fundamental domain (parallelepiped) of a lattice \(\varLambda \), then K contains a nonzero lattice point.

1.2 Two-vector p-orthonormal system with support size \(>2\)

First of all, let us get a basis of \(\varLambda ^\bot \), \(B^\bot \), by computing a Smith quasi-normal form in which \(L\in GL_k(\mathbb {Q})\). Note that in this case Lemma 1 also holds. Let V be the coordinate matrix of the p-orthonormal system \(S=\{\,v_1,v_2\,\}\) with \(|\text {supp}(S)|>2\), \(v_1=(x_1,x_2,x_3,x_4)\), \(v_2=(y_1,y_2,y_3,y_4)\) and \(p\ge 1\). Suppose, rearranging the coordinates of \(v_1\) and \(v_2\) if necessary, that

$$\begin{aligned} x_1\ne 0,\quad \left| \begin{array}{cc} x_1 &{}\quad x_2 \\ y_1 &{}\quad y_2 \end{array} \right| \ne 0\quad \text {and} \quad 4\in \text {supp}(S),\ \text {i.e.,}\ x_4\ne 0\ \text {or}\ y_4\ne 0. \end{aligned}$$

The Smith quasi-normal form of S is:

$$\begin{aligned} L\,VR = \left( \begin{array}{cccc} c &{}\quad 0 &{}\quad 0 &{}\quad 0 \\ 0 &{}\quad cd &{}\quad 0 &{}\quad 0 \end{array}\right) \quad \text {such that}\quad \begin{array}{l} L\in GL_k(\mathbb {Q}) \\ R\in GL_4(\mathbb {Z}) \\ 0<c,d \\ R=R_1\, R_2\, R_3\, R_4\, R_5, \\ \end{array} \end{aligned}$$

where the matrices L and \(R_i\), \(1\le i\le 5\), and the parameters c and d are those that appear in Table 1.

Lemma 2

Given a number \(p\ge 1\) and a p-orthonormal system \(S=\{\,v_1,v_2\,\}\) with associated lattice \(\varLambda \), then \(B^\bot =\{\,w_1,w_2\,\}\) is a basis of \(\varLambda ^\bot \), where

$$\begin{aligned} \begin{array}{lll} w_1 &{} = &{} \displaystyle \left( \frac{x_2\, y_3^{\prime }}{c_1\, d_1}-\frac{x_3\, y_2^{\prime }\,\sigma _1}{c_2\, d_1}, -\frac{x_1\, y_3^{\prime }}{c_1\, d_1}-\frac{x_3\, y_2^{\prime }\,\tau _1}{c_2\, d_1}, \frac{c_1\, y_2^{\prime }}{c_2\, d_1},0\right) \\ w_2 &{} = &{} \displaystyle \left( \frac{y_4^{\prime }(c_1\, x_3\,\sigma _1\,\tau _4+c_2\, x_2\,\sigma _4)}{c_1\, c_2\, d} - \frac{d_1\, x_4\, \sigma _1\,\sigma _2}{c\, d},\right. \\ &{} &{} \displaystyle \quad \left. \frac{y_4^{\prime }(c_1\, x_3\,\tau _1\,\tau _4-c_2\, x_1\,\sigma _4)}{c_1\, c_2\, d} - \frac{d_1\, x_4\, \sigma _2\,\tau _1}{c\, d}, -\frac{d_1\, x_4\,\tau _2}{c\, d}-\frac{c_1\, y_4^{\prime }\,\tau _4}{c_2\, d}, \frac{c_2\, d_1}{c\, d}\right) . \\ \end{array} \end{aligned}$$

Proof

We obtain the result just by multiplying the matrices \(R_1\), \(R_2\), \(R_3\), \(R_4\) and \(R_5\) and applying Lemma 1 to the Smith quasi-normal form of S. \(\square \)

Table 1 Smith quasi-normal form data

Remark 1

Let V and \(G_V\) be the coordinate matrix and the Gram matrix, respectively, of the set of vectors \(B\cup B^\bot \), and let G be the Gram matrix of the set of vectors \(B^\bot \). Then, \(\text {det}^2(V)=\text {det}(G_V)=p^2\text {det}(G)\), and since \(\text {det}^2(\varLambda ^\bot )=\text {det}(G)\), we concluded that \(\displaystyle \text {det}(\varLambda ^\bot )=\frac{\left| \text {det}(V)\right| }{p}\).

We can use Remark 1 to compute \(\text {det}(\varLambda ^\bot )\) and, indirectly, to study the matrix G, considered as a symmetric positive definite quadratic form.

Proposition 4

Given a number \(p\ge 1\) and a p-orthonormal system \(S=\{\,v_1,v_2\,\}\), with associated lattice \(\varLambda \), then \(\displaystyle \text {det}(\varLambda ^\bot )=\frac{p}{c\,d}\), where c and d are the parameters that appear in Table 1.

Table 2 Monomials of \(\text {det}(V) c_1 c_2 cd\)

Proof

To obtain the result we only have to compute \(\text {det(V)}\), by Remark 1. Developing the expression of the determinant of V, where \(w_1\) and \(w_2\) are the vectors obtained in Lemma 2, we obtain:

$$\begin{aligned} {\text {det}}(V) c_1 c_2 d_1 cd= & {} c y_4^{\prime }\Bigg (c_1\bigg (x_1^2 y_4-x_1 x_4 y_1+x_2\left( x_2 y_4-x_4 y_2\right) \bigg ) \\&\qquad +\, x_3\left( \underline{x_1\sigma _1+x_2\tau _1}\right) \left( x_3 y_4-x_4 y_3\right) \Bigg )\left( \underline{y_2^{\prime }\sigma _4+y_3^{\prime }\tau _4}\right) \\&\quad +\, d_1\Bigg (c_1^2 y_2^{\prime }\bigg (c_2\left( x_1 y_2-x_2 y_1\right) +x_1 x_4 y_4\sigma _2\tau _1 \\&\qquad \quad -\, x_4\sigma _2\bigg (x_2 y_4\sigma _1+x_4\left( y_1\tau _1-y_2\sigma _1\right) \bigg )\bigg ) \\&\qquad +\, c_1 x_3 y_2^{\prime }\bigg (c_2\bigg (x_1 y_3\tau _1-x_2 y_3\sigma _1 + x_3\left( y_2\sigma _1-y_1\tau _1\right) \bigg ) \\&\qquad \quad +\, x_4\tau _2\bigg (x_1 y_4\tau _1-x_2 y_4\sigma _1+x_4\left( y_2\sigma _1-y_1\tau _1\right) \bigg )\bigg ) \\&\qquad +\, c_2 y_3^{\prime }\bigg (c_2\bigg (x_1^2 y_3-x_1 x_3 y_1+x_2\left( x_2 y_3-x_3 y_2\right) \bigg ) \\&\qquad \quad +\, x_4\bigg (x_1^2 y_4\tau _2-x_1\bigg (x_3 y_4\sigma _1\sigma _2+x_4\left( y_1\tau _2-y_3\sigma _1\sigma _2\right) \bigg ) \\&\qquad \qquad +\, x_2\bigg (x_2 y_4\tau _2-x_3 y_4\sigma _2\tau _1+x_4\left( y_3\sigma _2\tau _1-y_2\tau _2\right) \bigg )\bigg )\bigg )\Bigg ), \end{aligned}$$

where all the parameters appear in Table 1.

Throughout the proof, we will replace expressions by applying equalities from Table 1.

Substituting the underlined expressions by \(c_1\) and \(d_1\), respectively, all occurrences of \(d_1\) are canceled. Similarly, substituting \(c_1y_2^{\prime }\), \(c_2y_3^{\prime }\) and \(cy_4^{\prime }\) for the expressions

$$\begin{aligned} \begin{array}{l} x_1y_2-x_2y_1, \\ c_1y_3-x_3(\sigma _1y_1+\tau _1y_2)\ \text {and} \\ c_2y_4-x_4(\sigma _2\sigma _1y_1+\sigma _2\tau _1y_2+\tau _2y_3), \end{array} \end{aligned}$$

respectively, the parameter c disappears from the second equality member.

Table 3 Monomials resulting from operations

The expression \(\text {det}(V) c_1 c_2 cd\) is a homogeneous polynomial of total degree 6 in the variables \(c_1\), \(c_2\), \(x_1\), \(x_2\), \(x_3\), \(x_4\), \(y_1\), \(y_2\), \(y_3\) and \(y_4\), in which only the parameters \(\sigma _1\), \(\tau _1\), \(\sigma _2\) and \(\tau _2\) appear. The monomials of the aforementioned polynomial are included in Table 2 and are identified by indexes placed in the first cells of the corresponding rows.

In order to eliminate the parameters \(\sigma _1\), \(\tau _1\), \(\sigma _2\) and \(\tau _2\), we group the monomials of Table 2 in pairs to apply the following operations:

$$\begin{aligned} \begin{array}{l} \text {(1) Substitute}\ \ x_1\sigma _1+x_2\tau _1\ \ \text {by}\ \ c_1. \\ \text {(2) Substitute}\ \ c_1\sigma _2+x_3\tau _2\ \ \text {by}\ \ c_2. \\ \text {(3) Cancel opposite monomials}. \\ \text {(4) Add equal monomials}. \\ \end{array} \end{aligned}$$

Applied operations are detailed in Table 3, where the resulting monomials are identified by the indexes of the first monomials that are operated on. Each time an operation is applied, the monomials involved are marked with a \(\times \) to the right of the index that identifies the monomial, so as not to use them again. The operations are done iteratively on monomials of Tables 2 and 3 that are not marked, until no operation can be further applied.

All the resulting monomials have the factor \(c_1c_2\). Therefore, by simplifying this factor the next equality is obtained:

$$\begin{aligned} \begin{array}{ccl} \text {det}(V)cd &{} = &{} x_1^2 y_2^2 + x_1^2 y_3^2 + x_1^2 y_4^2 -2 x_1 x_2 y_1 y_2 - 2x_1x_3y_1y_3 - 2x_1x_4y_1y_4 \\ &{}&{} x_2^2 y_1^2 + x_2^2 y_3^2 + x_2^2 y_4^2 - 2x_2x_3y_2y_3 - 2x_2x_4y_2y_4 + x_3^2 y_4^2 \\ &{}&{} - 2x_3x_4y_3y_4 + x_4^2 y_1^2 + x_4^2 y_2^2 + x_4^2 y_3^2 + x_3^2 y_1^2 + x_3^2 y_2^2. \end{array} \end{aligned}$$

By polynomial checking, it is easy to verify the next equality:

$$\begin{aligned} \text {det}(V)cd=\left( x_1^2+x_2^2+x_3^2+x_4^2\right) \left( y_1^2+y_2^2+y_3^2+y_4^2\right) -(x_1y_1+x_2y_2+x_3y_3+x_4y_4)^2. \end{aligned}$$

By hypothesis, the second member of the previous equality is equal to \(p^2\). Therefore, by applying Remark 1, we conclude that:

$$\begin{aligned} \text {det}(\varLambda ^\bot )=\frac{p}{cd}. \end{aligned}$$

\(\square \)

Table 4 Monomials of \(N(w_1)c_1^2c_2^2d_1^2\) and resulting from operations

Lemma 3

Given a number \(p\ge 1\), a p-orthonormal system \(S=\{\,v_1,v_2\,\}\) and \(w_1\) the first vector of the basis \(B^\bot \) of the orthogonal lattice \(\varLambda ^\bot \), then \(\displaystyle N(w_1)=\frac{p(p-x_4^2-y_4^2)}{c_2^2\,d_1^2}\), where \(c_2\) and \(d_1\) are the parameters in Table 1.

Proof

The proof is similar to that of Proposition 4. Considering the vector \(w_1\) obtained in Lemma 2 and calculating \(N(w_1)\), the following equality is obtained:

$$\begin{aligned} N(w_1)c_1^2c_2^2d_1^2=c_1^4y_2^{\prime \,2} + c_1^2x_3^2y_2^{\prime \,2}\left( \sigma _1^2 + \tau _1^2\right) + 2c_1c_2x_3y_2^{\prime }y_3^{\prime }(x_1\tau _1 - x_2\sigma _1) + c_2^2y_3^{\prime \,2}\left( x_1^2 + x_2^2\right) . \end{aligned}$$

Substituting in the second member of equality \(c_1y_2^{\prime }\) by \(-x_2y_1+x_1y_2\) and \(c_2y_3^{\prime }\) by \(-x_3\sigma _1y_1-x_3\tau _1y_2+c_1y_3\), a homogeneous polynomial of total grade 6 in the variables \(c_1\), \(x_1\), \(x_2\), \(x_3\), \(y_1\), \(y_2\) and \(y_3\) is obtained, in which only the parameters \(\sigma _1\) and \(\tau _1\) appear.

The monomials of the aforementioned polynomial are listed in Table 4. The results of the following substitution are also included in the table: Replace \(x_1\sigma _1+x_2\tau _1\) by \(c_1\).

All the remaining monomials are multiplied by the factor \(c_1^2\). Therefore, simplifying this factor, we obtain:

$$\begin{aligned} \begin{array}{ccl} N(w_1)c_2^2d_1^2 &{} = &{} x_1^2y_2^2 + x_1^2y_3^2 - 2x_1x_2y_1y_2 + x_2^2y_1^2 + x_2^2y_3^2 \\ &{} &{} - 2x_1x_3y_1y_3 - 2x_2x_3y_2y_3 + x_3^2y_1^2 + x_3^2y_2^2. \\ \end{array} \end{aligned}$$

By polynomial checking, it is easy to verify the next equality:

$$\begin{aligned} \begin{array}{ccl} N(w_1)c_2^2d_1^2 &{} = &{} \left( x_1^2+x_2^2+x_3^2+x_4^2\right) \left( y_1^2+y_2^2+y_3^2+y_4^2\right) \\ &{} &{} - (x_1y_1+x_2y_2+x_3y_3+x_4y_4)^2 - x_4^2\left( y_1^2+y_2^2+y_3^2+y_4^2\right) \\ &{} &{} -y_4^2\left( x_1^2+x_2^2+x_3^2+x_4^2\right) + 2x_4y_4(x_1y_1+x_2y_2+x_3y_3+x_4y_4). \\ \end{array} \end{aligned}$$

By hypothesis, the second member of the previous equality is equal to \(p^2-px_4^2-py_4^2\). Therefore, we conclude that:

$$\begin{aligned} \displaystyle N(w_1)=\frac{p\left( p-x_4^2-y_4^2\right) }{c_2^2d_1^2}. \end{aligned}$$

\(\square \)

Lemma 4

Given a prime number p and a p-orthonormal system \(S=\{\,v_1,v_2\,\}\) with \(|\text {supp}(S)|>2\), associated with the lattice \(\varLambda \), then \(c=d=1\), where c and d are the parameters that appear in Table 1.

Proof

According to Table 1, it holds that \(c=\text {gcd}(x_1,x_2,x_3,x_4)\), and by Proposition 3, we conclude that \(c=1\). This result implies that the Smith quasi-normal form described in Table 1 is actually a normal form, because in this case \(L\in GL_k(\mathbb {Z})\), and consequently, d is the second invariant factor of V. Considering once more Proposition 3, we conclude that \(d = 1\). \(\square \)

Proposition 5

Given a prime number p, a p-orthonormal system \(S=\{\,v_1,v_2\,\}\) with \(|\text {supp}(S)|>2\) and the Gram matrix G of the basis \(B^\bot =\{\,w_1,w_2\,\}\) of the orthogonal lattice \(\varLambda ^\bot \), then it holds that \(p\,|\,G\).

Proof

Suppose that the Gram matrix \( G=\left( \begin{array}{cc} \mu &{}\quad \lambda \\ \lambda &{}\quad \nu \end{array} \right) \).

Let us consider the value of \(\mu =N(w_1)\) obtained in Lemma 3. The prime factorization of \(p(p-x_4^2-y_4^2)\) contains only one factor p, because p is prime and \(-p<p-x_4^2-y_4^2<p\). (Remember that we are assuming that \(x_4\ne 0\) or \(y_4\ne 0\).) Then, the prime factorization of \(c_2^2\,d_1^2\) does not contain p, because the number of times it contains each prime factor is even. Consequently, \(c_2^2\,d_1^2\,|\,(p-x_4^2-y_4^2)\) and this implies that \(p\,|\,\mu \), i.e., \(\mu =p\,\mu ^\prime \). Moreover, \(|\mu ^\prime |<p\).

Applying Proposition 4, Lemma 4 and the property \(\text {det}^2(\varLambda ^\bot )=\text {det}(G)\), we get \(p^2=p\,\mu ^\prime \,\nu -\lambda ^2\). This implies \(p\,|\,\lambda ^2\), and keeping in mind that p is a prime, we have that \(p\,|\,\lambda \), i.e., \(\lambda =p\,\lambda ^\prime \).

Reconsidering the previous equality, and canceling a factor p, we obtain \(p=\mu ^\prime \,\nu -p\,\lambda ^{\prime \,2}\). This implies again that \(p\,|\,\mu ^\prime \,\nu \), and considering that p is prime and \(|\mu ^\prime |<p\), we get \(p\,|\,\nu \), i.e., \(\nu =p\,\nu ^\prime \).

We arrive to the final conclusion that \( G=p\left( \begin{array}{cc} \mu ^\prime &{}\quad \lambda ^\prime \\ \lambda ^\prime &{}\quad \nu ^\prime \end{array} \right) \), i.e., \(p\,|\,G\). \(\square \)

Theorem 3

Given a prime number p, a p-orthonormal system \(S=\{\,v_1,v_2\,\}\) with \(|\text {supp}(S)|>2\) and associated lattices \(\varLambda \) and \(\varLambda ^\bot \), there exists \(v\in \varLambda ^\bot \) such that it verifies \(N(v)=p\).

Proof

Let G be the Gram matrix of the basis \(B^\bot \) of the associated lattice \(\varLambda ^\bot \).

Proposition 4, Lemma 4 and property \(\text {det}^2(\varLambda ^\bot )=\text {det}(G)\) allow us to conclude that \(\text {det}(G)=p^2\). Applying now Proposition 5, we obtain that \(\displaystyle G^{\prime }=\frac{G}{p}\) is an unimodular matrix, i.e., \(G^\prime \in GL_2(\mathbb {Z})\), and that, given a vector \(v\in \varLambda ^\bot \), \(N(v)=b^t\,G\,b=p\) if and only if \(b^t\,G^\prime \,b=1\), b being the coordinate vector of v in the basis \(B^\bot \).

Let \(K = \{\,x\in \mathbb {R}^2\ |\ x^t\,G^{\prime }\,x \le 1\,\}\) and \(\{u_1,u_2\}\) be an orthonormal basis of eigenvectors of \(G^\prime \) with eigenvalues \(\lambda _1\) and \(\lambda _1\), respectively. Note that \(\lambda _1\) and \(\lambda _2\) are real, since \(G^\prime \) is symmetric, positive, because \(G^\prime \) is definite positive, and verify \(\lambda _1\,\lambda _2=\text {det}(G^\prime )=1\). Then K is the ellipse \(\lambda _1x^2+\lambda _2y^2\le 1\), with respect to the reference system determined by \(u_1\) and \(u_2\), and has volume \(\pi \frac{1}{\sqrt{\lambda _1}}\frac{1}{\sqrt{\lambda _2}} = \pi \).

Given a \(0<\epsilon <1\), let be \(E_\epsilon \) the ellipse K scaled by a factor \(f_\epsilon =\frac{2}{\sqrt{\pi }}+\epsilon \). The ellipse \(E_\epsilon \) has volume \(\pi f_\epsilon ^2>\pi \frac{2^2}{\pi }=2^2\). Then, for Theorem 2, there exists a point b in the lattice \(\mathbb {Z}^2\) (with volume of the fundamental domain 1) such that \(b\ne 0\) and \(b\in E_\epsilon \). Since the set of points of \(\mathbb {Z}^2\) that belong to any of the ellipses \(E_\epsilon \) is finite, it is shown that there is a point b in the lattice \(\mathbb {Z}^2\) such that \(b\ne 0\) and \(b\in K\).

The point b defines a vector \(v\in \varLambda ^\bot \) that verifies \(0<b^t\,G^\prime \,b\le 1\). Then, it holds \(b^t\,G^\prime \,b=1\), since \(b^t\,G^\prime \,b\) is integer, and, at last, is the wanted vector of \(\varLambda ^\bot \), because \(N(v)=b^t\,G\,b=p\). \(\square \)

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Lacalle, J., Gatti, L.N. Discrete quantum computation and Lagrange’s four-square theorem. Quantum Inf Process 19, 34 (2020). https://doi.org/10.1007/s11128-019-2528-7

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s11128-019-2528-7

Keywords

Navigation