Algorithm for determining if two ternary quadratic forms are similar

53 Views Asked by At

Let $F$ be a field and $V$ be an $F$-vector space. We say that two quadratic forms $Q : V \to F$ and $Q' : V' \to F$ are similar if there exists a pair $(f,u)$ with $f$ an isomorphism from $V$ to $V'$ and $u \in F^\times$ such that $Q'(f(x)) = uQ(f(x))$.

Is there an easy way to determine whether two positive-definite ternary quadratic forms with integer coefficients are similar over $\mathbb{Q}$? The naive method would involve solving a system of three inhomogeneous quadratic equations subject to the a discriminant condition, but it seems there should be a better method.

P.S. The quaternion tag is included because what I really want is to check whether two quaternion orders are isomorphic. By results in Voight's book (Chapter 22) this is equivalent to checking whether two ternary quadratic forms are similar. In my case the forms are positive-definite.

2

There are 2 best solutions below

0
On

Thursday Oct. 12: Back before 1997 Alexander Schiemann revised his reduction programs for my use. Long story; here is the joint article

$$ \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc $$

jagy@gost:~/Desktop/Cplusplus$ ./ternrep
this program transforms ternary positive definite quadratic
forms with integral coeffcients into an exact normal form,
similar to the Seeber-Eisenstein reduction. Every form in a
class (with respect to integral equivalence) yields the same
representative.
The result is Minkowski reduced and additional conditions
(defining a unique representative) hold.
Let F be the Gram matrix of the result. Then F is subject to
1)  F is Minkowski reduced
2)  F12>=0  and  (F12=0 or F13=0) => F23>=0
3)  F11=F22 => |F23|<= F13
    F22=F33 =>  F13 <= F12
4)  F11+F22-2*F12-2*F13+2*F23=0 => F11-2*F13-F12<=0
    2*F12=F11 => F13<=2*F23
    2*F13=F11 => F12<=2*F23
    2*F23=F22 => F12<=2*F13
    2*F23> -F22
Should have six integers on the same line following the command ternrep:
Input/output is in Brandt-Intrau's format:
 a b c d e f  specifies the form
 a*x1^2 + b*x2^2 + c*x3^2 + d*x2*x3 + e*x3*x1 + f*x1*x2


 argc is  1  

jagy@gost:~/Desktop/Cplusplus$ ./ternrep   10 9 8  3 2 1
  8  9 10  1  2  3
jagy@gost:~/Desktop/Cplusplus$ ./ternrep   147 395 100  -10  12 -11
 100 147 395 11 10 12
jagy@gost:~/Desktop/Cplusplus$ date
Thu 12 Oct 2023 12:53:04 PM PDT
jagy@gost:~/Desktop/Cplusplus$ 

$$ \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc \bigcirc $$

This is right. On the first page of chapter 22, second paragraph in 22.1, Voight says

Let $R$ be a PID with field of fractions $F := \mbox{Frac} \;R. $ We recall that the similarity class of a ternary quadratic form $Q: R^3 \rightarrow R$ is determined by the natural change of variable by $ \mbox{GL}_3(R) $ on the domain and rescaling by $R^\times$ on the codomain and that $Q$ is nondegenerate if and only if $\mbox{disc} (Q) \neq 0 .$

Given two Schiemann reduced forms, divide each by the GCD of its six coefficients so as to reach a primitive form. If the two primitive forms do not have the same discriminant it did not work. If the two reduced sextuples are equal, you have it.

Here is my C++ version telling whether a positive ternary is reduced in Schiemann's recipe. The ordered sextuple $(a,b,c,d,e,f)$ refers to the form $$ (x,y,z) \; \mapsto \; \; a x^2 + b y^2 + c z^2 + d yz + e zx + f xy $$

Schiemann wrote this up in his dissertation, but he also discussed it in a later article in English

int TernaryForm::IsSchiemann() const
{
  int booo;
  int flag;
  flag = a + b + d - e - f;

  booo = a >= 1;
  booo = booo && b >= a;
  booo = booo && c >= b;
  booo = booo && e >= 0;
  booo = booo && e <= a;
  booo = booo && f >= 0;
  booo = booo && f <= a;
  booo = booo && d + b > 0;
  booo = booo && d <= b;
  booo = booo && ((e != 0 && f != 0 ) || d >= 0);
  booo = booo && (a != b || ( d <= e && d + e >= 0));
  booo = booo && (b != c ||  e <= f );
  booo = booo && flag >= 0;
  booo = booo && (flag != 0 || ( 2 * a - 2 * e - f <= 0) );
  booo = booo && (f != a ||  e  <= 2 * d );
  booo = booo && (e != a ||  f  <= 2 * d );
  booo = booo && (d != b ||  f  <= 2 * e );
  return booo;

}
0
On

To check if two ternary quadratic forms over $\mathbb{Q}$ are similar over $\mathbb{Q}$, you can apply Theorem 5.1.1 and check instead either that the associated quaternion algebras are isomorphic (have the same ramification set) or that the rescaled quadratic forms of discriminant $1$ are isometric (by applying the Hasse-Minkowski theorem).