Skip to content

vprusso/qustop

Repository files navigation

logo

QUSTOP

build status doc status codecov

NOTE: The qustop package is still is under development.

The qustop (QUantum STate OPtimizer) package is a Python toolkit for studying various quantum state optimization scenarios including calculating optimal values for quantum state distinguishability, quantum state exclusion, quantum state cloning, and more.

Applications

The qustop package can be used to:

  • Calculate and approximate optimal probabilities of distinguishing quantum states over positive, PPT, and separable measurements with either minimum-error or unambiguously.

  • Calculate and approximate optimal probabilities of excluding quantum states with either minimum-error or unambiguously.

Installation

See the installation guide.

Usage

See the documentation.

Examples

For more examples, please consult qustop/examples as well as the qustop introductory tutorial.

Quantum state distinguishability

Further examples on quantum state distinguishability can be found in the qustop/examples/opt_dist directory.

Consider the following Bell states:

\Large x=\frac{-b\pm\sqrt{b^2-4ac}}{2c}

\Large x=\frac{-b\pm\sqrt{b^2-4ac}}{2c}

We will be using these states to consider a number of applications in the realm of quantum state distinguishability.

Distinguishing two orthogonal states

A result of arXiv:0007098 states that any two orthogonal pure states can be distinguished perfectly by LOCC measurements. As the optimal probability of distinguishing via LOCC measurements is a lower bound on positive, PPT, separable, etc., we should expect to also see a value of 1 to indicate perfect probability of distinguishing.

from toqito.states import bell
from qustop import State, Ensemble, OptDist

dims = [2, 2]
states = [
    State(bell(0) * bell(0).conj().T, dims),
    State(bell(1) * bell(1).conj().T, dims)
]
probs = [1/2, 1/2]
ensemble = Ensemble(states, probs)

sep_res = OptDist(ensemble, "sep", "min-error")
sep_res.solve()

ppt_res = OptDist(ensemble, "ppt", "min-error")
ppt_res.solve()

pos_res = OptDist(ensemble, "pos", "min-error")
pos_res.solve()

Checking the respective values of the solved instances, we see that all of the values are equal to one, which indicate that the two pure states are indeed perfectly distinguishable under PPT, separable, and positive measurements.

>>> print(pos_res.value)
0.9999999999384911
>>> print(ppt_res.value)
1.0000000047560667
>>> print(sep_res.value)
0.9999999995278338

Four indistinguishable orthogonal maximally entangled states

It was shown in arXiv:1205.1031 and later extended in arXiv:1307.3232 that for the following set of states

\Large x=\frac{-b\pm\sqrt{b^2-4ac}}{2c}

\Large x=\frac{-b\pm\sqrt{b^2-4ac}}{2c}

that the optimal probability of distinguishing via a PPT measurement should yield an optimal probability of 7/8.

import numpy as np

from toqito.states import bell
from qustop import State, Ensemble, OptDist

dims = [2, 2, 2, 2]
rho_0 = np.kron(bell(0), bell(0)) * np.kron(bell(0), bell(0)).conj().T
rho_1 = np.kron(bell(2), bell(1)) * np.kron(bell(2), bell(1)).conj().T
rho_2 = np.kron(bell(3), bell(1)) * np.kron(bell(3), bell(1)).conj().T
rho_3 = np.kron(bell(1), bell(1)) * np.kron(bell(1), bell(1)).conj().T

ensemble = Ensemble([
    State(rho_0, dims), State(rho_1, dims),
    State(rho_2, dims), State(rho_3, dims)
])

sd = OptDist(ensemble, "ppt", "min-error")
sd.solve()

Indeed the optimal value obtained via qustop is equal to 7/8:

# 7/8 \approx 0.875
>>> print(sd.value)
0.8749769201568257

It was also shown in arXiv:1205.1031 that the optimal probability of distinguishing amongst these same state unambiguously via PPT measurements was equal to 3/4.

sd = OptDist(ensemble, "ppt", "unambiguous")
sd.solve()

# 3/4 = 0.75
>>> print(sd.value)
0.749999999939434

Entanglement cost of distinguishing Bell states

One may ask whether the ability to distinguish a state can be improved by making use of an auxiliary resource state.

\Large x=\frac{-b\pm\sqrt{b^2-4ac}}{2c},

for some ε in [0, 1].

It was shown in arXiv:1408.6981 that the probability of distinguishing four Bell states with a resource state via PPT measurements or separable measurements is given by the closed-form expression

\Large x=\frac{-b\pm\sqrt{b^2-4ac}}{2c}

where the ensemble is defined as

\Large x=\frac{-b\pm\sqrt{b^2-4ac}}{2c}

Using qustop, we may encode this scenario as follows.

import numpy as np

from toqito.states import basis, bell
from qustop import State, Ensemble, OptDist


