MathOverflow will be down for maintenance for approximately 3 hours, starting Monday evening (06/24/2013) at approximately 9:00 PM Eastern time (UTC-4).
show/hide this revision's text 2 Simplified construction, added remarks

The smallest examples are in dimension $2$. Let $E$ be any elliptic curve over $\mathbf{Q}$ without complex multiplication, e.g., $X_0(11)$. We will construct two twists of $E^6$ E^2$ that are isomorphic over $\mathbf{Q}_p$ for all $p \le \infty$ but not isomorphic over $\mathbf{Q}$.

Let $K:=\mathbf{Q}(\sqrt{-1},\sqrt{17})$. Let $G:=\operatorname{Gal}(K/\mathbf{Q})$ .G:=\operatorname{Gal}(K/\mathbf{Q}) = (\mathbf{Z}/2\mathbf{Z})^2$. Let $\alpha'$ be the composition of David's homomorphism $\alpha \colon G \to S_6$ with the permutation representation $S_6 \to \operatorname{GL}_6(\mathbf{Z}) operatorname{GL}_2(\mathbf{Z}) = \operatorname{Aut}(E^6)$, operatorname{Aut}(E^2)$ be a homomorphism sending the two generators to the reflections in the coordinate axes of $\mathbf{Z}^2$, and let $A$ be the $K/k$-twist K/\mathbf{Q}$-twist of $E^6$ E^2$ given by $\alpha'$.\alpha$. Define $\beta'$ \beta$ and $B$ similarly.

A matrix calculation shows that no element , but with the lines $y=x$ and $y=-x$ in place of the coordinate axes. The representations $\operatorname{GL}_6(\mathbf{Z})$ conjugates \alpha$ and $\alpha'$ into \beta$ of $\beta'$: indeed, the linear conditions G$ on $\mathbf{Z}^2$ are not conjugate: only the coefficients of a conjugating matrix force it to have a determinant that former is 0 mod 2.such that the lattice vectors fixed by nontrivial elements of $G$ generate all of $\mathbf{Z}^2$. Thus $A$ and $B$ are not isomorphic over $\mathbf{Q}$.

On the other hand, every decomposition group $D_p$ in $G$ is smaller than $G$ since $-1$ is a square in $Q_{17}$ and $17$ is a square in $\mathbf{Q}_2$. SoAlso, after restriction to any $D_p$, the homomorphisms restrictions of $\alpha'$ \alpha$ and $\beta'$ become \beta$ to any proper subgroup of $G$ are conjugatevia some permutation matrix : any single line spanned by a primitive vector in $\operatorname{GL}_6(\mathbf{Z})$.\mathbf{Z}^2$ can be mapped to any other by an element of $\operatorname{GL}_2(\mathbf{Z})$. Thus $A$ and $B$ become isomorphic after base extension to $\mathbf{Q}_p$ for any $p \le \infty$. $\square$

Remark: The abelian surfaces $A$ and $B$ constructed above are isogenous even over $\mathbf{Q}$, because the $\mathbf{Z}^2$ with one Galois action can be embedded into the $\mathbf{Z}^2$ with the other Galois action: rotate $45^\circ$ and dilate.

Remark: The nonexistence of examples in dimension $1$ follows from these two well-known facts:

1) Twists of an elliptic curve over a field $k$ of characteristic $0$ are classified by$H^1(k,\mu_n)=k^\times/k^{\times n}$ where $n$ is 2, 4, or 6.

2) If $n<8$, the map $k^\times/k^{\times n} \to \prod_v k_v^\times/k_v^{\times n}$ is injective.

[Edit: This answer was edited to simplify the construction and to add those remarks at the end.]

show/hide this revision's text 1

(If you upvote this answer, please consider upvoting the answers by Felipe Voloch and David Speyer too, since this answer builds on their ideas.)

Let $E$ be any elliptic curve over $\mathbf{Q}$ without complex multiplication, e.g., $X_0(11)$.
We will construct two twists of $E^6$ that are isomorphic over $\mathbf{Q}_p$ for all $p \le \infty$ but not isomorphic over $\mathbf{Q}$.

Let $K:=\mathbf{Q}(\sqrt{-1},\sqrt{17})$. Let $G:=\operatorname{Gal}(K/\mathbf{Q})$ . Let $\alpha'$ be the composition of David's homomorphism $\alpha \colon G \to S_6$ with the permutation representation $S_6 \to \operatorname{GL}_6(\mathbf{Z}) = \operatorname{Aut}(E^6)$, and let $A$ be the $K/k$-twist of $E^6$ given by $\alpha'$. Define $\beta'$ and $B$ similarly.

A matrix calculation shows that no element of $\operatorname{GL}_6(\mathbf{Z})$ conjugates $\alpha'$ into $\beta'$: indeed, the linear conditions on the coefficients of a conjugating matrix force it to have a determinant that is 0 mod 2. Thus $A$ and $B$ are not isomorphic over $\mathbf{Q}$.

On the other hand, every decomposition group $D_p$ in $G$ is smaller than $G$ since $-1$ is a square in $Q_{17}$ and $17$ is a square in $\mathbf{Q}_2$. So, after restriction to any $D_p$, the homomorphisms $\alpha'$ and $\beta'$ become conjugate via some permutation matrix in $\operatorname{GL}_6(\mathbf{Z})$. Thus $A$ and $B$ become isomorphic after base extension to $\mathbf{Q}_p$ for any $p \le \infty$.