# Can the WishartMatrixDistribution command be used for generating random density matrices?

I am interested in generating random members of two classes of $$n \times n$$ positive-definite matrices $$A$$ and $$B$$--the former symmetric in nature, the latter, Hermitian.

The standard (Ginibre-matrix-based) approach (Ginibre) to obtaining random realizations of $$A$$ is to generate an $$n \times n$$ matrix $$a$$, the $$n^2$$ entries of which are standard univariate normal variates. Then, the desired realization of $$A$$ is gotten by computing the matrix product $$a a^T$$, where the transpose is indicated.

To obtain random realizations of $$B$$, one starts with an $$n \times n$$ matrix $$b$$, the $$n^2$$ entries of which are of the form $$c + d I$$, where $$c$$ and $$d$$ are themselves standard univariate normal variates. Then, the desired realization of $$B$$ is obtained by computing the matrix product $$b b^\dagger$$, where the conjugate transpose is denoted.

(If the random realizations of $$A$$ and $$B$$ are normalized to have trace 1, then they are--in physics parlance--density matrices randomly distributed with respect to Hilbert-Schmidte measure. It is, then, of interest to test their "partial transposes" for positive-definiteness. For $$n=4,6$$, such tests are equivalent to ones for "separability" [PPT].)

Can such desired random realizations be accomplished with the WishartMatrixDistribution command (in conjunction with the RandomVariate command), and, if so, might there be an associated speed-up in comparison to the Ginibre-matrix-product approach outlined above?

Also, more generally, what if the classes of matrices are $$k \times n$$, with $$k? (This pertains to the PPT/separability problem for $$n \times n$$ matrices of rank $$k$$.)

• What kind of speed gains are you looking for? The two approaches you cite for 1000 x 1000 matrices can be generated on the order of 40 ms. Did you want something significantly faster? – Carl Woll Sep 1 '20 at 18:23
• Thanks, Carl Woll! No, the matrices in which I'm currently interested in are of much smaller dimensions--so I guess you're saying no real speed differences. Are the covariances matrices to be used in the WishartMatrixDistribution command in my application, simply unit-diagonal ones? – Paul B. Slater Sep 1 '20 at 19:51