Determinant of Characterisitic Polynomial

AI Thread Summary
The discussion revolves around the challenges of calculating the discriminant of a characteristic polynomial derived from a complex matrix using Mathematica. The user reports that while smaller matrices (up to 7x7) can be processed in a few hours, a 10x10 matrix takes days to evaluate. The built-in Discriminant command does not support parallel processing, prompting the user to seek more efficient methods. The characteristic polynomial is generated using the Collect function, and the discriminant is computed using SylvesterMatrix. There is a mention of the complexity of the matrix entries, which are non-numeric and contribute to the lengthy computation times. The conversation also touches on the perceived efficiency of different programming languages for such calculations, with some suggesting that writing a custom program could be beneficial, although the user is required to use Mathematica due to group standards.
azuresky101
Messages
2
Reaction score
0
I'm doing a calculation which finds the characteristic polynomial of a matrix, HH, with rather complex entries and then determines the discriminant of that polynomial. For smaller matrices up to around 7x7 it finishes evaluating the Discriminant command within a few hours, but at a 10x10, which is what I need, it takes days to evaluate. Running in parallel won't work for the built in Discriminant command. I was wondering if there was a more efficient way to evaluate the discriminant of high-order polynomial, as I know my code is basic.

CPHH = Collect[CharacteristicPolynomial[HH, x],x]];
DD = Discriminant[CPHH, x, Method -> SylvesterMatrix];
Simplify[DD, TimeConstraint -> Infinity]

If the rest of the code would be useful in determining a solution I'd be happy to post it

***Meant Discriminant in Title***
 
Physics news on Phys.org
Well, I have not had to do Matlab nor linear algebra since grad school (a couple of decades ago), so, I had to look up what Characteristic Polynomial is...I just saw a video in YouTube where the prof solved the Char. Poly for a 3x3 matrix in a few minutes...does it really take a few hours to solve a 7x7 in matlab?...I feel like I could solve it by hand in less than one!

What do you mean by "rather complex entries"?

Back then, MATLAB was not faster than a C or Fortran program; lately, I have seen postings in forums that seem to indicate that that continues to be the case...maybe you should write your own program to solve this.
 
Finding the characteristic polynomial takes seconds in mathematica. Its evaluating the discriminant of that polynomial that takes so long.

A typical entry in the 21x21 looks like this 1/2 h (61 h k1 - 159 h k2 - 14 g Hz uB). I forgot the particle is spin 10 so the hamiltonian is 21x21, not 10x10 like I said earlier.

Unfortunately it's required of me to use mathematica, as that is what everyone in the research group uses.
 
Oh, so it is mathematica and not matlab...same problem, I don't use either.

I looked up Discriminant of a Polynomial, now...I see that they can get pretty lengthy and you seem to be using non-numeric entries which I presume makes things more time consuming.

Anyway, good luck, I am afraid I can't help.
 

Similar threads

Replies
2
Views
2K
Replies
5
Views
3K
Replies
3
Views
2K
Replies
6
Views
4K
Replies
1
Views
3K
Replies
4
Views
4K
  • Poll Poll
Replies
4
Views
7K
Back
Top