Ask Your Question
0

Simplify an expression in symbolic matrix

asked 2023-09-04 15:00:12 +0100

updated 2023-09-04 15:02:48 +0100

I have the following vector: (-(q + 1/q)*q^2 + q^3 + q, 0, 0, 0, 0, 0, 0, 0) Which command should I use to make the above vector simplify to (0, 0, 0, 0, 0, 0, 0, 0) I tried .simplify_full and .simplify_rational, but it didn't work.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-09-04 23:05:42 +0100

Max Alekseyev gravatar image

updated 2023-09-04 23:09:57 +0100

First off, .simplify_full() does work for me - like in this example:

q = var('q')
v = vector( (-(q + 1/q)*q^2 + q^3 + q, 0, 0, 0, 0, 0, 0, 0) )
print( v.simplify_full() )

Alternatively, you can explicitly apply .simplify_full() to each element:

print( v.apply_map(lambda t: t.full_simplify()) )
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2023-09-04 15:00:12 +0100

Seen: 140 times

Last updated: Sep 04 '23