# Bhargava cube

In number theory, a Bhargava cube (also called Bhargava's cube) is a configuration consisting of eight integers placed at the eight corners of a cube. This configuration was extensively used by Manjul Bhargava, a Canadian-American Fields Medal winning mathematician, to study the composition laws of binary quadratic forms and other such forms. To each pair of opposite faces of a Bhargava cube one can associate an integer binary quadratic form thus getting three binary quadratic forms corresponding to the three pairs of opposite faces of the Bhargava cube. These three quadratic forms all have the same discriminant and Manjul Bhargava proved that their composition in the sense of Gauss is the identity element in the associated group of equivalence classes of primitive binary quadratic forms. (This formulation of Gauss composition was likely first due to Dedekind.) Using this property as the starting point for a theory of composition of binary quadratic forms Manjul Bhargava went on to define fourteen different composition laws using a cube.

## Integer binary quadratic forms

An expression of the form $Q(x,y)=ax^{2}+bxy+cy^{2}$, where a, b and c are fixed integers and x and y are variable integers, is called an integer binary quadratic form. The discriminant of the form is defined as
    $D=b^{2}-4ac.$
The form is said to be primitive if the coefficients a, b, c are relatively prime. Two forms
    $Q(x,y)=ax^{2}+bxy+cy^{2},\quad Q^{\prime }(x,y)=a^{\prime }x^{2}+b^{\prime }xy+c^{\prime }y^{2}$
are said to be equivalent if there exists a transformation
    $x\mapsto \alpha x+\beta y,\quad y\mapsto \gamma x+\delta y$
with integer coefficients satisfying $\alpha \delta -\beta \gamma =1$ which transforms $Q(x,y)$ to $Q^{\prime }(x,y)$. This relation is indeed an equivalence relation in the set of integer binary quadratic forms and it preserves discriminants and primitivity.

## Gauss composition of integer binary quadratic forms

Let $Q(x,y)$ and $Q^{\prime }(x,y)$ be two primitive binary quadratic forms having the same discriminant and let the corresponding equivalence classes of forms be $[Q(x,y)]$ and $[Q^{\prime }(x,y)]$. One can find integers $p,q,r,s,p^{\prime },q^{\prime },r^{\prime },s^{\prime },a^{\prime \prime },b^{\prime \prime },c^{\prime \prime }$ such that
    $X=px_{1}x_{2}+qx_{1}y_{2}+ry_{1}x_{2}+sy_{1}y_{2}$
    $Y=p^{\prime }x_{1}x_{2}+q^{\prime }x_{1}y_{2}+r^{\prime }y_{1}x_{2}+s^{\prime }y_{1}y_{2}$
    $Q^{\prime \prime }(x,y)=a^{\prime \prime }x^{2}+b^{\prime \prime }xy+c^{\prime \prime }y^{2}$
    $Q^{\prime \prime }(X,Y)=Q(x_{1},y_{1})Q^{\prime }(x_{2},y_{2})$
The class $[Q^{\prime \prime }(x,y)]$ is uniquely determined by the classes [Q(x, y)] and [Q$^′$(x, y)] and is called the composite of the classes $[Q(x,y)]$ and $[Q^{\prime }(x,y)]$. This is indicated by writing
    $[Q^{\prime \prime }(x,y)]=[Q(x,y)]\ast [Q^{\prime }(x,y)]$
The set of equivalence classes of primitive binary quadratic forms having a given discriminant D is a group under the composition law described above. The identity element of the group is the class determined by the following form:
    $Q_{Id}^{(D)}(x,y)={\begin{cases}x^{2}-{\frac {D}{4}}y^{2}&D\equiv 0{\pmod {4}}\\x^{2}+xy+{\frac {1-D}{4}}y^{2}&D\equiv 1{\pmod {4}}\end{cases}}$
The inverse of the class $[ax^{2}+hxy+by^{2}]$ is the class $[ax^{2}-hxy+by^{2}]$.

## Quadratic forms associated with the Bhargava cube

Let (M, N) be the pair of 2 × 2 matrices associated with a pair of opposite sides of a Bhargava cube; the matrices are formed in such a way that their rows and columns correspond to the edges of the corresponding faces. The integer binary quadratic form associated with this pair of faces is defined as
    $Q=-\det(Mx+Ny)$
The quadratic form is also defined as
    $Q=-\det(Mx-Ny)$
However, the former definition will be assumed in the sequel.

### The three forms

Let the cube be formed by the integers a, b, c, d, e, f, g, h. The pairs of matrices associated with opposite edges are denoted by (M$_1$, N$_1$), (M$_2$, N$_2$), and (M$_3$, N$_3$). The first rows of M$_1$, M$_2$ and M$_3$ are respectively [a b], [a c] and [a e]. The opposite edges in the same face are the second rows. The corresponding edges in the opposite faces form the rows of the matrices N$_1$, N$_2$, N$_3$ (see figure).
| Bhargava cube showing the pair of opposite faces M$_1$ and N$_1$. | Bhargava cube showing the pair of opposite faces M$_2$ and N$_2$. | Bhargava cube showing the pair of opposite faces M$_3$ and N$_3$. |

#### The form Q$_1$

The quadratic form associated with the faces defined by the matrices $M_{1}={\begin{bmatrix}a&b\\c&d\end{bmatrix}},N_{1}={\begin{bmatrix}e&f\\g&h\end{bmatrix}}$ (see figure) is
    $Q_{1}=-\det(M_{1}x+N_{1}y)=-(\det(M_{1})x^{2}+(ah+ed-bg-fc)xy+\det(N_{1})y^{2})$
The discriminant of a quadratic form Q$_1$ is
    $D_{1}=(ah+ed-bg-fc)^{2}-4\det(M_{1})\det(N_{1}).$

#### The form Q$_2$

The quadratic form associated with the faces defined by the matrices $M_{2}={\begin{bmatrix}a&c\\e&g\end{bmatrix}},N_{2}={\begin{bmatrix}b&d\\f&h\end{bmatrix}}$ (see figure) is
    $Q_{2}=-\det(M_{2}x+N_{2}y)=-(\det(M_{2})x^{2}+(ah+bg-fc-ed)xy+\det(N_{2})y^{2})$
The discriminant of a quadratic form Q$_2$ is
    $D_{2}=(ah+bg-fc-ed)^{2}-4\det(M_{2})\det(N_{2}).$

#### The form Q$_3$

The quadratic form associated with the faces defined by the matrices $M_{3}={\begin{bmatrix}a&e\\b&f\end{bmatrix}},N_{3}={\begin{bmatrix}c&g\\d&h\end{bmatrix}}$ (see figure) is
    $Q_{3}=-\det(M_{3}x+N_{3}y)=-(\det(M_{3})x^{2}+(ah+fc-ed-bg)xy+\det(N_{3})y^{2})$
The discriminant of a quadratic form Q$_3$ is
    $D_{3}=(ah+fc-ed-bg)^{2}-4\det(M_{3})\det(N_{3}).$

#### Relation between Q$_1$, Q$_2$, Q$_3$

Manjul Bhargava's surprising discovery can be summarised thus:
    If a cube A gives rise to three primitive binary quadratic forms Q$_1$, Q$_2$, Q$_3$, then Q$_1$, Q$_2$, Q$_3$ have the same discriminant, and the product of these three forms is the identity in the group defined by Gauss composition. Conversely, if Q$_1$, Q$_2$, Q$_3$ are any three primitive binary quadratic forms of the same discriminant whose product is the identity under Gauss composition, then there exists a cube A yielding Q$_1$, Q$_2$, Q$_3$.

## Example

The three quadratic forms associated with the numerical Bhargava cube shown in the figure are computed as follows.
    ${\begin{aligned}Q_{1}(x,y)=-\det(M_{1}x+N_{1}y)&=-\det \left({\begin{bmatrix}1&0\\0&-2\end{bmatrix}}x+{\begin{bmatrix}0&3\\4&5\end{bmatrix}}y\right)\\&=-{\begin{vmatrix}x&3y\\4y&-2x+5y\end{vmatrix}}=2x^{2}-5xy+12y^{2}\\\\Q_{2}(x,y)=-\det(M_{2}x+N_{2}y)&=-\det \left({\begin{bmatrix}1&0\\0&4\end{bmatrix}}x+{\begin{bmatrix}0&3\\-2&5\end{bmatrix}}y\right)\\&=-{\begin{vmatrix}x&3y\\-2y&4x+5y\end{vmatrix}}=-4x^{2}-5xy-6y^{2}\\\\Q_{3}(x,y)=-\det(M_{3}x+N_{3}y)&=-\det \left({\begin{bmatrix}1&0\\0&3\end{bmatrix}}x+{\begin{bmatrix}0&4\\-2&5\end{bmatrix}}y\right)\\&=-{\begin{vmatrix}x&4y\\-2y&3x+5y\end{vmatrix}}=-3x^{2}-5xy-8y^{2}\\\end{aligned}}$
The composition $[Q_{1}(x,y)]\ast [Q_{2}(x,y)]$ is the form $[Q(x,y)]$ where $Q(x,y)=-3x^{2}+5xy-8y^{2}$ because of the following:
    $X=-2x_{1}x_{2}+4y_{1}x_{2}+y_{1}y_{2}$
    $Y=x_{1}x_{2}+3y_{1}y_{2}$
    $Q(X,Y)=Q_{1}(x_{1},y_{1})Q_{2}(x_{2},y_{2})$
Also $[Q_{3}(x,y)]^{-1}=Q(x,y)$. Thus $[Q_{1}(x,y)]\ast [Q_{2}(x,y)]\ast [Q_{3}(x,y)]$ is the identity element in the group defined by the Gauss composition.

## Further composition laws on forms
### Composition of cubes

The fact that the composition of the three binary quadratic forms associated with the Bhargava cube is the identity element in the group of such forms has been used by Manjul Bhargava to define a composition law for the cubes themselves.

### Composition of cubic forms

An integer binary cubic in the form $px^{3}+3qx^{2}y+3rxy^{2}+sy^{3}$ can be represented by a triply symmetric Bhargava cube as in the figure. The law of composition of cubes can be used to define a law of composition for the binary cubic forms.

### Composition of pairs of binary quadratic forms

The pair of binary quadratic forms $(ax^{2}+2bxy+cy^{2},dx^{2}+2exy+fy^{2})$ can be represented by a doubly symmetric Bhargava cube as in the figure. The law of composition of cubes is now used to define a composition law on pairs of binary quadratic forms.