RandomPOVM

RandomPOVM is a function that generates a random POVM (positive-operator valued measure) with a specified dimension and number of measurement outcomes.

Syntax

 * P = RandomPOVM(DIM,OUTC)
 * P = RandomPOVM(DIM,OUTC,RE)

Argument descriptions

 * DIM: A scalar indicating the size of the POVM elements (i.e., each POVM element will have size DIM-by-DIM).
 * OUTC: The number of POVM elements (i.e., the number of possible measurement outcomes).
 * RE (optional, default 0): A flag (either 1 or 0) indicating that the entries of the POVM should or should not all be real.

Examples
The following code generates a random POVM on 4-dimensional space with 3 measurement outcomes:

It is straightforward to verify that these operators are positive semidefinite and sum to the identity (and thus form a valid POVM):