# SageMath code for working with number field 38.0.10456376296029042882633731329285387968875960938724861754483238620568507960573755104483627713707.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^38 - x^37 + 109*x^36 - 318*x^35 + 7607*x^34 - 26082*x^33 + 346271*x^32 - 1277601*x^31 + 11625429*x^30 - 40847577*x^29 + 278354747*x^28 - 890102893*x^27 + 4876149460*x^26 - 13377962627*x^25 + 59213347219*x^24 - 129738898417*x^23 + 497734200105*x^22 - 864588650146*x^21 + 3071362959747*x^20 - 3938571660134*x^19 + 13635086341776*x^18 - 11900678948488*x^17 + 45427254629183*x^16 - 23117165748554*x^15 + 104447793269632*x^14 - 20670309199584*x^13 + 172563580620384*x^12 + 14666610274324*x^11 + 167592119930922*x^10 + 69948796872392*x^9 + 125341715722354*x^8 + 63681900889938*x^7 + 64136735752211*x^6 + 36520042111943*x^5 + 22298249070088*x^4 + 8329262399475*x^3 + 2645555104756*x^2 + 468857415513*x + 63175314409)
# 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^38 - x^37 + 109*x^36 - 318*x^35 + 7607*x^34 - 26082*x^33 + 346271*x^32 - 1277601*x^31 + 11625429*x^30 - 40847577*x^29 + 278354747*x^28 - 890102893*x^27 + 4876149460*x^26 - 13377962627*x^25 + 59213347219*x^24 - 129738898417*x^23 + 497734200105*x^22 - 864588650146*x^21 + 3071362959747*x^20 - 3938571660134*x^19 + 13635086341776*x^18 - 11900678948488*x^17 + 45427254629183*x^16 - 23117165748554*x^15 + 104447793269632*x^14 - 20670309199584*x^13 + 172563580620384*x^12 + 14666610274324*x^11 + 167592119930922*x^10 + 69948796872392*x^9 + 125341715722354*x^8 + 63681900889938*x^7 + 64136735752211*x^6 + 36520042111943*x^5 + 22298249070088*x^4 + 8329262399475*x^3 + 2645555104756*x^2 + 468857415513*x + 63175314409)
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)]