Skip to main content
For a world with more symmetries.
Source Link
user31159
user31159
myMatrix[d_] := With[
     {c = (1/(Sqrt[2 # - 3] Sqrt[2 # - 1])) & /@ Range[2, d]},
     SparseArray[{
        {1, 1} -> 1, 
        Band[{1, 2}] -> c, 
        Band[{2, 1}] -> -c
        }, {d, d}]
];

myMatrix[5] // MatrixForm

enter image description here

myMatrix[d_] := With[
     {c = (1/(Sqrt[2 # - 3] Sqrt[2 # - 1])) & /@ Range[2, d]},
     SparseArray[{{1, 1} -> 1, Band[{1, 2}] -> c, Band[{2, 1}] -> -c}, {d, d}]
];

myMatrix[5] // MatrixForm

enter image description here

myMatrix[d_] := With[{c = (1/(Sqrt[2 # - 3] Sqrt[2 # - 1])) & /@ Range[2, d]},
     SparseArray[{
        {1, 1} -> 1, 
        Band[{1, 2}] -> c, 
        Band[{2, 1}] -> -c
        }, {d, d}]
];

myMatrix[5] // MatrixForm

enter image description here

Source Link
user31159
user31159

myMatrix[d_] := With[
     {c = (1/(Sqrt[2 # - 3] Sqrt[2 # - 1])) & /@ Range[2, d]},
     SparseArray[{{1, 1} -> 1, Band[{1, 2}] -> c, Band[{2, 1}] -> -c}, {d, d}]
];

myMatrix[5] // MatrixForm

enter image description here