Question: Efficiently defining a fourth-order tensor with zeros

I would like to define a fourth-order tensor (3x3x3x3) with zeros, for then defining some non-null terms individually. For that, I'm currently doing:

for it1 from 1 to 3 do
    for it2 from 1 to 3 do
        for it3 from 1 to 3 do
            for it4 from 1 to 3 do
                H[it1,it2,it3,it4]:= 0;
            end do:
        end do:
    end do:
end do:

H[1,1,1,1]:= value1:
H[1,2,2,1]:= value2:
# etc.

 

However, I suppose there is probably a more efficient manner to do do, maybe using Physics package. Does anyone know to do that?

Please Wait...