title: Conditional definition of matrix elements in sage
body: <p>In Sage, trying to define a matrix with conditions for the cells by:</p>
  
  <pre><code>matrix([[(if gcd(i, j) == 0: log(radical((i+j)*i*j)) else: -1.0) for j in srange(1, 5)] for i in srange(1, 5)])
  </code></pre>
  
  <p>I get a syntax error:</p>
  
  <pre><code>...
  matrix([[(if gcd(i, j) == _sage_const_0 : log(radical((i+j)*i*j)) else: -_sage_const_1p0 ) for j in srange(_sage_const_1 , _sage_const_5 )] for i in srange(_sage_const_1 , _sage_const_5 )])
             ^
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>What is the problem here? How to fix that?</p>