Ask Your Question

Revision history [back]

convert expression to QuadraticField

I tried (in the Sage shell)

K = QuadraticField(-3)
b = 1 / sqrt(-3) + (1 + sqrt(-3)) / 2

K(b)

But that failed with a TypeError exception. What is the problem?

convert expression to QuadraticField

I tried (in the Sage shell)

K a = QuadraticField(-3)
b = 1 / sqrt(-3) + (1 + sqrt(-3)) / 2

K(b)
QuadraticField(-3)(sqrt(-3))

But that failed fails with a TypeError exception. What is the problem?

convert expression to QuadraticField

I tried (in the Sage shell)

K = QuadraticField(-3)
a = QuadraticField(-3)(sqrt(-3))
K(sqrt(-3))

But that fails with a TypeError exception. What is the problem?

I know that I can get the generator by K.gen() but I want to be able to convert expressions to K.