Random quantum objects

Random quantum states

Pure states

Pure states are elements of the unit sphere in $\mathrm{X}$. Thus it is straightforward to generate them randomly. We start with a vector of $\dim(\mathrm{X})$ independent complex numbers sampled from the standard normal distribution. What remains is to normalize the length of this vector to unity.

This is implemented using the HaarKet{β} type. The value $\beta=1$ corresponds to the Haar measure on the unit sphere in $\mathbb{R}^d$, while $\beta=2$ corresponds to the Haar measure on the unit sphere in $\mathbb{C}^d$. The usage is as follows

julia> h = HaarKet{2}(3)HaarKet{2}(3)
julia> ψ = rand(h)3-element Vector{ComplexF64}: 0.3894760412538869 + 0.24030699341136333im 0.002727754359932026 + 0.3817454591737639im 0.765196111912266 - 0.24351352380824048im
julia> norm(ψ)1.0

For convenience we provide the following constructor HaarKet(d::Int) = HaarKet{2}(d) as the majority of uses cases require sampling complex states.

Mixed states

Random mixed states can be generated in one of two equivalent ways. The first one comes from the partial trace of random pure states. Suppose we have a pure state $|\psi\rangle \in \mathrm{X} \otimes \mathrm{Y}$. Then we can obtain a random mixed as \begin{equation} \rho = \mathrm{Tr}_\mathrm{Y} |\psi\rangle\langle\psi|. \end{equation} Note that in the case $\dim(\mathrm{X})=\dim(\mathrm{Y})$ we recover the (flat) Hilbert-Schmidt distribution on the set of quantum states.

An alternative approach is to start with a Ginibre matrix $G \in \mathrm{L}(\mathrm{X}, \mathrm{Y})$. We obtain a random quantum state $\rho$ as \begin{equation} \rho = GG^\dagger/\mathrm{Tr}(GG^\dagger). \end{equation} It can be easily verified that this approach is equivalent to the one utilizing random pure states. First, note that in both cases we start with $\dim(\mathrm{X}) \dim(\mathrm{Y})$ complex random numbers sampled from the standard normal distribution. Next, we only need to note that taking the partial trace of a pure state $|\psi\rangle$ is equivalent to calculating $AA^\dagger$ where $A$ is a matrix obtained from reshaping $|\psi\rangle$.

Sampling random mixed states is implemented using the HilbertSchmidtStates{β, K} type. The meaning of the type parameters is the same as in the Wishart matrices case. We provide additional constructors which set the default values of the parameters HilbertSchmidtStates{β}(d::Int) where β = HilbertSchmidtStates{β, 1}(d), HilbertSchmidtStates(d::Int) = HilbertSchmidtStates{2, 1}(d). The latter one is the most frequent use case. Here is an example

julia> h = HilbertSchmidtStates(3)HilbertSchmidtStates{2, 1}(WishartEnsemble{2, 1}(3, GinibreEnsemble{2}(3, 3)), 3)
julia> ρ = rand(h)3×3 Matrix{ComplexF64}: 0.144183+0.0im 0.103598-0.12163im 0.12772+0.0341462im 0.103598+0.12163im 0.629147+0.0im 0.00497732-0.0738056im 0.12772-0.0341462im 0.00497732+0.0738056im 0.226671+0.0im
julia> tr(ρ)0.9999999999999999 + 0.0im
julia> eigvals(ρ)3-element Vector{Float64}: 0.0012268943782162995 0.3174911484697322 0.6812819571520516

Random quantum channels

Quantum channels are a special subclass of quantum states with constraints imposed on their partial trace as well as trace. Formally, we start with a Ginibre matrix $G \in \mathrm{L} (\mathrm{X} \otimes \mathrm{Y}, \mathrm{Z})$. We obtain a random Choi-Jamiołkowski matrix $J_\Phi$ corresponding to a channel $\Phi$ as $J_\Phi = \left( \mathbb{I}_{\mathrm{X}} \otimes (\mathrm{Tr}_\mathrm{X} GG^\dagger)^{-1/2} \right) GG^\dagger \left( \mathbb{I}_{\mathrm{X}} \otimes (\mathrm{Tr}_\mathrm{X} GG^\dagger)^{-1/2} \right).$

When $\dim(\mathrm{Z})=\dim(\mathrm{X}) \dim(\mathrm{Y})$ this is known to generate a uniform distribution over the set of quantum channels.

The implementation uses the type ChoiJamiolkowskiMatrices{β, K}. The parameters $\beta$ and $K$ have the same meaning as in the Wishart matrix case. Additionally here, the constructor ChoiJamiolkowskiMatrices{β, K}(idim::Int, odim::Int) where {β, K} takes two parameters–the input and output dimension of the channel. As in the previous cases we provide some additional constructors for convenience

function ChoiJamiolkowskiMatrices{β}(idim::Int, odim::Int) where β ChoiJamiolkowskiMatrices{β, 1}(idim, odim) end,

function ChoiJamiolkowskiMatrices{β}(d::Int) where β ChoiJamiolkowskiMatrices{β}(d, d) end,

function ChoiJamiolkowskiMatrices(idim::Int, odim::Int) ChoiJamiolkowskiMatrices{2}(idim, odim) end,

function ChoiJamiolkowskiMatrices(d::Int) ChoiJamiolkowskiMatrices(d, d) end.

Here is an example of usage

