Discriminant of elements of a number field (source code)

= Discriminant of elements of a number field

For elements $\alpha_1,\ldots,\alpha_n$ of a degree-$n$ number field with embeddings $\sigma_1,\ldots,\sigma_n$, their discriminant is
$$
\operatorname{disc}(\alpha_1,\ldots,\alpha_n)
=\det(\sigma_i(\alpha_j))^2
=\det(\operatorname{Tr}_{K/\mathbb Q}(\alpha_i\alpha_j)).
$$
It is nonzero exactly when the elements form a $\mathbb Q$-basis.