# SageMath code for working with number field 37.37.81381208133441979421709122744091225498491936628940230588748580298513087650630871328595025812353503688138712627681.1
# Some of these functions may take a long time to execute (this depends on the field).
# Define the number field:
x = polygen(QQ); K. = NumberField(x^37 - 666*x^35 - 481*x^34 + 193399*x^33 + 256521*x^32 - 32436827*x^31 - 60004084*x^30 + 3503452596*x^29 + 8113398850*x^28 - 257000630926*x^27 - 704292185114*x^26 + 13150853376643*x^25 + 41268101524916*x^24 - 474337598223255*x^23 - 1672482254287228*x^22 + 12032466243732809*x^21 + 47286637172470867*x^20 - 211502629431882231*x^19 - 929675982328753625*x^18 + 2498958523266151636*x^17 + 12536142236443615902*x^16 - 18791897342800992970*x^15 - 113239929214497210129*x^14 + 80927529107744817385*x^13 + 663966210336111429023*x^12 - 146546651897009713442*x^11 - 2439258160361411529393*x^10 - 154326326264692800324*x^9 + 5386184266991634344483*x^8 + 1055793633392402952768*x^7 - 6769150214799915444440*x^6 - 1552196159553019851407*x^5 + 4355671676506075568364*x^4 + 921754431147330625307*x^3 - 1108584774969076393499*x^2 - 217498966742521653325*x + 51140551819476687829)
# Defining polynomial:
K.defining_polynomial()
# Degree over Q:
K.degree()
# Signature:
K.signature()
# Discriminant:
K.disc()
# Ramified primes:
K.disc().support()
# Autmorphisms:
K.automorphisms()
# Integral basis:
K.integral_basis()
# Class group:
K.class_group().invariants()
# Unit group:
UK = K.unit_group()
# Unit rank:
UK.rank()
# Generator for roots of unity:
UK.torsion_generator()
# Fundamental units:
UK.fundamental_units()
# Regulator:
K.regulator()
# Analytic class number formula:
# self-contained SageMath code snippet to compute the analytic class number formula
x = polygen(QQ); K. = NumberField(x^37 - 666*x^35 - 481*x^34 + 193399*x^33 + 256521*x^32 - 32436827*x^31 - 60004084*x^30 + 3503452596*x^29 + 8113398850*x^28 - 257000630926*x^27 - 704292185114*x^26 + 13150853376643*x^25 + 41268101524916*x^24 - 474337598223255*x^23 - 1672482254287228*x^22 + 12032466243732809*x^21 + 47286637172470867*x^20 - 211502629431882231*x^19 - 929675982328753625*x^18 + 2498958523266151636*x^17 + 12536142236443615902*x^16 - 18791897342800992970*x^15 - 113239929214497210129*x^14 + 80927529107744817385*x^13 + 663966210336111429023*x^12 - 146546651897009713442*x^11 - 2439258160361411529393*x^10 - 154326326264692800324*x^9 + 5386184266991634344483*x^8 + 1055793633392402952768*x^7 - 6769150214799915444440*x^6 - 1552196159553019851407*x^5 + 4355671676506075568364*x^4 + 921754431147330625307*x^3 - 1108584774969076393499*x^2 - 217498966742521653325*x + 51140551819476687829)
DK = K.disc(); r1,r2 = K.signature(); RK = K.regulator(); RR = RK.parent()
hK = K.class_number(); wK = K.unit_group().torsion_generator().order();
2^r1 * (2*RR(pi))^r2 * RK * hK / (wK * RR(sqrt(abs(DK))))
# Intermediate fields:
K.subfields()[1:-1]
# Galois group:
K.galois_group(type='pari')
# Frobenius cycle types:
# to obtain a list of $[e_i,f_i]$ for the factorization of the ideal $p\mathcal{O}_K$ for $p=7$ in Sage:
p = 7; [(e, pr.norm().valuation(p)) for pr,e in K.factor(p)]