Quadratic diophantine equations and fundamental solutions I posted a question about a class of ternary quadratic equations. However, after some searching, I found the problem is not so simple as I thought. Thus, I want to know just whether a property on the Pell equations can be generalized.

Let $a $ and $b $ be integers, $\ne 0, 1, -1$. Consider a quadranary diophantine equation $x^2-ay^2-bz^2+abw^2=1$. The "grand" problem is to classify "nontrivial" (that is, $x^2\ne 1$) solutions. The existence may follow from the classical theory of Pell's equations.

Then, I want to know whether there are always(or for almost all cases) a finite set of "fundamental" solutions, generating the other solutions by some method. In case of Pell's equations, there is a unique fundamental solution $x_1+\sqrt{n}y_1$ for $x^2-ny^2=1$ and the other solutions are given as $x_n+\sqrt{n}y_n = (x_1+\sqrt{n}y_1)^n$. To utilize a similar way, I chose the class of equations to lie in the unit group of a quaternion algebra $(a,b)_\mathbb {Q} $.
Suggest beginning with Carmichael, manuscript pages 30-35, pdf pages 42-47.  

For any integer quadruple $(p,q,r,s)$ such that $p^2 - a q^2 - b r^2 + ab s^2 \neq 0,$ we get a rational solution 
$$ (1 + tp, \; tq, \; tr, \; ts)  $$ where
$$ t = \frac{-2p}{p^2 - a q^2 - b r^2 + ab s^2}.  $$
This does include all integer solutions, but selecting those is likely to be a mess. The main problem is that you take a fixed right hand side, $1,$ rather than $w^2$ with another variable, so that the whole thing is the null set of an indefinite quadratic form. In this latter problem you could clear denominators by taking $w = p^2 - a q^2 - b r^2 + ab s^2,$ then divide out by the GCD of all five variables, giving primitive solutions. In some problems the set of possible GCD's to worry about is finite, once $\gcd(p,q,r,s) = 1.$ I have no idea whether such good fortune happens here. 

From the language of integer (indefinite) lattices, we have an indefinite dot product, the bilinear form given by the evident 4 by 4 matrix. Over the rationals, a fixed vector $v$ with nonzero norm gives a reflection
$$  x \mapsto x - \frac{2 \, x \cdot v}{v \cdot v} v.  $$
This is what is called an "odd lattice," so this preserves all integer points only when $v \cdot v = \pm 1.$ i think it likely that the full automorphism group of your indefinite form is generated by reflections. This is somewhat circular, since you need to find vectors of norm $\pm 1$ to find reflections, and that is what you wanted in the first place. However, the thing sort of mushrooms; given a few solutions, you get a few reflections, these act on the solutions you have, and so on. 

For quadratic forms, I recommend CASSELS  since it emphasizes $\mathbb Q$ and $\mathbb Z.$ Note that MAJID JAHANGIRI alludes to the book Fricke and Klein (1897) but that is not in the references. A fair amount of the relevant material is availbale, in English in MAGNUS.

This is nice, you can read several pages of CHALK
The easiest option is. Equation.

$$x^2-ay^2-bz^2+baw^2=f$$

To rewrite it. 

$$x^2-ay^2=f+b(z^2-aw^2)$$

Find all possible solutions of the equation Pell.  They are made basic.

$$z^2-aw^2=t$$

It is necessary to consider all possible $t$.  And these decisions we find out whether the solution of this Pell equation.

$$x^2-ay^2=f+bt$$

And the problem is reduced to standard. Find out the solvability of the Pell equation and record his decision that much easier.

You can use either formula to find the solutions, or program to find the first solution. Knowing the first solution and the rest are easy.