julia> c = ChoiJamiolkowskiMatrices(2, 3)ChoiJamiolkowskiMatrices{2, 1}(WishartEnsemble{2, 1}(6, GinibreEnsemble{2}(6, 6)), 2, 3)
julia> Φ = rand(c)DynamicalMatrix{Matrix{ComplexF64}} dimensions: (2, 3) ComplexF64[0.31428176393856166 + 2.2630264271363866e-17im -0.04556984938199178 - 0.08446233450244856im … -0.007888573920427987 - 0.0311402358979447im 0.001857632360470999 + 0.207654562006748im; -0.04556984938199179 + 0.08446233450244854im 0.1671306361189717 - 7.701888430714371e-19im … 0.15164196530251103 - 0.018412171830688776im -0.04354834834186267 + 0.06911761499510287im; … ; -0.007888573920427988 + 0.031140235897944707im 0.15164196530251103 + 0.018412171830688787im … 0.41493910211639407 + 3.1008182133085427e-17im -0.013197343463404 + 0.0879515558795061im; 0.0018576323604710138 - 0.207654562006748im -0.04354834834186267 - 0.06911761499510286im … -0.013197343463403984 - 0.08795155587950611im 0.39102737694096734 + 8.673617379884035e-19im]
julia> ptrace(Φ.matrix, [3, 2],[1])2×2 Matrix{ComplexF64}: 1.0+7.35757e-17im 1.07553e-16+1.38778e-16im 1.16226e-16-1.52656e-16im 1.0+2.45468e-19im

Note that the resulting sample is of type DynamicalMatrix.

Random Matrix Ensembles

The package provides support for sampling from various random matrix ensembles.

Ginibre Ensemble

The Ginibre ensemble allows sampling non-Hermitian random matrices.

julia> rand(GinibreEnsemble(ComplexF64, 3, 3))ERROR: MethodError: no method matching GinibreEnsemble(::Type{ComplexF64}, ::Int64, ::Int64)
The type `GinibreEnsemble` exists, but no method is defined for this combination of argument types when trying to construct it.

Closest candidates are:
  GinibreEnsemble(::Int64, ::Int64)
   @ MatrixEnsembles ~/.julia/packages/MatrixEnsembles/LbbyE/src/ginibre.jl:14
  GinibreEnsemble(::Int64)
   @ MatrixEnsembles ~/.julia/packages/MatrixEnsembles/LbbyE/src/ginibre.jl:15

Circular Ensembles

Circular ensembles (COE, CUE, CSE) are available for sampling unitary matrices distributed according to Haar measure.

julia> rand(CUE(3))3×3 Matrix{ComplexF64}:
 -0.526552-0.0776714im    0.368184-0.593846im   0.468252+0.0961074im
  -0.81282+0.137755im   -0.0574312+0.295033im  -0.478493+0.0323765im
 -0.184578-0.0546537im   -0.462296+0.45577im    0.656775+0.331882im

Wishart Ensemble

The Wishart ensemble is used for sampling random positive semi-definite matrices.

julia> rand(WishartEnsemble(3, 3))ERROR: MethodError: no method matching WishartEnsemble(::Int64, ::Int64)
The type `WishartEnsemble` exists, but no method is defined for this combination of argument types when trying to construct it.

Closest candidates are:
  WishartEnsemble(::Int64)
   @ MatrixEnsembles ~/.julia/packages/MatrixEnsembles/LbbyE/src/wishart.jl:16

References

[1] B. Collins, I. Nechita, Random matrix techniques in quantum information theory, Journal of Mathematical Physics, 2016;57(1):015215.

[2] W. K. Wootters, Random quantum statesy, Foundations of Physics, 1990;20(11):1365–1378.

[3] K. Życzkowski, H. J. Sommers, Induced measures in the space of mixed quantum states, Journal of Physics A: Mathematical and General, 2001;34(35):7111.

[4] H. J. Sommers, K. Życzkowski, Statistical properties of random density matrices, Journal of Physics A: Mathematical and General, 2004;37(35):8457.

[5] Z. Puchała, Ł. Pawela, K. Życzkowski, Distinguishability of generic quantum states, Physical Review A, 2016;93(6):062112.

[6] L. Zhang, U. Singh, A. K. Pati, Average subentropy, coherence and entanglement of random mixed quantum states, Annals of Physics, 2017;377:125–146.

[7] L. Zhang, Average coherence and its typicality for random mixed quantum states, Journal of Physics A: Mathematical and Theoretical, 2017;50(15):155303.

[8] W. Bruzda, V. Cappellini, H. J. Sommers, K. Życzkowski, Random quantum operations, Physics Letters A, 2009;373(3):320–324.

[9] I. Nechita, Z. Puchała, L. Pawela, K. Życzkowski, Almost all quantum channels are equidistant, Journal of Mathematical Physics, 2018;59(5):052201.

[10] L. Zhang, J. Wang, Z. Chen, Spectral density of mixtures of random density matrices for qubits, Physics Letters A, 2018;382(23):1516–1523.

[11] J. Ginibre, Statistical ensembles of complex, quaternion, and real matrices, Journal of Mathematical Physics, 1965;6(3):440–449.

[12] M. L. Mehta, Random matrices. vol. 142., Elsevier; 2004.

[13] K. Życzkowski, M. Kuś, Random unitary matrices, Journal of Physics A: Mathematical and General, 1994;27(12):4235.

[14] C. Jarlskog, A recursive parametrization of unitary matrices, Journal of Mathematical Physics, 2005;46(10):103508.