# Are nearly all pure two-qubit state entangled?

I am using the code below, utilizing QETLAB's RandomStateVector(4) and IsPPT, to generate a random state and to judge whether the state is entangled or separable:

clear all; clc;
for i = 1:30000
psi = RandomStateVector(4);
rho = psi*psi';
if IsPPT(rho)
'yes'
end
end


But why does the program nearly never get inside the if block? I didn't see one single yes output. But the program works well, and if I use RandomDensityMatrix(4) instead, it's easy to see the output yes.

So, does it mean that for pure two qubits state, nearly all state are entangled?

Let $$\mathcal{F}$$ denote the set of all pure states of two qubits and $$\mathcal{S}$$ denote the set of all pure product states of two qubits. Note that $$\mathcal{S}$$ can be thought of as the Cartesian product of two Bloch spheres. Therefore, $$\mathcal{S}$$ is a four-dimensional real manifold. On the other hand, one needs six real numbers to describe an element of $$\mathcal{F}$$. Thus, $$\mathcal{S}$$ is a low dimensional submanifold of $$\mathcal{F}$$.
Consequently, a pure two-qubit state selected uniformly$$^1$$ at random is entangled almost surely, i.e. with probability one. Finally, two qubit state is entangled if and only if its partial transpose is not positive. Therefore, the partial transpose of a pure two-qubit state selected uniformly at random fails to be positive with probability one.
$$^1$$ The same applies to every probability measure which is absolutely continuous with respect to the uniform probability measure.