Generally, it's a bad idea to mix up symbolic variables with exact rings.
Since the equations you are solving are polynomial, it's better to define a,b,c
as polynomial variables and use polynomial ideals machinery for solving the equations. Unfortunately, it does not support field extensions, and so we'd need to use a workaround of using the absolute field, say in a variable z
, and mapping equations into there for solving.
The resulting code becomes:
K1.<j,k> = NumberField([x^2+x+1, 2*x^2 + 3*x + 3])
AF.<z> = K1.absolute_field()
print(AF)
to_K1, to_AF = AF.structure()
R.<a,b,c> = AF[]
u = Matrix(1,3,[a,b,c]).transpose()
A2 = Matrix(3,3,[[1,0,0],[0,j,0],[0,0,j^2]]).apply_map(to_AF)
A3 = Matrix(3,3,[[1,k*j,k*j^2],[k*j,j^2,k],[k*j^2,k,j]]).apply_map(to_AF)
J = R.ideal([(u.transpose()*A2*u)[0][0], (u.transpose()*A3*u)[0][0], a-1])
S = J.variety()
print('Solutions in AF:', S)
print('Solutions in K1:', [{v:to_K1(s) for v,s in sol.items()} for sol in S])
which prints:
Number Field in z with defining polynomial x^4 + 4*x^3 + 15*x^2 + 22*x + 19
Solutions in AF: [{c: 1, b: 1, a: 1}, {c: 1/6*z^2 + 1/2*z + 5/6, b: 1/18*z^3 + 1/3*z - 11/18, a: 1}, {c: -1/2*z^2 - 3/2*z - 5/2, b: -1/6*z^3 - 1/3*z^2 - 2/3*z - 1/2, a: 1}, {c: 1/3*z^3 + 5/6*z^2 + 19/6*z + 7/6, b: -1/6*z^3 - z + 11/6, a: 1}]
Solutions in K1: [{c: 1, b: 1, a: 1}, {c: (2/3*k + 2/3)*j + 2/3*k + 1/3, b: (-2/3*k - 2/3)*j - 1/3, a: 1}, {c: (-2*k - 2)*j - 2*k - 1, b: (2/3*k + 2)*j + 4/3*k + 1, a: 1}, {c: (-2/3*k - 2)*j + 2/3*k - 1, b: (2*k + 2)*j + 1, a: 1}]