Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

"{{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:

(* True *)

(* True *)

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

share|improve this question
While Im[Ω[0.01]] is positive definite, Ω[0.01] is not. – bill s Jun 26 '13 at 20:43
Note that Ω[0.01][[2, 1]] === Ω[0.01][[1, 2]] returns False. Also, examine this: Rationalize[#, 0] &@Ω[0.01] – Sjoerd C. de Vries Jun 26 '13 at 20:53
If you remove the N from the definition of M, you have SymmetricMatrixQ@Ω[0.01] (-> True) – Jacob Akkerboom Jun 26 '13 at 21:12
@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? – Skyler Jun 26 '13 at 21:17
How about: SiegelTheta[(Ω[0.01] + Transpose[Ω[0.01]])/2,s] – Sjoerd C. de Vries Jun 26 '13 at 21:21

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
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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