Let $G\_d$ be the group with the following presentation
$$\langle x,y \mid x^{2^{d+1}}=1, x^4=y^2, [x,y,x]=x^{2^{d}}, [x,y,y]=1\rangle,$$
where $d>2$ is an integer.
It is clear that $G\_d$ is a finite $2$-group of nilpotency class at most $3$.
It is easy to see that $[x,y]^2=1$ and since the quaternion group $Q\_8$ of order $8$ is a quotient of $G\_d$, $[x,y]$ has order $2$. So the nilpotency class of $G\_d$ is $2$ or $3$. 


The computation with GAP shows that $G\_d$ is nilpotent of class exactly $3$, whenever $d=3,4,5,6,7,8,9$. 


Question: Is the nilpotency class of $G$ $3$?



Nilpotency class of a certain finite 2-group
To show $w$ is nontrivial in Max's presentation, note first that the group $H\_d$ formed by the "subpresentation" $\langle y,z,w \mid y^{2^{d-1}} = w, w^2=z^2=1, z^y=z, w^z=w \rangle$
is equal to the abelian group $\langle y \rangle \times \langle z \rangle$ of order $2^{d+1}$, and $w$ is certainly a nontrivial element of $H\_d$.


Now note that the map $y \to yz$, $z \to zw$ defines an automorphism of $H\_d$ of order 4. Let $X = \langle x \rangle$ be cyclic of order $2^{d+1}$. Then we can form the semidirect product $X \ltimes H\_d$ where conjugation by $x$ induces this automorphism. So $y^x=yz$, $z^x = zw$. In this semidirect product, $x^4$ and $y^2$ are both central elements of order $2^{d-1}$. So we can factor out the cyclic subgroup
$\langle x^4y^{-2} \rangle$, which intersects $H\_d$ trivially, and hence gives the group with Max's presentation in which $w$ is nontrivial.


