Is there a way to create random real antisymmetric matrix in Mathematica. Please see the example of such a matrix.

Asked
Active
Viewed 506 times
2
Jasmine
- 1,225
- 3
- 10
3 Answers
5
Here's a version which allows you to specify a distribution and only generates the required number of random draws for a symmetric matrix. You could replace the RandomVariate[...] code with something like RandomInterger[] if you'd like.
(*Dimension*)
n = 3;
(Distribution)
dist = NormalDistribution[];
(Construct upper triangular SparseArray, efficiently only creating n(n-1)/2 random numbers.*)
s = SparseArray[{i_, j_} /; i < j :> RandomVariate[dist], {n, n}];
(Create antisymmetric matrix.)
m = Normal[s - Transpose[s]];
AntisymmetricMatrixQ[m]
(True)
rfrasier
- 592
- 3
- 12
3
If you don't mind the distribution of generated matrices:
m = RandomInteger[{0, 50}, {3, 3}];
result = m - Transpose[m]
AntisymmetricMatrixQ[result] (* True *)
```
tueda
- 793
- 3
- 6
2
You can use SymmetrizedArray to create arrays with any kind of symmetry:
Normal @ SymmetrizedArray[
RandomInteger[10, {3, 3}],
Automatic,
Antisymmetric[{1, 2}]
]
Sjoerd Smit
- 23,370
- 46
- 75
n = 10 ; a = RandomReal[{0.0, 1.0}, {n, n}] ; b = 0.5*(a - Transpose[a]) ; AntisymmetricMatrixQ[b]– I.M. Aug 03 '21 at 04:09