# Matrix symbolic definition for algebra

Is there a way to define variables as matrices and then perform simplification? For instance, instead of A=var('A') being a scalar variable, can A be defined as a matrix?

These are similar examples of what I am thinking. Is there similar functionality in Sagemath? https://www.diva-portal.org/smash/get...https://ieeexplore.ieee.org/document/...