# Overhead of isometry testing of quadratic forms

I have a script that generates a bunch of locally isomorphic quadratic forms and then tests them for global isometry. This script is too slow. Looking at profiling data much of the runtime is spent in the Quadratic forms class computing the useless local invariants and very little in the Pari qfisom calls. What can I do to cut down on this overhead?

edit retag close merge delete

It will be hard to answer without more information. Could you tell more about the contents script ?

( 2017-12-05 16:25:54 -0500 )edit

Sort by ยป oldest newest most voted

So I solved the problem by going straight to Pari's qfisom routine that the is_globally_isomorphic routine eventually calls. The script generates the p-neighbors and checks for isometry, so all the forms are positive definite, but determining this is extremely expensive as currently implemented and overshadows the cost of the isomorphism testing.

To do this if $q1$ and $q2$ are the Gram matricies I write:

T = g1.__pari()__.qfisom(g2.__pari__())


and T is either False or the transformation matrix I want.

more

Great! I turned your comment into an answer. Could you edit your question and your answer to provide your code? This would make this more useful for anyone reading the question and its answer. Thanks in advance!

( 2017-12-06 01:25:37 -0500 )edit

Additionally, it might entice someone to make Sage faster at this task!

( 2017-12-06 01:26:52 -0500 )edit

NB: To display inline code, use backticks. To display blocks of code or error messages, separate them by a blank line from the rest of the text, and indent them with 4 spaces, or select code lines and click the "code" button (the icon with '101 010').

For instance, typing

To do this, if g_1 and g_2 are the Gram matrices, I write:

T = g1.__pari()__.qfisom(g2.__pari__())

and T is either False or the transformation matrix I want.


will produce:

To do this, if q_1 and q_2 are the Gram matrices, I write:

T = g1.__pari()__.qfisom(g2.__pari__())


and T is either False or the transformation matrix I want.

( 2017-12-06 01:27:38 -0500 )edit