4
$\begingroup$

SiegelTheta often returns error messages when I give it arguments that should be of the correct form. For instance, I have a numerical matrix like

M = N[{{1 + π/2, -1, 1 - π/2}, {-1, 1 + π/2, -1}, {1 - π/2, -1, 1 + π/2}}];

and I want to evaluate SiegelTheta[Ω[0.01], s], where

Ω[r_] := I*Inverse[M]/r

s = {0, 0, 0};

but I get the following error message:

SiegelTheta::invmat:
"{{0. + 56.831I,0. + 31.831I,0. + 25.I},{0. + 31.831I,0. + 63.662I,0. +31.831I},
{0. + 25.I,0. + 31.831I,0. + 56.831I}} must be a symmetric matrix with a positive definite 
imaginary part."

However, Ω[0.01] does satisfy those conditions, even according to Mathematica:

PositiveDefiniteMatrixQ[Im[Ω[0.01]]]
(* True *)

SymmetricMatrixQ[Ω[0.01]]
(* True *)

I would appreciate any help resolving this issue. I am using Mathematica version 9.0.1.

$\endgroup$
  • $\begingroup$ While Im[Ω[0.01]] is positive definite, Ω[0.01] is not. $\endgroup$ – bill s Jun 26 '13 at 20:43
  • 2
    $\begingroup$ Note that Ω[0.01][[2, 1]] === Ω[0.01][[1, 2]] returns False. Also, examine this: Rationalize[#, 0] &@Ω[0.01] $\endgroup$ – Sjoerd C. de Vries Jun 26 '13 at 20:53
  • 1
    $\begingroup$ If you remove the N from the definition of M, you have SymmetricMatrixQ@Ω[0.01] (-> True) $\endgroup$ – Jacob Akkerboom Jun 26 '13 at 21:12
  • 1
    $\begingroup$ @Sjoerd: You're right, I see. It seems from the source code that SiegelTheta determines whether the input matrix is symmetric by subtracting the transpose and finding whether the result is the zero matrix. And while Ω[0.01] == Transpose[Ω[0.01]] evaluates as True, apparently the difference between Ω[0.01] and its transpose is not zero (for instance MatrixRank[Ω[0.01] - Transpose[Ω[0.01]]] evaluates to 2). Do you have any suggestions for how to get around this and get an answer from SiegelTheta? $\endgroup$ – Skyler Jun 26 '13 at 21:17
  • 3
    $\begingroup$ How about: SiegelTheta[(Ω[0.01] + Transpose[Ω[0.01]])/2,s] $\endgroup$ – Sjoerd C. de Vries Jun 26 '13 at 21:21
1
$\begingroup$

Apart from Sjoerd's suggestion of taking the symmetric part of your matrix (mat + Transpose[mat])/2, here is another way:

makesym[mat_?SquareMatrixQ] := 
        UpperTriangularize[mat] + Transpose[UpperTriangularize[mat, 1]]

SiegelTheta[Ω[0.01] // makesym, s]
   1. + 0.*I
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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