e_0, e_1 = basis(2, 0), basis(2, 1)

eps = 0.5
tau = np.sqrt((1 + eps) / 2) * np.kron(e_0, e_0) + np.sqrt((1 - eps) / 2) * np.kron(e_1, e_1)

dims = [2, 2, 2, 2]
states = [
    State(np.kron(bell(0), tau), dims),
    State(np.kron(bell(1), tau), dims),
    State(np.kron(bell(2), tau), dims),
    State(np.kron(bell(3), tau), dims),
]
probs = [1 / 4, 1 / 4, 1 / 4, 1 / 4]
ensemble = Ensemble(states, probs)

sep_res = OptDist(ensemble, "sep", "min-error")
sep_res.solve()

ppt_res = OptDist(ensemble, "ppt", "min-error")
ppt_res.solve()

eq = 1 / 2 * (1 + np.sqrt(1 - eps ** 2))

Note that when we print out the optimal values for both separable and PPT measurements that the values obtained agree with the closed form expression.

>>> print(eq)
0.9330127018922193
>>> print(ppt_res.value)
0.933010488554166
>>> print(sep_res.value)
0.9330124607534689

It was also shown in arXiv:1408.6981 that the closed-form probability of distinguishing three Bell states with a resource state using separable measurements to be given by the closed-form expression:

\Large x=\frac{-b\pm\sqrt{b^2-4ac}}{2c}

where the ensemble is defined as

\Large x=\frac{-b\pm\sqrt{b^2-4ac}}{2c}

Using qustop, we may encode this scenario as follows.

import numpy as np

from toqito.states import basis, bell
from qustop import State, Ensemble, OptDist


e_0, e_1 = basis(2, 0), basis(2, 1)

eps = 0.5
tau = np.sqrt((1 + eps) / 2) * np.kron(e_0, e_0) + np.sqrt((1 - eps) / 2) * np.kron(e_1, e_1)

dims = [2, 2, 2, 2]
states = [
    State(np.kron(bell(0), tau), dims),
    State(np.kron(bell(1), tau), dims),
    State(np.kron(bell(2), tau), dims),
]
probs = [1 / 3, 1 / 3, 1 / 3]
ensemble = Ensemble(states, probs)

sep_res = OptDist(ensemble, "sep", "min-error", level=2)
sep_res.solve()

eq = 1 / 3 * (2 + np.sqrt(1 - eps**2))

Pritning the values of both the closed-form equation and the value obtained via the SDP, we obtain:

>>> print(sep_res.value)
0.9583057987150858
>>> print(eq)
0.9553418012614794

Note that the value of sep_res.value is actually a bit higher than eq. This is because the separable value is calculated by a hierarchy of SDPs. At low levels of the SDP, the problem can often converge to the optimal value, but other times it is necessary to compute higher levels of the SDP to eventually arrive at the optimal value. While this is intractable in general, in practice, the SDP can often converge or at least get fairly close to the optimal value for small problem sizes.

Werner hiding pairs

In arXiv:0011042 and arXiv:0103098 a quantum data hiding protocol that encodes a classical bit in a Werner hiding pair was provided.

A Werner hiding pair is defined as

\Large x=\frac{-b\pm\sqrt{b^2-4ac}}{2c}

where

\Large x=\frac{-b\pm\sqrt{b^2-4ac}}{2c}

is the swap operator defined for some dimension n >= 2.

It was show in hdl:10012/9572 that

\Large x=\frac{-b\pm\sqrt{b^2-4ac}}{2c}

where the ensemble is defined as

\Large x=\frac{-b\pm\sqrt{b^2-4ac}}{2c}

Using qustop, we may encode this scenario as follows.

import numpy as np
from toqito.perms import swap_operator
from qustop import Ensemble, State, OptDist


dim = 2
sigma_0 = (np.kron(np.identity(dim), np.identity(dim)) + swap_operator(dim)) / (dim * (dim + 1))
sigma_1 = (np.kron(np.identity(dim), np.identity(dim)) - swap_operator(dim)) / (dim * (dim - 1))

states = [State(sigma_0, [2, 2]), State(sigma_1, [2, 2])]
ensemble = Ensemble(states)

expected_val = 1 / 2 + 1 / (dim + 1)

sd = OptDist(ensemble=ensemble, 
             dist_measurement="ppt",
             dist_method="min-error",
             eps=1e-8)

sd.solve()

We can verify that the closed-form expression matches that of the value returned from qustop.

print(sd.value)
0.8333333333668715
print(expected_val)
0.8333333333333333

State exclusion

The primary difference between the quantum state distinguishability scenario and the quantum state exclusion scenario is that in the former, Bob want to guess which state he was given, and in the latter, Bob wants to guess which state he was not given.

State cloning

(Coming soon).

License

GNU GPL v.3.0.