Let $K$ be a CM field, that is, an imaginary quadratic extension of a totally real number field. Its degree $[K: \mathbb{Q}]$ is a en even number $2n$.

(1) For me a CM type is a subset $\Phi \subset \mathrm{Hom}(K, \mathbb{C})$ consisting of $n$ elements such that, if $\sigma$ belongs to $\Phi$, then its complex conjugate $\bar{\sigma}$ doesn't.

(2) But I've seen that people consider a CM type as a locally constant function $\Phi: \mathrm{Gal}(\overline{\mathbb{Q}}/\mathbb{Q}) \to \mathbb{Q}$.

So: how to pass from (1) to (2)?

And there is some condition under which a function like in (2) comes from a CM type like in (1)?