17

Bug introduced in 10.1.0 and fixed in 10.3.0


I came across some strange behaviour during a computation involving matrices with symbolic values. It is reproduced below.

Multiplying a random 30x30 array with symbolic values with the identity matrix takes 4 seconds! Converting to a SparseArray seems to work, but I don't understand why it should since the matrix size is so small.

Mathematica Version is 10.1

aa = Table[RandomInteger[10] + Sqrt[RandomInteger[10]]/(1 + 
   Sqrt[RandomInteger[10]]), {30}, {30}];

IdentityMatrix[30].aa; // Timing

{3.95225, Null}

SparseArray[IdentityMatrix[30]].aa; // Timing

{0., Null}

ilian
  • 25,474
  • 4
  • 117
  • 186
A. Roy
  • 271
  • 1
  • 3

1 Answers1

3

This bug has been fixed as of Mathematica 10.3.

$Version

(* "10.3.0 for Mac OS X x86 (64-bit) (October 9, 2015)" *)

aa = Table[RandomInteger[10] + 
       Sqrt[RandomInteger[10]]/(1 + Sqrt[RandomInteger[10]]), {30}, {30}];

IdentityMatrix[30].aa; // Timing

(* {0.028025, Null} *)
ilian
  • 25,474
  • 4
  • 117
  • 186