rand.random_povm

Generate random POVM.

Module Contents

Functions

random_povm(dim, num_inputs, num_outputs)

Generate random positive operator valued measurements (POVMs) [1].

rand.random_povm.random_povm(dim, num_inputs, num_outputs)

Generate random positive operator valued measurements (POVMs) [1].

Examples

We can generate a set of dim-by-dim POVMs consisting of a specific dimension along with a given number of measurement inputs and measurement outputs. As an example, we can construct a random set of \(2\)-by-\(2\) POVMs of dimension with \(2\) inputs and \(2\) outputs.

>>> from toqito.rand import random_povm
>>> import numpy as np
>>>
>>> dim, num_inputs, num_outputs = 2, 2, 2
>>> povms = random_povm(dim, num_inputs, num_outputs)
>>> povms  
array([[[[ 0.20649603+0.j,  0.79350397+0.j],
         [ 0.77451456+0.j,  0.22548544+0.j]],

        [[-0.25971638+0.j,  0.25971638+0.j],
         [-0.28048509+0.j,  0.28048509+0.j]]],


       [[[-0.25971638+0.j,  0.25971638+0.j],
         [-0.28048509+0.j,  0.28048509+0.j]],

        [[ 0.40448792+0.j,  0.59551208+0.j],
         [ 0.10740892+0.j,  0.89259108+0.j]]]])

We can verify that this constitutes a valid set of POVM elements as checking that these operators all sum to the identity operator.

>>> np.round(povms[:, :, 0, 0] + povms[:, :, 0, 1]) 
[[1.+0.j, 0.+0.j],
 [0.+0.j, 1.+0.j]]

References

[1] (1,2)

Wikipedia. POVM. https://en.wikipedia.org/wiki/POVM.

Parameters:
  • dim (int) – The dimensions of the measurements.

  • num_inputs (int) – The number of inputs for the measurement.

  • num_outputs (int) – The number of outputs for the measurement.

Returns:

A set of dim-by-dim POVMs of shape (dim, dim, num_inputs, num_outputs).

Return type:

numpy.ndarray