Morphism between Algebraic Varieties

I am working in the context of matrix rings $M_n(\mathbb F)$, where $\mathbb F$ is a field.

For a polynomial f $\in\mathbb F[x_1, x_2\ldots, x_{n^2}]$ and a matrix $(a_{ij})=A\in M_n(\mathbb F)$, define $f(A)$ to be $f(a_{11}, \ldots ,a_{nn})$.

Suppose that we have two finite sets of polynomils $f_1,\ldots ,f_k$ and $g_1,\ldots ,g_l$, where each $f_i$ and $g_i$ are in $\mathbb F[x_1, x_2\ldots, x_{n^2}]$. Define the sets

$$S_1=\{A\in M_n(\mathbb F):f_i(A)=0,\;\;for\;i=1, ...,k\}$$

and

$$S_2=\{A\in M_n(\mathbb F):g_i(A)=0,\;\;for\;i=1, ...,l\}$$

I looking for a method to determine whether there is any bijective linear mapping $\mathcal L:M_n(\mathbb F):\rightarrow M_n(\mathbb F):$ such that $\mathcal L(S_1)=S_2$.

Note that $S_1$ and $S_2$ are algebraic varieties, so the problem can be seen in the context of algebraic geometry.

If the polynomials are all linear, then $S_1$ and $S_2$ are linear subspaces. hence, if they do not have the same dimension there is no such linear mapping. For the general case, there is some property of algebaic varieties that is invariant under such a linear mapping, that can be used to prove that there is no such linear mapping?

-
Quick answer: yes, lots! Dimension makes sense for all algebraic varieties, not just linear spaces. Then there are slightly more refined invariants: number of connected components, existence of singular points, etc. If you know the f_i and g_i explicitly, all these things can be calculated, say by Macaculay 2. – user64687 Apr 10 '13 at 16:20
By the way, the matrix rings are a red herring here: your question is really just about algebraic subsets of affine space (in this case, of dimension n^2, but that does not play any role). – user64687 Apr 10 '13 at 16:35