The discriminant DKD_K of a number field KK is the of any (ω1,,ωn)(\omega_1,\ldots,\omega_n):

DK=det(TrK/Q(ωiωj))i,j=1n.D_K=\det\bigl(\operatorname{Tr}_{K/\mathbb Q}(\omega_i\omega_j)\bigr)_{i,j=1}^n.

It is a nonzero integer independent of the chosen integral basis. The absolute discriminant is DK|D_K|.

Independence

An integral change of basis has determinant ±1\pm1. It changes the trace matrix to PTTPP^{\mathsf T}TP, leaving its determinant unchanged. An arbitrary rational basis need not give the same number.

Imaginary quadratic case

For K=Q(d)K=\mathbb Q(\sqrt{-d}), d>0d>0 square-free, the gives

DK={d,d3(mod4),4d,d1,2(mod4).D_K=\begin{cases}-d,&d\equiv3\pmod4,\\-4d,&d\equiv1,2\pmod4.\end{cases}

Thus DQ(i)=4D_{\mathbb Q(i)}=-4, while DQ(3)=3D_{\mathbb Q(\sqrt{-3})}=-3.

References
  1. J. S. Milne, Algebraic Number Theory, v3.08. Author’s text, §2, “Discriminants,” and Definition 2.32.