Suppose that $A$ and $B$ are two algebras finite over a field $K$ (which may be assumed to be separably closed, if that helps), then we know that the functor $\mathrm{Hom}\_K(\mathrm{Spec}(A),\mathrm{Spec}(B))$ from $(\mathbf{Sch}/K)$ to $(\mathbf{Sets})$, defined by 
$$ \mathrm{Hom}\_K(\mathrm{Spec}(A),\mathrm{Spec}(B))(T):=\mathrm{Hom}\_T(\mathrm{Spec}(A)\times\_K T, \mathrm{Spec}(B)\times\_K T),$$
is represented by an open subscheme $U$ of $\mathrm{Hilb}(\mathrm{Spec}(A)\times\_K \mathrm{Spec}(B)/K)$.


Do we know when $U$ is connected? Thanks!



When is the Hom-scheme connected?
I only just noticed this question. I agree with Andrew Stout, but I am afraid that I disagree with Dmitry Vaintrob. To make Dmitry's example precise, assume $B$ is a graded, Artinian (commutative, unital) $K$-algebra with residue field $K$, i.e., $$B = B\_0 \oplus \dots \oplus B\_q \oplus \dots \oplus B\_n,$$ where $B\_0 = K$. This is the case, for instance, if we take $\text{Spec}(B)$ to be the infinitesimal neighborhood of the vertex in an affine cone with nilpotency index $n$.


There is a distinguished graded $K$-algebra homomorphism, $$ z : B \to A,\ \ z(b\_0) = b\_0,\ \ z(b\_q) = 0,\ q > 0.$$ Moreover, there is a graded $K$-algebra homomorphism, $$ \mu^\*: B[T] \to B[T], \ \ \mu^\*(b\_qT^d) = b\_qT^{d+q}.$$ For any $K$-algebra homomorphism, $w:B\to A$, define the associated $K$-algebra homomorphism $w\otimes \text{Id}\_{K[T]}$ as follows, $$ w\otimes \text{Id}\_{K[T]} : B[T] \to A[T], \ \ (w\otimes\text{Id}\_{K[T]})(bT^d) = w(b)T^d. $$ Now consider the composite $K$-algebra homomorphism, $$\widetilde{w}:B[T]\to A[T], \ \ \widetilde{w} = (w\otimes \text{Id}\_{K[T]})\circ \mu^\*.$$ When we specialize $\widetilde{w}$ via evaluation at $T=1$, then we recover $w$. However, when we specialize via evaluation at $T=0$, we get the "vertex" $z$. Interpreted differently, $\widetilde{w}$ gives a $K$-morphism, $$\widetilde{w}:\mathbb{A}^1\_K \to \text{Hom}\_K(\text{Spec}(A),\text{Spec}(B)),$$ that sends $1$ to $w$ and sends $0$ to the vertex $z$. Thus the Hom scheme is representable by a connected $K$-scheme when $B$ is graded and Artinian.


