QuantumCore

Hands-on lab · 1 step

Evaluate a quantum kernel entry

Compute one entry of a quantum kernel matrix by hand: the fidelity kernel K(x,x′)=∣⟨ϕ(x)∣ϕ(x′)⟩∣2K(x,x')=\lvert\langle\phi(x)\vert\phi(x')\rangle\rvert^2 of the two-qubit RXR_X product encoding at x=(0.3,1.2)x=(0.3,1.2) and x′=(1.0,0.4)x'=(1.0,0.4), using the closed form ∏jcos⁡2xj−xj′2\prod_j\cos^2\frac{x_j-x'_j}{2} derived in the lesson.

0/1 step passedBest score 0/100

Step 1: The kernel value K(x, x′)

Two classical samples x,x′∈R2x,x'\in\mathbb R^2 are encoded by the RXR_X product encoding on two qubits,

∣ϕ(x)⟩=RX(x0)⊗RX(x1) ∣00⟩,RX(θ)=e−iθX/2=(cos⁡θ2−isin⁡θ2−isin⁡θ2cos⁡θ2).\lvert\phi(x)\rangle=R_X(x_0)\otimes R_X(x_1)\,\lvert00\rangle,\qquad R_X(\theta)=e^{-i\theta X/2}=\begin{pmatrix}\cos\frac\theta2&-i\sin\frac\theta2\\-i\sin\frac\theta2&\cos\frac\theta2\end{pmatrix}.

Compute the fidelity kernel

K(x,x′)=∣⟨ϕ(x)∣ϕ(x′)⟩∣2forx=(0.3, 1.2),x′=(1.0, 0.4).K(x,x')=\lvert\langle\phi(x)\vert\phi(x')\rangle\rvert^2\qquad\text{for}\qquad x=(0.3,\,1.2),\quad x'=(1.0,\,0.4).

Enter a single real number. The answer is graded with absolute tolerance 10−310^{-3}; you may also type an exact expression such as cos(0.35)^2*cos(0.4)^2.

Enter exact expressions or decimals, e.g. 1/sqrt(2), pi/3. Values must be real.

enter a value
Fill every field with a valid expression.