Open f29946bc-ee7b-48cd-9abc-3445948c551d opened 9 years ago
I needed this once for a few special classes of matrices. A few things turned out to be necessary that I initially didn't consider. The ability to specify,
I have random_psd()
here:
and you can feel free to steal that code.
What I really wanted, in that case, was a doubly-non-negative matrix. I implemented random_doubly_nonnegative()
too if you promise not to laugh at my algorithm.
Per the docstrings, "random" is a bit of a euphemism.
Hello,
I think we should change the keyword algorithm
. The fact that output satisfies such and such properties (=specification) is not the way it is generated (=algorithm). I suggest to move the properties to separated keywords as we might want combination of keywords here.
Anyway, having only one function handling all of this looks like too much to me.
Vincent
Replying to @videlec:
Anyway, having only one function handling all of this looks like too much to me.
Then what should be names for functions, if we split this? One for random general matrix and another for square matrix? Or something for integer matrices only?
Replying to @orlitzky:
Per the docstrings, "random" is a bit of a euphemism.
It might be useful to have generators of random matrix ensembles (e.g. see http://en.wikipedia.org/wiki/Random_matrix, or section 4.3 in http://web.eecs.umich.edu/~rajnrao/Acta05rmt.pdf). Then the word "random" would get a better meaning...
Description changed:
---
+++
@@ -1 +1,9 @@
Add a function to generate random matrices that are, for example, symmetric, skew symmetric, upper/lower triangular etc.
+
+Vincent Delecroix (is sage-devel -list) suggests having several keywords:
+
+bilinear forms: skew-symmetric, symmetric, orthogonal, ...
+shape: upper triangular, lower triangular, diagonal, max_width, ...
+conjugacy class invariants: determinant, trace, characteristic polynomial, ...
+
+Even if we don't implement many of those, we should have interface that is easy to expand later.
Can we start by adding keyword shape
with possible values upper-triangular
, lower-triangular
, diagonal
, symmetric
and skew-symmetric
? For now it could raise an exception when used together with algorithm
-option.
Replying to @jm58660:
Can we start by adding keyword
shape
with possible valuesupper-triangular
,lower-triangular
,diagonal
,symmetric
andskew-symmetric
? For now it could raise an exception when used together withalgorithm
-option.
Adding the shape
keyword Looks good to me. But what would we do with random_matrix(algorithm='echelon_form')
? A deprecation?
Add a function to generate random matrices that are, for example, symmetric, skew symmetric, upper/lower triangular etc.
Vincent Delecroix (is sage-devel -list) suggests having several keywords:
bilinear forms: skew-symmetric, symmetric, orthogonal, ... shape: upper triangular, lower triangular, diagonal, max_width, ... conjugacy class invariants: determinant, trace, characteristic polynomial, ...
Even if we don't implement many of those, we should have interface that is easy to expand later.
CC: @videlec @kalvotom @pelegm
Component: linear algebra
Issue created by migration from https://trac.sagemath.org/ticket/18143