# How to create a set (of matrices) which will be used as an finite group to minimize a function?

I'm new here so I'm a little lost.

I need to minimize a function considering that the minimizing parameter belongs to a preestablished set. It all involves matrices.It's something like this:

Where is a 8x8 given matrix (which has a variable p), G is the set I need to create and represents an element of such a set, which is composed of 8x8 matrices. In the group G all with a single subscript (A, B or C) are 2x2 matrices and with two subscripts (BC, AC or AB) are 4x4 matrices, so the 8x8 matrices of the group are resulted from Kronecker products (as shown above) and they also depend on p. Therefore the output on Minimize should be an expression depending on p cause I'm using Trace. I tried to input exactly like that on Mathematica but (of course) it doesnt work, cause I really don't know how to deal with Lists.

The message that appears:

• More details would be helpful. What group? Is it a finite group? Write down as much as you can in Mathematica syntax, give us an example input with desired output, and so on. A sample rho is necessary too. Feb 15, 2021 at 21:50
• @march I've edited it hope its ok now. Thank you for your time. Feb 16, 2021 at 14:36
• Min[Table[Tr[rho . MatrixLog[rho]] - Tr[rho . MatrixLog[sigma]], {sigma, G}]] or something like it? I forget if there’s a MatrixLog built in, or it was in a Q&A... Feb 16, 2021 at 14:49
• @MichaelE2 It didn't work for me. I defined a function "log" based on MatrixLog and it works on the rest of the code so I don't think that's the problem. Feb 17, 2021 at 19:13
• I feel I'm probably not understanding the problem. I suggest including code for generating G and code for your log function. Most problems with code not working require the code. You are much more likely to get someone to investigate if it is easy for them to copy something and compute with it. Feb 17, 2021 at 19:25

Using random rho and sigma matrices, here's a proof of concept:

SeedRandom[1];
rho = #\[Transpose] . # &@RandomReal[{-1, 1}, {8, 8}];
sX = {sA, sB, sC} = #\[Transpose] . # & /@
RandomReal[{-1, 1}, {3, 2, 2}];
sXY = {sBC, sAC, sAB} = #\[Transpose] . # & /@
RandomReal[{-1, 1}, {3, 4, 4}];
Min[Table[Tr[rho.MatrixLog[rho]] - Tr[rho.MatrixLog[sigma]], {sigma, G}]]

(*  25.0909  *)


You could use your own log[] and also write G explicitly:

G = {KroneckerProduct[sA, sBC],
KroneckerProduct[sB, sAC],
KroneckerProduct[sC, sAB]};


Minimize probably won't work because the variables have to represent real numbers, not members of a discrete group of matrices.

• I'm still have a problem: my matrices depend on a variable, let's say "p", so the output I get using your answer it's just Min['expression1', 'expression2', 'expression3'] . I saw that Min gives a real number output, so that's probably why I get that output. So I still need a minimization function that gives me as an output an expression depending on "p". If anyone could help I'd apreciate it very very much. And thank you @Michael E2 !!!! Mar 10, 2021 at 22:40