Ask Your Question

yorgos_sot's profile - activity

2024-01-29 19:19:09 +0200 received badge  Popular Question (source)
2023-09-18 22:59:12 +0200 received badge  Notable Question (source)
2023-01-01 22:18:48 +0200 received badge  Popular Question (source)
2021-05-27 23:34:05 +0200 commented question Set Precision or Decimal places in symbolic expression

Thank you! Worked like a charm!

2021-05-27 23:33:16 +0200 commented answer is it possible to round numbers in symbolic expression

A small improvement to the code proposed so as to prevent integers from being cast to float as I noticed that this was t

2021-05-27 16:34:00 +0200 asked a question Set Precision or Decimal places in symbolic expression

Set Precision or Decimal places in symbolic expression Hello. I am currently working with some cumbersome symbolic expre

2021-04-29 00:15:12 +0200 received badge  Nice Question (source)
2021-04-28 17:37:06 +0200 commented answer Issue with inversion of complex symbolic array initialized with numpy

Thank you so much. I would like to also add something that I had to modify in my code. Because I use python, I had to

2021-04-28 17:33:31 +0200 marked best answer Issue with inversion of complex symbolic array initialized with numpy

Hello!

I am trying to invert a symbolic matrix that is initialized with a combination of numpy arrays and I get an error. Below i present a simple code that gives the error.

import numpy as np

a = np.zeros((5,5) , dtype = 'complex')
np.fill_diagonal(a,1)

b = var('x')*a

c = matrix(b)
c.inverse()

Gives the error:

ECL says: THROW: The catch MACSYMA-QUIT is undefined.

What I have noticed up until now is that the issue stems from the data type. When I try casting the numpy array to float before turning it into a matrix, it works. However, my actual code makes use of complex coefficients. I believe it might have to do with how the imaginary part is represented in SageMath in comparison to numpy. ( j vs I )

When I manually create the symbolic array with I for the imaginary part, the .inverse() has no issue.

2021-04-28 17:33:31 +0200 received badge  Scholar (source)
2021-04-28 17:33:29 +0200 received badge  Supporter (source)
2021-04-28 14:46:08 +0200 received badge  Student (source)
2021-04-28 13:44:02 +0200 asked a question Issue with inversion of complex symbolic array initialized with numpy

Issue with inversion of complex symbolic array initialized with numpy Hello! I am trying to invert a symbolic matrix t