toqito.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ᵈ.
Module Contents¶
- toqito.states.mutually_unbiased_basis.mutually_unbiased_basis(dim)[source]¶
Generate list of MUBs for a given dimension [@WikiMUB].
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:
- [
M_0 = left{|0rangle, |1rangle right}, \ M_1 = left{frac{|0rangle + |1rangle}{sqrt{2}}, frac{|0rangle - |1rangle}{sqrt{2}}right} M_2 = left{frac{|0rangle + i|1rangle}{sqrt{2}}, frac{|0rangle - i|1rangle}{sqrt{2}}right}
]
The six vectors above are obtained accordingly:
`python exec="1" source="above" session="mubs" from toqito.states import mutually_unbiased_basis mubs = mutually_unbiased_basis(2) print(len(mubs)) ``python exec="1" source="above" session="mubs" lst =[vec.shape for vec in mubs] print(lst) `- 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]