Although it is best to avoid this when possible, using the undocumented function Internal`InheritedBlock
you can temporarily add a rule to Power
:
α = 0;
d[i_, j_] := Internal`InheritedBlock[{Power},
Unprotect[Power];
Power[0, 0] = 1;
Sum[α^(i + j - 2 k) (-1)^(-k) Sqrt[i!] Sqrt[j!]/((i - k)! (j - k)! k!), {k, 0,
Min[i, j]}]
]
d[0, 0]
1
Be aware that user rules for System functions may be ignored when working with packed arrays. See: Block attributes of Equal
Generally better is to use a proxy replacement for Power
with your own behavior:
Attributes[myPower] = {Listable};
myPower[0, 0] = 1;
myPower[x_, y_] := x^y;
d[i_, j_] :=
Sum[myPower[α, (i + j - 2 k)] (-1)^(-k) Sqrt[
i!] Sqrt[j!]/((i - k)! (j - k)! k!), {k, 0, Min[i, j]}]
The Listable
attribute makes sure that zeroes in vectors and matrices are also handled in the way we defined:
In[2]:= myPower[0, {{1, 1}, {1, 0}}]
Out[2]= {{0, 0}, {0, 1}}
d[i_, j_, alf_] := Module[{aa}, Sum[aa^(i + j - 2 k)*(-1)^(-k)*Sqrt[i!] *Sqrt[j!]/((i - k)!*(j - k)!*k!), {k, 0, Min[i, j]}] /. aa->alf] In[16]:= d[0,0,0] Out[16]= 1
$\endgroup$