Automorphism group of finite $k$-algebra as an affine variety Let $k$ be an algebraically closed field. Let $A$ be a finite dimensional $k$-algebra, not necessarily commutative. Let $G = \text{Aut}(A)$ be the group of $k$-algebra automorphisms of $A$. I want to show that $G$ can be an affine variety in a suitable space $k^n$.
 A: I figured it out myself, so I'm posting my solution for future reference.
Since $A$ is a finite dimensional $k$-algebra, it's a finite dimensional vector space. Let $n$ be the dimension of $A$ over $k$. Since $k$-algebra automorphisms are also $k$-linear maps, $G$ can be thought of as a subset of $M_n(k) \cong k^{n^2}$, the set of $n\times n$ matrices over $k$. Now I can't figure out what polynomial relations define $G$ inside $k^{n^2}$.
A $k$-linear automorphism is a $k$-algebra automorphism iff it respects the "multiplicative" structure of $A$. So if we take $a_1, ..., a_n$ to be a $k$-basis of $A$, then for any $ T\in M_n(k)$ to be a $k$-algebra morphism, necessary and sufficient to have
$$ T(a_ia_j) = T(a_i) T(a_j)$$
for all $i,j$. How can we express this as a group of polynomial relations in $T_{i,j}$, the $i,j$-th coordinates of $T$?
We can write $a_ia_j = \sum_s t^{i,j}_s a_s$, as linear combination of the basis elements $\{a_1,...,a_n\}$. Using this notation,
$$  T(a_ia_j) = T\sum_s t^{i,j}_sa_s = \sum_st^{i,j}_sT(a_s)$$
and hence we get the relations
$$ T(a_i)T(a_j) = \sum_st^{i,j}_sT(a_s)$$
for all $i,j$. Now since $T(a_i) = \sum T_{i,j}a_j$ These are most definitely polynomial relations in $T_{i,j}$. So I have proved that the set of all $k$-algebra morphipsms is an affine variety. Now what about set of $k$-algebra automorphisms?
$k$-algebra automorphisms are just invertible morphisms. So just taking intersection with $GL_n(k)$ should give us the required $G$, because $GL_n(k)$ is an affine variety.
