Ask Your Question
0

Evaluate polynomial over extension ring

asked 2024-01-19 09:52:40 +0100

narodnik gravatar image

updated 2024-01-19 09:53:01 +0100

Given a ring and polynomial like:

_.<I> = RR[]
K.<i> = RR.extension(I^2 + 1)
L.<a, b> = K[]
f = a + i*b

then I would expect that f(i=0) would give me a. But instead it just returns the same value again.

Any ideas how to do this? Thanks

edit retag flag offensive close merge delete

Comments

1

Does not make really sense, but

sage: f.map_coefficients(lambda cf:cf[0])
a
FrédéricC gravatar imageFrédéricC ( 2024-01-19 12:12:20 +0100 )edit

thanks a lot!

narodnik gravatar imagenarodnik ( 2024-01-20 09:06:08 +0100 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2024-01-19 16:04:51 +0100

Max Alekseyev gravatar image

updated 2024-01-19 16:07:10 +0100

The issue here is that you want to make substitution not into f but into each of its coefficients. Direct approach using .map_coefficients() is given by @FrédéricC in the comments.

However, with the i being the imaginary unit, there is no need to define it over RR, since one can work in CC where the imaginary unit is already defined as I. So, you can go directly with

L.<a, b> = CC[]
f = a + I*b
f.map_coefficients(real)

Alternative general approach is to define all a, b, i as polynomial variables and work in the quotient ring:

F.<I,A,B> = RR[]
K.<i,a,b> = F.quotient( [I^2 + 1] )
f = a + i*b
f.lift().subs({I:0})

Instead of f.lift().subs({I:0}) giving result in F, you can use f.lift().specialization({I:0}), which gives result in the polynomial ring of A and B only.

edit flag offensive delete link more

Comments

thanks a lot! Gives me a load of stuff to look into now. Good day

narodnik gravatar imagenarodnik ( 2024-01-20 09:05:38 +0100 )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: 2024-01-19 09:52:40 +0100

Seen: 161 times

Last updated: Jan 19