Let
X
X
be a nilmanifold, that is, a compact homogeneous space of a nilpotent Lie group
G
G
, and let
a
∈
G
a\in G
. We study the closure of the orbit of the diagonal of
X
r
X^{r}
under the action
(
a
p
1
(
n
)
,
…
,
a
p
r
(
n
)
)
(a^{p_{1}(n)},\ldots ,a^{p_{r}(n)})
, where
p
i
p_{i}
are integer-valued polynomials in
m
m
integer variables. (Knowing this closure is crucial for finding limits of the form
lim
N
→
∞
1
N
m
∑
n
∈
{
1
,
…
,
N
}
m
μ
(
T
p
1
(
n
)
A
1
∩
…
∩
T
p
r
(
n
)
A
r
)
\hbox {lim}_{N\rightarrow \infty }\frac {1}{N^{m}}\sum _{n\in \{1,\ldots ,N\}^{m}} \mu (T^{p_{1}(n)}A_{1}\cap \ldots \cap T^{p_{r}(n)}A_{r})
, where
T
T
is a measure-preserving transformation of a finite measure space
(
Y
,
μ
)
(Y,\mu )
and
A
i
A_{i}
are subsets of
Y
Y
, and limits of the form
lim
N
→
∞
1
N
m
∑
n
∈
{
1
,
…
,
N
}
m
d
(
(
A
1
+
p
1
(
n
)
)
∩
…
∩
(
A
r
+
p
r
(
n
)
)
)
\hbox {lim}_{N\rightarrow \infty }\frac {1}{N^{m}}\sum _{n\in \{1,\ldots ,N\}^{m}} d((A_{1}+p_{1}(n))\cap \ldots \cap (A_{r}+p_{r}(n)))
, where
A
i
A_{i}
are subsets of Z and
d
(
A
)
d(A)
is the density of
A
A
in Z.) We give a simple description of the closure of the orbit of the diagonal in the case that all
p
i
p_{i}
are linear, in the case that
G
G
is connected, and in the case that the identity component of
G
G
is commutative; in the general case our description of the orbit is not explicit.