Classify $p$-groups in which all groups of the same order are isomorphic The answer to “Are two subgroups of a finite $p$-group $G$, of the same order, isomorphic?” is definitely no. Such groups are very rare. How rare?
Can you classify all finite $p$-groups $G$ such that if $H,K \leq G$ with $|H|=|K|$, then $H \cong K$?
 A: Thanks to Tobias and Derek!
Theorem: If $G$ is a finite $p$-group in which every two subgroups of the same order are isomorphic then $G$ is either:


*

*cyclic

*elementary abelian

*quaternion of order 8

*extra-special of order $p^3$ and exponent $p$


Proof: As mentioned by Tobias, either $G$ has an elementary abelian subgroup of order $p^2$ or $G$ is cyclic, or $G$ is generalized quaternion.
In the last case, only the quaternion group of order $8$ actually works, since larger quaternion groups contain both cyclic groups of order $8$ and a quaternion group of order $8$. In the second to last case, cyclic groups just work.
Now if $G$ has an elementary abelian subgroup of order $p^2$, then $G$ has no elements of order $p^2$, lest it have a cyclic subgroup of order $p^2$. Hence $G$ has exponent $p$. In the case $p=2$, this implies $G$ is elementary abelian.
So we suppose $p$ is odd and $G$ has an elementary abelian subgroup $V$ of order $p^k$ but none of order $p^{k+1}$. Assume $G \neq V$, and let $H$ contain $V$ with index $p$. Since $H$ has exponent $p$, $H=\langle h \rangle \ltimes V$ for any $h \notin V$. Since $H$ is not elementary abelian, there must be some $v_1 \in V$ with $[h,v_1]=v_2 \neq 1$. Defining $[h,v_i] = v_{i+1}$, we get that the non-identity elements of $v_i$ are linearly independent. Suppose $v_n \neq 1$ but $v_{n+1}=1$. Note that $n \geq 2$ by definition. Then $\langle h, v_{n-1}, v_n \rangle$ is extra-special of order $p^3$. By our hypothesis, $\langle v_{n-2}, v_{n-1}, v_n \rangle$ would also be extra-special rather than abelian. Hence $|V|=p^2$.
By Derek: Now assume $G \neq H$ and let $K$ contain $H$ with index $p$. Choose some copy of $V \leq Z_2(K)$ that is normal in $K$. Then $K/V \to Z(H):x \mapsto [x,v_1]$ cannot be injective, since the domain has order $p^2$, so let $z$ be non-identity in the kernel. Then $\langle z,v_1,v_2\rangle$ is abelian, a contradiction. Hence $H=G$ or $V=G$. $\square$
