iqm.benchmarks.compressive_gst.mgst.additional_fns.randpsd

Contents

iqm.benchmarks.compressive_gst.mgst.additional_fns.randpsd#

iqm.benchmarks.compressive_gst.mgst.additional_fns.randpsd(n: int, normalized: str = 'True') ndarray#

Generate a random positive semidefinite square matrix.

Parameters:
  • n (int) – Number of matrix entries

  • normalized (str) – Controls if the output is trace normalized

Returns:

Random positive definite square matrix

Return type:

mat

Notes

Eigenvalues are drawn uniformly from the interval [0,1); The basis is generated by diagonalizing a random hermitian matrix (see randHerm function).