How to construct a sparse matrix used for calculating function values at multiple points

Hello,

How can you get the basis derivatives of the specific cell based on your code?