Let $K$ be a number field, i.e. a finite extension of $\mathbb{Q}$. The ring of integer $O_K$ is a free $\mathbb{Z}$-module. Let $\{ a_1, \cdots , a_n\}$ be a integral basis of $O_K$. Then, $$ \Delta_{K/ \mathbb{Q}} = \det (\mathrm{Tr}(a_ia_j)_{i,j}) $$ is independent of choice of integral basis. We call $\Delta_{K/ \mathbb{Q}}$ a discriminant of number field $K$ over $\mathbb{Q}$.
My question is: Is there some categories $C,D$ and a functor $F \colon C \to D$ such that you have a simple way to get the discriminant $\Delta_{K/ \mathbb{Q}}$ from an object $F(K)$? I want $F$ to be a canonical one.
Thanks.