Ask Your Question
0

hi any help with TypeError: unable to convert b to an integer

asked 2023-10-23 23:25:17 +0200

updated 2023-10-24 11:33:54 +0200

Max Alekseyev gravatar image

I have the following segment:

M=matrix([[-3,1,1,1],[1,-3,1,1],[1,1,-3,1],[1,1,1,-3]])

b=var("b");
v = vector([1,b,b**2,b**3]);
AUG=M.augment(v,subdivide=true)

---------------------------------------------------------------------------

TypeError: unable to convert b to an integer
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-10-24 06:08:13 +0200

Max Alekseyev gravatar image

updated 2023-10-24 11:32:21 +0200

If you want to augment M with symbolic elements it needs to be defined over the symbolic ring SR. You can do so upfront via

M = matrix(SR, [[-3,1,1,1],[1,-3,1,1],[1,1,-3,1],[1,1,1,-3]])

Alternatively, you can keep the original definition of M intact, but change its ring just before the augmenation:

AUG = M.change_ring(SR).augment(v,subdivide=true)
edit flag offensive delete link more

Comments

That works..Thank you for the solution!

KostasT gravatar imageKostasT ( 2023-10-24 09:19:48 +0200 )edit

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-10-23 23:25:17 +0200

Seen: 76 times

Last updated: Oct 24 '23