12.5 Quantum Two-Sample Test
Let A and B be two datasets, sampled, respectively, from the probability distributions P(x) and Q(x), x ∈D ⊆ℝm. The cardinality of A and B will be indicated as [A] and [B]. The samples ai ∈ A and bj ∈ B are of the form ai = (ai(1),…,ai(m)) and bj = (bj(1),…,bj(m)). Next, we define a transformation φ that maps the samples ai and bj into vectors φ(ai) and φ(bj) of a Hilbert space H. On a quantum computer, the feature map φ is realised via a unitary transformation U (parameterised quantum circuit) applied to the state |0⟩:= |0⟩⊗n. We will use the following notations:
Note that if the transformation φ is specified on n quantum registers, the dimensionality of the Hilbert space H is 2n.
Then we can construct two density matrices encoding the probability distributions P(x) and Q(x) as
The density matrices p and q and the projectors |x⟩⟨x| that...