Suppose I have a list of Matrices saved in the variable G
and apply the following operations:
top[g_] = Minors[g]
Diagonal[top /@ G]
Minors
returns a matrix where each element is the determinant with the (i,j) row/col deleted, and Diagonal
returns a list of the diagonal elements of a matrix.
My question is on the evaluation of these commands - clearly I do not want all entries evaluated. Is Mathematica lazy in the sense that Diagonal is parsed first which only extracts the elements needed from Minors or is the minor matrix constructed and then its diagonal elements are pulled out?
This is a general question for lazy evaluation, however being new to Mathematica I would appreciate any tips on how to improve the syntax for the specific problem.