how to see CM types as functions on the Galois group? 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)?  
 A: The characteristic function of a CM-type in the sense (1) on a subfield of $\bar{\mathbb{Q}}$ is a locally constant function $Gal(\bar{\mathbb{Q}}/\mathbb{Q})\to \{0,1\}\subset\mathbb{Z}$. CM-types in the sense (1) classify CM abelian varieties (up to isogeny) and elements in the $\mathbb{Z}$-module spanned by their characteristic functions classify CM motives (these are locally constant function $Gal(\bar{\mathbb{Q}}/\mathbb{Q})\to \mathbb{Z}$; I don't know where the $\mathbb{Q}$ comes from).
A: In my joint paper with Riad Masri "On the Colmez conjecture for non-abelian CM fields" we worked this out in detail in section 2 as preparation for the later work on the Colmez conjecture.
In particular, take a look at Proposition 2.3, which gives the precise relations between the two notions of a CM type that you mention.
Observe though that when defining the action of the Galois group on a (locally constant) CM type $\Phi$, we defined it as (see definition 2.2) 
$$
(\tau \cdot \Phi)(g) := \Phi(\tau^{-1} g),
$$
somewhat with the flavour of the dual or contragredient representation, whereas some other authors define it by
$$
(\tau \cdot \Phi)(g) := \Phi(\tau g).
$$
This was done so that the relation between equivalent CM types under one definition would come out nice when translated to the corresponding CM types under the other definition, as is shown in Proposition 2.3.
