2
$\begingroup$

I have a large ($50\times 50$) sparse matrix $M$ whose entries are symbolic, and most of them are of these exponential form: E^(-((I x)/2)) (3 + x) and E^(1/3 I (-3 y + 5 \[Pi] + 3 x)) (1 + x) and E^((I x)/2) E^(I z) (2 + x) . Running Det[M], after $4$ days, there is no result yet.

My question is if I replace those complicated exponential entries with some letters, I mean to define each of them like

a:=E^(-((I x)/2)) (3 + x)
b:=E^(1/3 I (-3 y + 5 \[Pi] + 3 x)) (1 + x)
c:=E^((I x)/2) E^(I z) (2 + x) 

and then ask Mathematica to compute Det[M], will it be faster?

More precisely, the time Mathematica spends to find the determinant of a symbolic matrix is only a function of the size (dimension) of the matrix? or, does the complicated form of the entries also play a role?

Given the function SPARSE below, my matrix is given by the code M = SparseArray[SPARSE, {48, 48}].

SPARSE={{1, 45} -> 
  E^((I x)/2) (-1 + x), {1, 46} -> -E^(-((I x)/2)) (1 + x), {1, 47} ->
   1 + x, {1, 48} -> 1 - x, {2, 3} -> E^(I (t - x)) (1 - x), {2, 4} ->
   E^(I (t + x)) (1 + x), {2, 47} -> -1 + x, {2, 48} -> -1 - x, {3, 
   3} -> -E^(I (t - x)) (1 + x), {3, 4} -> 
  E^(I (t + x)) (-1 + x), {3, 47} -> E^(I (b - x)) (1 - x), {3, 48} ->
   E^(I (b + x)) (1 + x), {4, 45} -> 
  E^((I x)/2) (1 + x), {4, 46} -> -E^(-((I x)/2)) (-1 + x), {4, 
   47} -> -E^(I (b - x)) (1 + x), {4, 48} -> 
  E^(I (b + x)) (-1 + x), {5, 1} -> -E^(-((I x)/2)) (1 + x), {5, 2} ->
   E^((I x)/2) (-1 + x), {5, 5} -> (-1)^(5/6) E^(
   I (b - x)) (-1 + x), {5, 6} -> 
  E^(1/6 I (6 b - \[Pi] + 6 x)) (1 + x), {6, 3} -> 1 + x, {6, 4} -> 
  1 - x, {6, 5} -> (-1)^(5/6) E^(I (b - x)) (1 + x), {6, 6} -> 
  E^(1/6 I (6 b - \[Pi] + 6 x)) (-1 + x), {7, 3} -> -1 + x, {7, 
   4} -> -1 - x, {7, 5} -> 1 + x, {7, 6} -> 
  1 - x, {8, 1} -> -E^(-((I x)/2)) (-1 + x), {8, 2} -> 
  E^((I x)/2) (1 + x), {8, 5} -> -1 + x, {8, 6} -> -1 - x, {9, 1} -> 
  E^((I x)/2) (-1 + x), {9, 2} -> -E^(-((I x)/2)) (1 + x), {9, 7} -> 
  E^(1/3 I (-3 b + \[Pi] + 3 x)) (1 + x), {9, 
   8} -> -(-1)^(1/3) E^(-I (b + x)) (-1 + x), {10, 7} -> 
  E^(1/3 I (-3 b + \[Pi] + 3 x)) (-1 + x), {10, 
   8} -> -(-1)^(1/3) E^(-I (b + x)) (1 + x), {10, 
   11} -> -E^(-((I x)/2)) (-1 + x), {10, 12} -> 
  E^((I x)/2) (1 + x), {11, 7} -> 1 - x, {11, 8} -> 
  1 + x, {11, 11} -> -E^(-((I x)/2)) (1 + x), {11, 12} -> 
  E^((I x)/2) (-1 + x), {12, 1} -> 
  E^((I x)/2) (1 + x), {12, 2} -> -E^(-((I x)/2)) (-1 + x), {12, 
   7} -> -1 - x, {12, 8} -> -1 + x, {13, 
   9} -> -E^(-((I x)/2)) (1 + x), {13, 10} -> 
  E^((I x)/2) (-1 + x), {13, 13} -> 
  I E^(I (b - x)) (-1 + x), {13, 14} -> -I E^(I (b + x)) (1 + x), {14,
    11} -> E^((I x)/2) (1 + x), {14, 
   12} -> -E^(-((I x)/2)) (-1 + x), {14, 13} -> 
  I E^(I (b - x)) (1 + x), {14, 14} -> -I E^(I (b + x)) (-1 + x), {15,
    11} -> E^((I x)/2) (-1 + x), {15, 
   12} -> -E^(-((I x)/2)) (1 + x), {15, 13} -> 1 + x, {15, 14} -> 
  1 - x, {16, 9} -> -E^(-((I x)/2)) (-1 + x), {16, 10} -> 
  E^((I x)/2) (1 + x), {16, 13} -> -1 + x, {16, 14} -> -1 - x, {17, 
   9} -> E^((I x)/2) (-1 + x), {17, 
   10} -> -E^(-((I x)/2)) (1 + x), {17, 17} -> 
  E^(1/3 I (-3 b + 2 \[Pi] + 3 x)) (1 + x), {17, 
   18} -> -(-1)^(2/3) E^(-I (b + x)) (-1 + x), {18, 
   15} -> -E^(-((I x)/2)) (-1 + x), {18, 16} -> 
  E^((I x)/2) (1 + x), {18, 17} -> 
  E^(1/3 I (-3 b + 2 \[Pi] + 3 x)) (-1 + x), {18, 
   18} -> -(-1)^(2/3) E^(-I (b + x)) (1 + x), {19, 
   15} -> -E^(-((I x)/2)) (1 + x), {19, 16} -> 
  E^((I x)/2) (-1 + x), {19, 17} -> 1 - x, {19, 18} -> 
  1 + x, {20, 9} -> 
  E^((I x)/2) (1 + x), {20, 10} -> -E^(-((I x)/2)) (-1 + x), {20, 
   17} -> -1 - x, {20, 18} -> -1 + x, {21, 19} -> (-1)^(1/6) E^(
   I (b - x)) (-1 + x), {21, 20} -> 
  E^(1/6 I (6 b - 5 \[Pi] + 6 x)) (1 + x), {21, 
   21} -> -E^(-((I x)/2)) (1 + x), {21, 22} -> 
  E^((I x)/2) (-1 + x), {22, 15} -> 
  E^((I x)/2) (1 + x), {22, 16} -> -E^(-((I x)/2)) (-1 + x), {22, 
   19} -> (-1)^(1/6) E^(I (b - x)) (1 + x), {22, 20} -> 
  E^(1/6 I (6 b - 5 \[Pi] + 6 x)) (-1 + x), {23, 15} -> 
  E^((I x)/2) (-1 + x), {23, 16} -> -E^(-((I x)/2)) (1 + x), {23, 
   19} -> 1 + x, {23, 20} -> 
  1 - x, {24, 19} -> -1 + x, {24, 20} -> -1 - x, {24, 
   21} -> -E^(-((I x)/2)) (-1 + x), {24, 22} -> 
  E^((I x)/2) (1 + x), {25, 21} -> 
  E^((I x)/2) (-1 + x), {25, 22} -> -E^(-((I x)/2)) (1 + x), {25, 
   23} -> E^(I (-b + \[Pi] + x)) (1 + x), {25, 24} -> 
  E^(-I (b + x)) (-1 + x), {26, 23} -> 
  E^(I (-b + \[Pi] + x)) (-1 + x), {26, 24} -> 
  E^(-I (b + x)) (1 + x), {26, 27} -> -E^(-((I x)/2)) (-1 + x), {26, 
   28} -> E^((I x)/2) (1 + x), {27, 23} -> 1 - x, {27, 24} -> 
  1 + x, {27, 27} -> -E^(-((I x)/2)) (1 + x), {27, 28} -> 
  E^((I x)/2) (-1 + x), {28, 21} -> 
  E^((I x)/2) (1 + x), {28, 22} -> -E^(-((I x)/2)) (-1 + x), {28, 
   23} -> -1 - x, {28, 24} -> -1 + x, {29, 
   25} -> -E^(-((I x)/2)) (1 + x), {29, 26} -> 
  E^((I x)/2) (-1 + x), {29, 29} -> -(-1)^(5/6) E^(
   I (b - x)) (-1 + x), {29, 30} -> (-1)^(5/6) E^(
   I (b + x)) (1 + x), {30, 27} -> 
  E^((I x)/2) (1 + x), {30, 28} -> -E^(-((I x)/2)) (-1 + x), {30, 
   29} -> -(-1)^(5/6) E^(I (b - x)) (1 + x), {30, 30} -> (-1)^(5/6)
    E^(I (b + x)) (-1 + x), {31, 27} -> 
  E^((I x)/2) (-1 + x), {31, 28} -> -E^(-((I x)/2)) (1 + x), {31, 
   29} -> 1 + x, {31, 30} -> 
  1 - x, {32, 25} -> -E^(-((I x)/2)) (-1 + x), {32, 26} -> 
  E^((I x)/2) (1 + x), {32, 29} -> -1 + x, {32, 30} -> -1 - x, {33, 
   35} -> -I E^(I (b - x)) (-1 + x), {33, 36} -> 
  I E^(I (b + x)) (1 + x), {33, 37} -> -E^(-((I x)/2)) (1 + x), {33, 
   38} -> E^((I x)/2) (-1 + x), {34, 31} -> 
  E^((I x)/2) (1 + x), {34, 32} -> -E^(-((I x)/2)) (-1 + x), {34, 
   35} -> -I E^(I (b - x)) (1 + x), {34, 36} -> 
  I E^(I (b + x)) (-1 + x), {35, 31} -> 
  E^((I x)/2) (-1 + x), {35, 32} -> -E^(-((I x)/2)) (1 + x), {35, 
   35} -> 1 + x, {35, 36} -> 
  1 - x, {36, 35} -> -1 + x, {36, 36} -> -1 - x, {36, 
   37} -> -E^(-((I x)/2)) (-1 + x), {36, 38} -> 
  E^((I x)/2) (1 + x), {37, 43} -> -(-1)^(1/6) E^(
   I (b - x)) (-1 + x), {37, 44} -> (-1)^(1/6) E^(
   I (b + x)) (1 + x), {37, 45} -> -E^(-((I x)/2)) (1 + x), {37, 
   46} -> E^((I x)/2) (-1 + x), {38, 39} -> 
  E^((I x)/2) (1 + x), {38, 40} -> -E^(-((I x)/2)) (-1 + x), {38, 
   43} -> -(-1)^(1/6) E^(I (b - x)) (1 + x), {38, 44} -> (-1)^(1/6)
    E^(I (b + x)) (-1 + x), {39, 39} -> 
  E^((I x)/2) (-1 + x), {39, 40} -> -E^(-((I x)/2)) (1 + x), {39, 
   43} -> 1 + x, {39, 44} -> 
  1 - x, {40, 43} -> -1 + x, {40, 44} -> -1 - x, {40, 
   45} -> -E^(-((I x)/2)) (-1 + x), {40, 46} -> 
  E^((I x)/2) (1 + x), {41, 25} -> 
  E^((I x)/2) (-1 + x), {41, 26} -> -E^(-((I x)/2)) (1 + x), {41, 
   33} -> E^(1/3 I (-3 b + 4 \[Pi] + 3 x)) (1 + x), {41, 34} -> (-1)^(
   1/3) E^(-I (b + x)) (-1 + x), {42, 
   31} -> -E^(-((I x)/2)) (-1 + x), {42, 32} -> 
  E^((I x)/2) (1 + x), {42, 33} -> 
  E^(1/3 I (-3 b + 4 \[Pi] + 3 x)) (-1 + x), {42, 34} -> (-1)^(1/3)
    E^(-I (b + x)) (1 + x), {43, 31} -> -E^(-((I x)/2)) (1 + x), {43, 
   32} -> E^((I x)/2) (-1 + x), {43, 33} -> 1 - x, {43, 34} -> 
  1 + x, {44, 25} -> 
  E^((I x)/2) (1 + x), {44, 26} -> -E^(-((I x)/2)) (-1 + x), {44, 
   33} -> -1 - x, {44, 34} -> -1 + x, {45, 37} -> 
  E^((I x)/2) (-1 + x), {45, 38} -> -E^(-((I x)/2)) (1 + x), {45, 
   41} -> E^(1/3 I (-3 b + 5 \[Pi] + 3 x)) (1 + x), {45, 42} -> (-1)^(
   2/3) E^(-I (b + x)) (-1 + x), {46, 
   39} -> -E^(-((I x)/2)) (-1 + x), {46, 40} -> 
  E^((I x)/2) (1 + x), {46, 41} -> 
  E^(1/3 I (-3 b + 5 \[Pi] + 3 x)) (-1 + x), {46, 42} -> (-1)^(2/3)
    E^(-I (b + x)) (1 + x), {47, 39} -> -E^(-((I x)/2)) (1 + x), {47, 
   40} -> E^((I x)/2) (-1 + x), {47, 41} -> 1 - x, {47, 42} -> 
  1 + x, {48, 37} -> 
  E^((I x)/2) (1 + x), {48, 38} -> -E^(-((I x)/2)) (-1 + x), {48, 
   41} -> -1 - x, {48, 42} -> -1 + x, {_, _} -> 0}

