Stirling Inversion¶
We want to validate that:
$$ (x\frac{d}{dx})^n = \sum_{k=0}^n S(n,k)\, x^k \frac{d^k}{dx^k}. $$
Where S(n,k) are the Stirling Numbers of the second kind.
The inverse normal-ordering also holds:
$$ x^k \frac{d}{dx}^k = \sum_{j=0}^k s(k,j)\,(x \frac{d}{dx})^j, $$
with $s(k,j)$ the (signed) Stirling numbers of the first kind.
The Stirling Numbers¶
import numpy as npa
from scipy.special import stirling2
from tabulate import tabulate
from IPython.display import HTML
# Create a 10x10 table of Stirling numbers of the second kind using numpy meshgrid
n_vals, k_vals = np.meshgrid(range(10), range(10), indexing='ij')
stirling_table = stirling2(n_vals, k_vals).astype(int)
# Replace zeros with empty strings for cleaner display
df_display = pd.DataFrame(stirling_table,
index=[f'n={i}' for i in range(10)],
columns=[f'k={i}' for i in range(10)]).replace(0, '')
print("# Stirling Numbers of the Second Kind S(n,k)")
print(tabulate(df_display, headers=["n\\k"] + [f'k={i}' for i in range(10)]))
# Stirling Numbers of the Second Kind S(n,k) n\k k=0 k=1 k=2 k=3 k=4 k=5 k=6 k=7 k=8 k=9 ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- n=0 1 n=1 1 n=2 1 1 n=3 1 3 1 n=4 1 7 6 1 n=5 1 15 25 10 1 n=6 1 31 90 65 15 1 n=7 1 63 301 350 140 21 1 n=8 1 127 966 1701 1050 266 28 1 n=9 1 255 3025 7770 6951 2646 462 36 1
Symbolic Computation of Euler Operator¶
from sympy.holonomic import DifferentialOperators
from sympy import ZZ
from sympy.abc import x
R, D = DifferentialOperators(ZZ.old_poly_ring(x), 'D')
E = x * D
for i in range(10):
print(f"E^{i} = {E**i}".replace('**','^').replace('*',' ').replace(')','').replace('(',''))
E^0 = 1 E^1 = x D E^2 = x D + x^2 D^2 E^3 = x D + 3 x^2 D^2 + x^3 D^3 E^4 = x D + 7 x^2 D^2 + 6 x^3 D^3 + x^4 D^4 E^5 = x D + 15 x^2 D^2 + 25 x^3 D^3 + 10 x^4 D^4 + x^5 D^5 E^6 = x D + 31 x^2 D^2 + 90 x^3 D^3 + 65 x^4 D^4 + 15 x^5 D^5 + x^6 D^6 E^7 = x D + 63 x^2 D^2 + 301 x^3 D^3 + 350 x^4 D^4 + 140 x^5 D^5 + 21 x^6 D^6 + x^7 D^7 E^8 = x D + 127 x^2 D^2 + 966 x^3 D^3 + 1701 x^4 D^4 + 1050 x^5 D^5 + 266 x^6 D^6 + 28 x^7 D^7 + x^8 D^8 E^9 = x D + 255 x^2 D^2 + 3025 x^3 D^3 + 7770 x^4 D^4 + 6951 x^5 D^5 + 2646 x^6 D^6 + 462 x^7 D^7 + 36 x^8 D^8 + x^9 D^9
Proof of Equivalence¶
Let $D=\frac{d}{dx}$, $E:=xD$ (Euler vector field), and $F_n:=x^nD^n$. For monomials $x^m$ ($m\in\mathbb{N}$) we have the diagonal actions
$$ E^n x^m = m^n x^m,\qquad F_n x^m = (m)_n\,x^m, $$
where the falling factorial is
$$ (m)_n := m(m-1)\cdots(m-n+1)\quad\text{with }(m)_0:=1. $$
Recall the Stirling inversion (with $S(n,k)$ the Stirling numbers of the second kind and $s(k,j)$ the signed Stirling numbers of the first kind):
$$ m^n=\sum_{k=0}^n S(n,k)\,(m)_k, \qquad (m)_k=\sum_{j=0}^k s(k,j)\,m^{\,j}. $$
Since $E x^m = m x^m$, applying these identities to the eigenvalue $m$ and using equality on the monomial basis $\{x^m\}_{m\ge0}$ gives the operator equalities
$$ E^n=\sum_{k=0}^n S(n,k)\,F_k=\sum_{k=0}^n S(n,k)\,x^kD^k, \qquad F_k=\sum_{j=0}^k s(k,j)\,E^{\,j}. $$
Equivalently, the families $\{E^n\}$ and $\{x^kD^k\}$ are mutual Stirling transforms.