# How to compute the disciminant of QQ(\sqrt[3]{m}) using Sage's symbolic computations capabilities R = QQ['m'] # m here is a variable m = R.gen() x = polygen(R) # a variable over R A = R.extension(x^3 - m, 'a') # a here will be \sqrt[3]{m} a = A.gen() # I define the trace pairing function def trace_pairing(ring, elements): k = len(elements) T = matrix(R,k,k) # an k by k matrix over R for [i, j] in CartesianProduct(range(0,k), range(0,k)): T[i,j] = (ring(elements[i]) * ring(elements[j])).trace() # coerces the elements to a ring with trace return T # if m equiv 1 mod 9 then an integral basis is given by 1, a, (1+a+a^2)/3 T = trace_pairing(A, [1, a, (1+a+a^2)*(1/3)]) # also must do () * (1/3) instead of ()/3 because of a quirk in Sage # whereby ()/3 thinks of 3 in A which is not a field, whereas ()*(1/3) is just ring multiplication T.det()