$\endgroup$
4
  • 1
    $\begingroup$ from SomeNotesOnInternalImplementation it says for symbolic det Det uses direct cofactor expansion for small matrices and Gaussian elimination for larger ones. and for numerical Det Det use Gaussian elimination with partial pivoting My guess is that for symbolic, cofactor expansion will be slow due to expression swelling. I am not sure if Mathematica automatically symplifies things as it run symbolic Det. Symbolic det always been know to be slower than numerical. $\endgroup$
    – Nasser
    Dec 3, 2022 at 1:26
  • $\begingroup$ Thanks for the comment. $\endgroup$
    – mathchem
    Dec 3, 2022 at 1:28
  • $\begingroup$ Please post your matrix, or a reduced example, so that people here can experiment quantitatively and make concrete suggestions. $\endgroup$
    – Roman
    Dec 3, 2022 at 16:41
  • $\begingroup$ @Roman I have added $SPARSE$ to the text, you can see my matrix by the code M = SparseArray[SPARSE, {48, 48}] which is 48 dimensional. $\endgroup$
    – mathchem
    Dec 3, 2022 at 21:13

1 Answer 1

1
$\begingroup$

This is not really an answer but a list of comments and suggestions.

  1. Unless a lot of terms cancel, your answer will be enormous. Is this likely to be useful to you?
  2. Do you have some reason to think the answer should be a simple expression? If so, can you use it to find a clever way to compute the determinant?
  3. Might the answer be zero? You might substitute numerical values for your variables and check the value. This computation should be quick.
  4. Are you actually only interested in the determinant for small values of your variables? Would a series expansion approximating only the leading term help?
  5. Numeric approximation with values of your variables in the range of interest might allow you to approximate the result (by interpolation).
  6. I think that computation of the full determinant will effectively involve the computation of the determinant of every square submatrix. You might try taking (say) the top-left 6x6 submatrix, computing the determinant of that and see if you feel enlightened by the result.
  7. Does your matrix have any structure that you can exploit? If the repeated elements occur in regular patterns, there may be special techniques available to you. If you are unsure what these, you might post another question explaining the structure and asking for suggestions.
$\endgroup$
2
  • $\begingroup$ Thanks for the comment. I have added $SPARSE$ to the text, you can see my matrix by the code M = SparseArray[SPARSE, {48, 48}] which is $48$ dimensional. One of your comments (n.4) can also help me partially, if I am interested in the determinants for large $x\to\infty$ is it possible to find the leading term? $\endgroup$
    – mathchem
    Dec 3, 2022 at 16:02
  • $\begingroup$ @mathchem I suggest that you ask a new question named e.g. "Determinant of Sparse Matrix". A new question will with a suitable title is more likely to get attention now. $\endgroup$
    – mikado
    Dec 4, 2022 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.