Adding explicit return type to nontrivial lambda function for constructing KMS matrices