Message Boards Message Boards

0
|
856 Views
|
8 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Deriving a matrix from a given matrix equation

Posted 4 months ago

Dear Wolfram Forum,

I am trying to derive a specific transformation matrix given a matrix equation involving matrix multiplication and flattening operations. The equation is as follows:

A . (X // Flatten) == {Subscript[a, 0], Subscript[a, 1], Subscript[a, 2], Subscript[a, 3]}

Where X is a 2x2 matrix defined as:

X = {{Subscript[a, 0] + Subscript[a, 3], Subscript[a, 1] - I Subscript[a, 2]}, 
     {Subscript[a, 1] + I Subscript[a, 2], Subscript[a, 0] - Subscript[a, 3]}}

And the result of the matrix multiplication A . (X // Flatten) simplifies to:

{Subscript[a, 0], Subscript[a, 1], Subscript[a, 2], Subscript[a, 3]}

I have been able to empirically find a matrix A that satisfies the equation, which is:

{{1/2, 0, 0, 1/2}, {0, 1/2, 1/2, 0}, 1/I {0, -1/2, 1/2, 0}, {1/2, 0, 0, -1/2}}

However, I am seeking a systematic approach or methodology to determine A. I suspect this is a familiar transformation within certain fields, and thus I am reaching out to see if anyone can shed light on the official technique or formula to derive this matrix.

Any guidance on how to approach this problem, related literature, or relevant functions in Mathematica would be extremely helpful.

Thank you for your time and help.

Best regards, Zhao

POSTED BY: Hongyi Zhao
8 Replies
Posted 4 months ago

Thank you, but I want to get the solutions that express a _ i (i=0,1,2,3) as the functions of elements of X _ ij, e.g.:

a_0 = (X_11 + X22 ) /2
a_1 = (X_12 + X21 ) /2
a_2 = (X_21 + X12 ) / (2 I)
a_3 = (X_11 - X22 ) /2

Regards, Zhao

POSTED BY: Hongyi Zhao

This is my attempt:

X = {{Subscript[a, 0] + Subscript[a, 3], 
    Subscript[a, 1] - I Subscript[a, 2]}, {Subscript[a, 1] + 
     I Subscript[a, 2], Subscript[a, 0] - Subscript[a, 3]}};
coeffs = {Subscript[a, 0], Subscript[a, 1], Subscript[a, 2], 
   Subscript[a, 3]};
matrixA = Array[b, {4, 4}];
matrixXgeneric = Array[x, {2, 2}];
solA = Solve[Eliminate[{matrixA . (X // Flatten) == coeffs,
    X == matrixXgeneric},
   coeffs],
  Flatten[matrixA]]
matrixSol = matrixA /. solA[[1]] /. b[__] :> 1
matrixSol . (matrixXgeneric // Flatten) == coeffs /. 
  Thread[Flatten[matrixXgeneric] -> Flatten[X]] // Simplify
POSTED BY: Gianluca Gorni
Posted 4 months ago

By running your code, I obtained the following results:

In[50]:= 
X = {{Subscript[a, 0] + Subscript[a, 3], 
    Subscript[a, 1] - I Subscript[a, 2]}, {Subscript[a, 1] + 
     I Subscript[a, 2], Subscript[a, 0] - Subscript[a, 3]}};
coeffs = {Subscript[a, 0], Subscript[a, 1], Subscript[a, 2], 
   Subscript[a, 3]};
matrixA = Array[b, {4, 4}];
matrixXgeneric = Array[x, {2, 2}];
solA = Solve[
  Eliminate[{matrixA . (X // Flatten) == coeffs, X == matrixXgeneric},
    coeffs], Flatten[matrixA]]
matrixSol = matrixA /. solA[[1]] /. b[__] :> 1
matrixSol . (matrixXgeneric // Flatten) == coeffs /. 
  Thread[Flatten[matrixXgeneric] -> Flatten[X]] // Simplify


During evaluation of In[50]:= Solve::svars: Equations may not give solutions for all "solve" variables.

Out[54]= {{b[1, 4] -> (
   x[1, 1] - 2 b[1, 1] x[1, 1] - 2 b[1, 2] x[1, 2] - 
    2 b[1, 3] x[2, 1] + x[2, 2])/(2 x[2, 2]), 
  b[2, 4] -> (-2 b[2, 1] x[1, 1] + x[1, 2] - 2 b[2, 2] x[1, 2] + 
    x[2, 1] - 2 b[2, 3] x[2, 1])/(2 x[2, 2]), 
  b[3, 4] -> (-2 b[3, 1] x[1, 1] + I x[1, 2] - 2 b[3, 2] x[1, 2] - 
    I x[2, 1] - 2 b[3, 3] x[2, 1])/(2 x[2, 2]), 
  b[4, 4] -> (
   x[1, 1] - 2 b[4, 1] x[1, 1] - 2 b[4, 2] x[1, 2] - 
    2 b[4, 3] x[2, 1] - x[2, 2])/(2 x[2, 2])}}

Out[55]= {{1, 1, 1, (-x[1, 1] - 2 x[1, 2] - 2 x[2, 1] + x[2, 2])/(
  2 x[2, 2])}, {1, 1, 1, (-2 x[1, 1] - x[1, 2] - x[2, 1])/(
  2 x[2, 2])}, {1, 1, 
  1, (-2 x[1, 1] - (2 - I) x[1, 2] - (2 + I) x[2, 1])/(
  2 x[2, 2])}, {1, 1, 
  1, (-x[1, 1] - 2 x[1, 2] - 2 x[2, 1] - x[2, 2])/(2 x[2, 2])}}

Out[56]= True

But I still cannot see how a _ i (i=0,1,2,3) are expressed via X _ ij by your results. But I still can't see how your result represents a _ i (i=0,1,2,3) by X _ ij (i=1,2, j = 1,2).

Regards, Zhao

POSTED BY: Hongyi Zhao

I thought you wanted A as a function of X. However, take another look at

matrixSol . (matrixXgeneric // Flatten) == coeffs
POSTED BY: Gianluca Gorni
Posted 4 months ago

Wonderful, thank you very much for your tip. It does match up perfectly with the results I provided earlier:

In[11]:= 
matrixSol . (matrixXgeneric // Flatten) == coeffs // Simplify

Out[11]= {1/2 (x[1, 1] + x[2, 2]), 1/2 (x[1, 2] + x[2, 1]), 
  1/2 I (x[1, 2] - x[2, 1]), 1/2 (x[1, 1] - x[2, 2])} == {Subscript[a,
   0], Subscript[a, 1], Subscript[a, 2], Subscript[a, 3]}

The above result is the same as my previous representation. Is this just a coincidence?

Regards, Zhao

POSTED BY: Hongyi Zhao

It does not seem to be a coincidence. There are infinitely many matrices A that solve your problem, but they all give the same relation between X and the a_i:

Simplify[(matrixA /. solA[[1]]) . (matrixXgeneric // Flatten)]
POSTED BY: Gianluca Gorni
Posted 4 months ago

Wonderful confirmation and validation. This further prompts me to consider whether the issue here is related to the following discussion:

enter image description here

Regards, Zhao

POSTED BY: Hongyi Zhao
Posted 4 months ago

This

LogicalExpand[
  Reduce[
    {{a,b,c,d},{e,f,g,h},{i,j,k,l},{m,n,o,p}}.{a0+a3,a1-I a2,a1+I a2,a0-a3}==
    {a0,a1,a2,a3},
    {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p}
]]

quickly gives you five different solutions.

Formatted differently gives the same solutions

A={{a,b,c,d},{e,f,g,h},{i,j,k,l},{m,n,o,p}};
X={{a0+a3,a1-I a2},{a1+I a2,a0-a3}};
LogicalExpand[Reduce[A.(X//Flatten)=={a0, a1, a2, a3},Flatten[A]]]

But I cannot understand

I want to get the solutions that express a _ i (i=0,1,2,3) as the functions of elements of X _ ij, e.g

when your original problem was to find the 4x4 matrix A and you showed an example 4x4 solution of coefficients.

POSTED BY: Bill Nelson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract