10
$\begingroup$

Bug introduced in 8.0 or earlier and persists through 12.1 or later. Fixed in 13.2.0 or earlier


This may or may not be related to the bug reported in this question.

I was trying to verify the results of this challenge over on Code Golf with the following code:

p = {{5., 2., 0., 0.}, {2., 5., 2., -2.}, {0., 2., 5., 0.}, {0., -2., 0., 5.}}
SiegelTheta[I*p/Pi, ConstantArray[0, Length@p]]

While I do get the correct result, SiegelTheta throws a bunch of of messages via Range along the lines of:

Range::range: "Range specification in Range[-I,I] does not have appropriate bounds."

I've verified this with all of the example matrices in the linked challenge - the larger the matrix, the more of these messages are thrown. The same happens when I generate random positive definite matrices myself with the following code:

n = 5;
m = RandomChoice[{-1, 1}, {n, n}]
p = N@IdentityMatrix[n] + m\[Transpose].m;
PositiveDefiniteMatrixQ@p
SiegelTheta[I*p/Pi, ConstantArray[0, n]]

I have contacted Wolfram Support and they confirmed that this is a bug. If anyone can reproduce it in earlier Mathematica version, feel free to update the header.

$\endgroup$
3
  • 3
    $\begingroup$ Using TracePrint[SiegelTheta[(* stuff *)], Range[__], TraceInternal -> True] reveals that an internal auxiliary routine is making the bad Range[] call, so I would consider this a bug. Comparison with the result from version 5.2 (when SiegelTheta[] was a package function as opposed to a built-in) shows consistent results, so the sum is being computed correctly despite the bug. Please file a report when you find the time. $\endgroup$ Commented Apr 5, 2016 at 12:04
  • 1
    $\begingroup$ P.S. if you want to scare the people at code golf with the complexity of the problem, link them to this paper. $\endgroup$ Commented Apr 5, 2016 at 12:07
  • 1
    $\begingroup$ Just got an email from Wolfram Support that this is supposedly fixed in the latest version, but haven't tested it myself yet. $\endgroup$ Commented Oct 18, 2021 at 14:37

1 Answer 1

1
$\begingroup$

Status update: in 13.2.0 we get

screenshot

The code is provided below -see also OP:

p = {{5., 2., 0., 0.}, {2., 5., 2., -2.}, {0., 2., 5., 0.}, {0., -2., 0., 5.}}
SiegelTheta[I*p/Pi, ConstantArray[0, Length@p]]

n = 5;
m = RandomChoice[{-1, 1}, {n, n}]
p = N@IdentityMatrix[n] + m\[Transpose].m;
PositiveDefiniteMatrixQ@p
SiegelTheta[I*p/Pi, ConstantArray[0, n]]
$\endgroup$
2
  • $\begingroup$ Code should be included in a copyable form. $\endgroup$
    – Artes
    Commented Jan 11, 2023 at 16:50
  • $\begingroup$ @Artes thanks for the comment. My reasoning is the following: in these type of status update answers where a situation is resolved, the code can be grabbed from the OP. I think it to be more important that with a specific version things run smoothly and thus I provided a screenshot. I will include the code for completeness though, since you brought it up. In previous situations, there were no complaints $\endgroup$
    – bmf
    Commented Jan 12, 2023 at 0:54

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.