For any integer D congruent to 0 or 1 modulo 4, it is possible to create the parent structure of binary quadratic forms of discriminant D.
Create the structure of integral binary quadratic forms of discriminant D.
Binary quadratic forms may be created by coercing a triple [a, b, c] of integer coefficients into the parent structure of forms of discriminant D = b2 - 4ac. Other constructors are provided for constructing the group identity, prime forms, or allowing the omission of third element c of the sequence.
Create the principal form in the structure Q of binary quadratic forms of discriminant D. The principal form is either X2 - D/4Y2 if D mod 4 is 0 and X2 + XY + (D - 1)/4Y2 if it is 1. The principal form is a reduced form representing the identity element of the class group of Q.
Returns the binary quadratic form aX2 + bXY + cY2 in the magma of forms Q of discriminant D. Here c is determined by the solution of the equality D = b2 - 4ac; if no integer c exists satisfying this, an error will occur.
If p is a split prime or a ramified prime not dividing the conductor of the magma of quadratic forms Q, returns a quadratic form pX2 + bXY + cY2 in Q.[Next][Prev] [Right] [Left] [Up] [Index] [Root]