Consider a representation $\rho: \operatorname{Gal} (\overline{\mathbb Q} | \mathbb Q ) \to GL_n ( \overline{\mathbb Q}_\ell)$ that is a subrepresentation of $H^i(X, \overline{\mathbb Q}_\ell (j))$ for $X$ a smooth projective variety over $\mathbb Q$. This is a Galois representation of weight $w = i-2j$.

When do we expect a smooth projective variety $Y$ over $\mathbb Q$ such that $\rho$ shows up in $H^w(Y, \overline{\mathbb Q}_\ell)$?

I can see two obvious necessary conditions. One is that the coefficients of the characteristic polynomial of every Frobenius element had better be algebraic integers. Another is that the Hodge-Tate weights of $Y$ had better be in the interval $[0,w]$.

Do there exist any (conjectural) relations between the three conditions

- Actually shows up in cohomology without Tate twisting.
- Integral characteristic polynomial of Frobenius
- Correct Hodge-Tate weights
other than 1 implying 2 and 3? Should they all be equivalent? Are there any counterexamples?

There are some partial results toward the claim that 2 and 3 imply 1.

Having an integral characteristic polynomial is a sufficient condition in the weight $0$ case. This would imply the eigenvalues of Frobenius are roots of unity. With compactness, they are all roots of unity in a bounded degree extension of $\mathbb Q_\ell$, hence of bounded order, so by Chebotarev all elements of the Zariski closure of the image of $\rho$ have eigenvalues roots of unity of bounded order, hence the image is finite, so it shows up in the cohomology of a $0$-dimensional scheme. I guess I'm counting non-geometrically connected schemes as varieties here.

Having the correct Hodge-Tate weights is a sufficient condition in the weight 0 and 1 case, at least assuming the Hodge and Tate conjectures. By the Tate conjecture we can associate a motive to the Galois representation, to which we can associate a Hodge structure. In the weight 0 case, this Hodge structure is supported in $H^{0,0}$ so all the classes are Hodge classes and hence are algebraic, hence the image of $\rho$ is finite again. In the weight 1 case, this Hodge structure is supported in $H^{1,0}$ and $H^{0,1}$, hence corresponds to an abelian variety. $H^1$ of that abelian variety is a motive with the same Hodge structure as the motive of $\rho$. Because we assumed the Hodge conjecture, it must be the same motive and thus have the same Galois representation. A more detailed version of that argument is in this paper.

I guess the Langlands program will also give some cases of this.