Skip to content

Allow more elementwise simplifications for symbolic matrices #10552

Open
@kcrisman

Description

@kcrisman

As with several questions at ask.sagemath. Mike Hansen's answer at the first one seems like a good start:

age: m = matrix([[sin(x), cos(x)], [sin(x), cos(x)]]); m
[sin(x) cos(x)]
[sin(x) cos(x)]
sage: o = m*m.transpose(); o
[sin(x)^2 + cos(x)^2 sin(x)^2 + cos(x)^2]
[sin(x)^2 + cos(x)^2 sin(x)^2 + cos(x)^2]
sage: o.apply_map(lambda x: x.trig_reduce())
[1 1]
[1 1]

but it seems reasonable for matrices with symbolic elements to have some of these methods (also vectors, I suppose) without having to use any special terminology.

Open to suggestions on how that might be accomplished without creating a myriad of special methods, but by somehow piggybacking on symbolic.expression.Expression methods done elementwise...

Putting this under symbolics because it isn't really linear algebra, but that doesn't seem right either.

CC: @jasongrout @rbeezer

Component: symbolics

Keywords: matrix symbolic simplify expand

Author: Joris Vankerschaver

Reviewer: Karl-Dieter Crisman

Issue created by migration from https://trac.sagemath.org/ticket/10552

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions