1
$\begingroup$

Given v={v1,v2,v3,v4} how can i construct the matrix

 M={{ v1, v2, v3, v4, -v3, -v2},
    { v2, v1, v2, v3,  v4, -v3},
    { v3, v2, v1, v2,  v3,  v4},
    { v4, v3, v2, v1,  v2,  v3},
    {-v3, v4, v3, v2,  v1,  v2},
    {-v2,-v3, v4, v3,  v2,  v1}}
$\endgroup$
0

1 Answer 1

3
$\begingroup$

Looks like ToeplitzMatrix can be useful for this case:

 ToeplitzMatrix[{v1, v2, v3, v4, -v3, -v2}]
{{ v1,  v2, v3, v4, -v3, -v2}, 
 { v2,  v1, v2, v3,  v4, -v3}, 
 { v3,  v2, v1, v2,  v3,  v4}, 
 { v4,  v3, v2, v1,  v2,  v3}, 
 {-v3,  v4, v3, v2,  v1,  v2}, 
 {-v2, -v3, v4, v3,  v2,  v1}}

There is also an undocumented option "ReflectedNegation" for ArrayPad which can help to generate the reflected input array i.e.:

v = {v1, v2, v3, v4};
ArrayPad[v, {0, 2}, "ReflectedNegation"]
{v1, v2, v3, v4, -v3, -v2}

Thus, the full command will be:

ToeplitzMatrix[ArrayPad[v, {0, 2}, "ReflectedNegation"]]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.