states.mutually_unbiased_basis

Mutually unbiased basis states.

If a system prepared in an eigenstate of one of the bases gives an equal probability of (1/d) when measured with respect to the other bases, mutually unbiased basis states are orthonormal bases in the Hilbert space Cᵈ.

Functions

mutually_unbiased_basis(dim)

Generate list of MUBs for a given dimension [1].

_is_prime_power(n)

Determine if a number is a prime power.

Module Contents

states.mutually_unbiased_basis.mutually_unbiased_basis(dim)

Generate list of MUBs for a given dimension [1].

Note that this function only works if the dimension provided is prime or a power of a prime. Otherwise, we don’t know how to generate general MUBs.

Examples

For the case of dimension 2, the three mutually unbiased bases are provided by:

\[\begin{split}M_0 = \left\{|0\rangle, |1\rangle \right\}, \\ M_1 = \left\{\frac{|0\rangle + |1\rangle}{\sqrt{2}}, \frac{|0\rangle - |1\rangle}{\sqrt{2}}\right\} M_2 = \left\{\frac{|0\rangle + i|1\rangle}{\sqrt{2}}, \frac{|0\rangle - i|1\rangle}{\sqrt{2}}\right\}\end{split}\]

References

[1] (1,2)

Wikipedia. Mutually unbiased bases. URL: https://en.wikipedia.org/wiki/Mutually_unbiased_bases.

Parameters:

dim (int) – The dimension of the mutually unbiased bases to produce.

Returns:

The set of mutually unbiased bases of dimension dim (if known).

Return type:

list[numpy.ndarray]

states.mutually_unbiased_basis._is_prime_power(n)

Determine if a number is a prime power.

A number is a prime power if it can be written as p^k, where p is a prime number and k is an integer greater than 0.

Parameters:

n (int) – An integer to check for being a prime power.

Returns:

True if n is a prime power, False otherwise.

Return type:

bool