In the first loop inside the cell loop index i go through from 0 to phi.dofs_per_component (highlighted) as well as the j index,but the function phi.begin_dof_values()return a pointer whose index go throught from 0 the phi.dofs_per_cell, that is saidin n_component > 1 case the index after phi.dofs_per_component never been touched( the total is dofs_per_compoenent*n_component).I have found an old discussion in https://groups.google.com/forum/#!searchin/dealii/MatrixFreeOperators$3A$3ALaplaceOperator%7Csort:date/dealii/k133wjcKM70/Jw-reYrsAwAJ\but things change now.
The code here should be correct, because we are looking at a constant-coefficient Laplacian here, where all entries to the diagonal are equal for the various components. So even though the local computation does indeed compute all contributions (but with some spurious dummy entries in the components higher than zero; which eventually are never used), but only get the zero-th component of it and duplicate it over all entries. This is done to save some work, given that we know that the entry is the same; in case you do an operator that couples between the components, one of course has to go over all phi.dofs_per_cell components both when zeroing entries and in the loop over the columns i.
Best,
Martin