Ask Your Question

watson_ladd's profile - activity

2018-03-22 15:29:22 -0500 asked a question Avoiding redundancy in checking uniqueness of solution to linear equation

What I want is a function that given a matrix $A$ and vector $v$ will return a vector $x$ such that $Ax=v$ and will determine if this $x$ is unique or not, while doing a minimal amount of work. Currently I am using right nullity and the solve_right function separately, which I think results in some redundancy. Any advice on what I should do? There doesn't seem to be an obvious solution from the manual.

2018-03-09 11:43:39 -0500 asked a question Avoid recompilation of .spyx file

I have a script I am running many times with a .spyx file. Unfortunately each compilation creates a large temporary file, and these are eating up my disk quota so it now no longer runs. What do I do to avoid this situation? Ideally I compile once and sage uses that for all executions.

2018-01-24 15:40:15 -0500 received badge  Scholar (source)
2018-01-24 15:40:14 -0500 received badge  Supporter (source)
2018-01-22 11:43:40 -0500 asked a question Simultaneously diagonalizing matrices exactly

I have a bunch of matrices with integer coefficients that simultaneously commute. I know that there is a basis that simultaneously diagonalizes all of them, and I want to find it exactly so that I can recover all the corresponding eigenvalues as algebraic numbers.

I've tried casting to QQbar and using eigenvectors, but this occasionally tries to divide by zero for no reason I can discern. Any ideas?

2017-12-08 13:51:20 -0500 asked a question Coerce an algebraic into a number field that contains it

Consider the following code

r = QQbar.polynomial_root(x^5-x-1,CIF(RIF(0.1, 0.2), RIF(1.0, 1.1))
F,_,_ = number_field_elements_from_algebraics(r)

Even though r can be coerced into an element of F, this coercion doesn't happen. What is the right thing for me to do? I'm interested in computing an algebraic number field that will contain a bunch of eigenvalues and want to express all the eigenvalues as elements of the number field. I've done the obvious workaround but the limitation expressed in the sample above isn't great.

2017-12-07 18:07:44 -0500 received badge  Editor (source)
2017-12-06 01:24:01 -0500 received badge  Self-Learner (source)
2017-12-06 01:24:01 -0500 received badge  Teacher (source)
2017-12-05 20:39:33 -0500 commented question Overhead of isometry testing of quadratic forms

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.

2017-12-05 16:25:55 -0500 received badge  Student (source)
2017-12-05 16:24:39 -0500 asked a question 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?