# Assign zeros to large list of indexed variables

I have a big list of the form

list={P[1,1],..,P[i,j]}


and would like to assign 0 to each of them, but

list=ConstantArray[0,Length[list]]


doesn't work. While it does work for lists that aren't indexed the way I have them... I tried doing a Do loop but with the size of the list it's extremely slow.

You could use

Evaluate[list] = ConstantArray[0, Length[list]]


or

MapThread[Set, {list, ConstantArray[0, Length[list]]}]


to Set each indexed variable inside of list to 0.

If the indexes for the variables inside list follow a known condition, one can use for example

p[i_ /; i < 3, j_ /; j < 5] = 0


or memorization

p[i_ /; i < 3, j_ /; j < 5] := p[i, j] = 0