On automorphism of some finite 2-group of class nilpotency two Let $G$ be a finite 2-group of nilpotency  class  two such that $\frac{G}{Z(G)}=\{Z(G), aZ(G), bZ(G), abZ(G)\}\simeq C_{2}\times C_{2}$. Then do there exist a non inner automorphism $\alpha$ of $G$ such that $\alpha(a)\neq a$, $\alpha(b)\neq b$ and $\alpha(ab)\neq ab$ ? 
For example this is true for  $D_{8}$,  dihedral group of order 8, or $Q_{8}$, generalized quaternion group of order 8.
 A: Yes there does exist such an automorphism. Note that the conditions $\alpha(a) \ne a$, $\alpha(b) \ne b$, $\alpha(ab) \ne ab$ imply that $\alpha$ is non-inner, because an inner automorphism $c_g$ must fix every element of $gZ(G)$.
If $Z(G)$ is not cyclic, then it contains a Klein 4-group $\langle x,y \rangle$ and we can define $\alpha(a)=ax$, $\alpha(b)=by$, $\alpha(ab)=abxy$, $\alpha(g)=g$ for all $g \in Z(G)$.
So suppose $Z(G) = \langle x \rangle$ with $|x|=n$. If $n=2$ we have $G=D_8$ or $Q_8$, which you know how to do.
If $|a| = |b|=2$, we can define $\alpha(a)=b$, $\alpha(b)=a$, $\alpha(x)=x$, so suppose that $|a|>2$.
If $|a|<2n$, then by replacing $a$ by $ax^i$ for suitable $i$, we get $|a|=2$. So suppose $|a|=2n$ and hence $\langle a \rangle$ is a cyclic subgroup of $G$ of index 2.
2-groups of order at least 16 with a cyclic subgroup of index two are known to be abelian, dihedral, semidihedral, generalized quaternion or modular, and the only one of these with $|G:Z(G)|=4$ is the modular group with presentation $\langle a,b \mid a^{2n}=b^2=1, a^b = a^{n+1} \rangle$. For this group, we can define $\alpha(a) = ab$, $\alpha(b) = ba^n$.
