First time here? Check out the FAQ!

Ask Your Question
0

quadratic form over the integers with odd coefficients

asked 10 years ago

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

Hi,

I'm a newcomer in Sage, and even after thorough examination of the manual I cannot understand the constructor QuadraticFrom :

sage: Q = QuadraticForm(ZZ, 2, [1,2,3])
sage: Q
Quadratic form in 2 variables over Integer Ring with coefficients:
[ 1 2  ]
[ * 3  ]

But

sage: Q.polynomial()
2*x0^2 + 4*x0*x1 + 6*x1^2

So how do I construct a quadratic form with odd coefficients in its polynomial expression ? The polynomial x0^2 + 4x0x1 + 3*x1^2 defines a genuine quadratic form over the integers. Is it made on purpose for some reasons related to classification of lattices ?

Thank you.

Preview: (hide)

Comments

If you are interested in binary quadratic forms this may be of interest for you: http://oeis.org/wiki/User:Peter_Lusch...

Peter Luschny gravatar imagePeter Luschny ( 10 years ago )

1 Answer

Sort by » oldest newest most voted
1

answered 10 years ago

slelievre gravatar image

updated 10 years ago

[Edited 2014-12-12, 2014-12-13.]

The documentation on Quadratic forms indeed documents this restriction.

You can access this documentation within Sage by typing QuadraticForm?. You can view the source code by typing QuadraticForm??.

You can also access this documentation online. On the online documentation for quadratic forms in Sage, the "Next Topic" is Binary Quadratic Forms with Integer Coefficients, which does not have this restriction.

So if your quadratic forms are only in two variables, use BinaryQF. Here the quadratic form you gave as an example:

sage: Q = BinaryQF([1,4,3])
sage: Q
x^2 + 4*x*y + 3*y^2
Preview: (hide)
link

Comments

2

I carefully read both the documentation and the source code before asking. Still no explanation why, for instance, they ask matrices of quadratic forms over the integers to have even diagonal ! Following this constructor it seems impossible to define x^2 as a quadratic form over ZZ.

Basile gravatar imageBasile ( 10 years ago )

Sorry, my initial answer was not very helpful. I edited to point to Binary quadratic forms with integer coefficients.

slelievre gravatar imageslelievre ( 10 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 10 years ago

Seen: 2,666 times

Last updated: Dec 13 '14