Endomorphism preserving the determinant In some cases I know that linear maps $M_n(K) \to M_n(K)$ preserving the determinant (i.e. $\det(u(x)) = \det(x)$ for all matrix $x$) preserves the rank (and are then given by equivalences of matrices or transpose-equivalence $ x \mapsto AxB$ or $x \mapsto Ax^TB$) in the case of commutative fields.
More precisely, I know how to do it for $K\neq \mathbb{F}_2$. However I am stuck trying to prove it for $\mathbb{F}_2$ and do not find any statement of it.
 A: Let $K=F_2$. To vectorize a matrix, we stack the matrix into a vector ROW by ROW. Let $T$ be the $n^2\times n^2$ matrix (in the canonical basis) of $X\in M_n(K)\mapsto X^T$.
Then the matrices of $f:X\mapsto AXB,g:X\mapsto AX^TB$ are $A\otimes B^T, (A\otimes B^T)T$. Let $E_n$ be the set of these matrices when $A,B\in GL_n(K)$ and let $P_n$ be the set of linear maps preserving the determinant. Note that $E_n\subset P_n\subset M_{n^2}$. In the sequel, we assume that $n=2$ or $3$.
$\textbf{Lemma.}$ #$(E_2)=72$, #$(E_3)=56448$.
$\textbf{Proof.}$ Note that #$(GL_n(K))=\Pi_{k=0}^{n-1}(2^n-2^k)$. The functions of type $f$ are distinct because $A\otimes B^T=A_1\otimes {B_1}^T$ implies that $A=uA_1,B=\dfrac{1}{u}B_1$ and then, $u=1$; that implies that the functions of type $g$ are also distinct. 
Now, if $AXB=A_1X^TB_1$, then $T$ is an elementary Kronecker product; it's known that it's false; yet, if you are not convinced, it is easy to test (at least for $n=2,3$) all the Kronecker products... 
Finally, #$(E_n)=2.{\#(GL_n(K))}^2$.
$\textbf{Proposition.}$ $E_2=P_2$.
$\textbf{Proof.}$ We use the Grobner basis method for a field with characteristic $2$. 
The unknowns are the $n^4$ entries $s_{i,j}\in K$ of the matrix $S\in P_n$. 
The equations linking the $s_{i,j}$: $2^{n^2}$ equations for the preservation of $\det(X)$ and the $n^4$ equations ${s_{i,j}}^2-s_{i,j}=0$.
When $n=2$, the calculation is very fast and we obtain $72$ solutions.  $\square$
$\textbf{Remark.}$ When $n=3$, the complexity of the calculation is much more important and we cannot obtain all the solutions. Yet, we can obtain solutions by setting the values ​​of about $15$ entries $s_{i,j}$ (not just any). Why $15$ ? Because $56448\in(2^{15},2^{16})$.
However, all of the solutions I got, are in $E_3$.
On the other hand, I read in 
https://mathoverflow.net/questions/522/linear-transformation-that-preserves-the-determinant
the Thibaut Demaerel's answer and I am not convinced by the necessity of the hypothesis $|K|>n$. In particular, his characterization of the rank of a matrix seems to work on $F_2$.
EDIT. I showed (cf. the above reference) that the following characterization of the rank is valid for any field
$\textbf{Proposition.}$ Let $K$ be any field, $A\in M_n(K)$ and let $f:D\in M_n(K)\mapsto degree(\det(D+sA),s)$.
Then $\max_D f(D)=rank(A)$.
Unless I am mistaken, this shows that the result considered by the OP is valid over any field.
