Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linear Algebra API - Part I : Vector and Matrix #150

Open
5 tasks
ratnania opened this issue Mar 6, 2024 · 3 comments
Open
5 tasks

Linear Algebra API - Part I : Vector and Matrix #150

ratnania opened this issue Mar 6, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@ratnania
Copy link
Contributor

ratnania commented Mar 6, 2024

Up to now, we were relying on sympy.Matrix and its variants to handle our Linear Algebra operations.
It is now time to have our own Linear Algebra building blocks, and it starts with the Vector and Matrix objects.
This issue aims to:

  • have a new API for Vector and Matrix
  • remove the use of Tuple from all our examples (sympde and psydac)
  • remove the use of sympy.Matrix-like objects appearing inside sympde, when possible

The new objects should be used in two different ways:

  • As containers. example:
b = Vector([1.,2.,3.], name='b')
M = Matrix([[1.,2.],[3.,4.]], name='M')
  • as variables. example:
b = Vector(name='b', is_real=True)
M = Matrix(name='M', is_complex=True)

in the which case, these variables will appear as free-variables in our expressions (linear, bilinear forms, etc)

@ratnania ratnania added the enhancement New feature or request label Mar 6, 2024
@ratnania ratnania self-assigned this Mar 6, 2024
@yguclu
Copy link
Member

yguclu commented Mar 6, 2024

I feel that we need to clarify what kind of entries are allowed in a Vector or Matrix.

If any expression of the spatial coordinates is allowed, then it behaves just like a Function, but without specifying the arguments. In fact, it would seem natural to subclass Function to get the classes ScalarFunction, VectorFunction, and MatrixFunction. Of course this would create a conflict with the pre-exististing classes ScalarFunction and VectorFunction, which represent elements of a ScalarFunctionSpace and VectorFunctionSpace, respectively.

@ratnania
Copy link
Contributor Author

ratnania commented Mar 6, 2024

Yes, we should differentiate between a (Scalar/)Vector/Matrix valued functions and other expressions.
This means that we need to check, at the construction, that Vector/Matrix expressions do not contain the coordinates.
For the (Scalar/)Vector/Matrix valued functions, we'll move the discussion to the associated issue.

@yguclu yguclu transferred this issue from pyccel/IGA-Python Mar 6, 2024
@ratnania
Copy link
Contributor Author

ratnania commented Mar 8, 2024

This issue is closely related to #149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants