For questions related to the "Swap test": a quantum algorithm whose purpose is to quantify the distance between two given quantum states.
Questions tagged [swap-test]
40 questions
15
votes
2 answers
How and why does swap test works?
I am having some trouble understanding why a SWAP test would work. I meant I read that and understood the concepts as follows:
If the two input states are equal, the output register always results
in a state of $|1\rangle$, so a $1$ outcome will be…
Hamza
- 301
- 2
- 7
9
votes
2 answers
Distance calculation between two vectors
In Quantum Machine Learning for data scientists, Page 34 gives an algorithm to calculate the distance between two classifical vectors. As mentioned in this question, it is not clear how the SwapTest is done and used to derive the distance. One…
czwang
- 949
- 1
- 6
- 17
8
votes
0 answers
Optimal estimation of quantum state overlap - Circuit implementation?
I've been reading this paper, but don't understand what their optimal method really is, and how it can be realized as a quantum circuit.
The paper mentions the "Schur transform" which has a circuit provided in this paper. But is this Schur transform…
Loic Stoic
- 433
- 2
- 10
5
votes
0 answers
Explanation of the generalized SWAP test: the permutation test?
I am reading this paper on the state separability problem, and came across the term “Permutation Test.” This is on page 7 section 2.3.
Apparently, the more famous SWAP test is a special case of permutation test; but I’ve never heard of it.
The steps…
TwentyCents
- 117
- 4
5
votes
1 answer
Fidelity (overlap) test over reduced density matrices on quantum circuit
The inner product between two quantum states
$\rho(x_1) = U(x_1)|0\rangle\langle 0| U^\dagger(x_1)$ and
$\rho(x_2) = U(x_2)|0\rangle\langle 0| U^\dagger(x_2)$ can be calculated analytically with $Tr[\rho(x_1) \rho(x_2)]$, but when implementing…
incud
- 817
- 7
- 21
5
votes
1 answer
Swap test vs measurement in a specific basis
I have two states $|\psi\rangle$ and $|\phi\rangle$. The swap test allows to estimate $|\langle \psi | \phi \rangle|^2$ by using the controlled SWAP gate and a couple of Hadamard gates. To obtain the estimate we repetitively measure the first qubit…
Moonlighter
- 53
- 3
5
votes
2 answers
How do you test a pair of unknown qubits for orthogonality with certainty?
If you want to check if a pair of unknown qubits are the same, a standard test is the controlled SWAP test. This gives a result of 0 with certainty if the states are the same and 1 with a 50% chance if the states are orthogonal. The resulting…
Jason Pereira
- 91
- 2
4
votes
1 answer
What is the "additive error" of Swap Test?
I'm learning the Swap Test, a quantum circuit to calculate the inner product of two quantum states $|\langle \phi|\psi\rangle|^2 $:
For the error analysis of this quantum circuit, according to Swap Test:
"This allows one to, for example, estimate…
Saul_better
- 365
- 1
- 8
4
votes
0 answers
Comparing two sets of qudits
Suppose we are given two sequences of qudits, in some states unknown to us: $(|\psi_1\rangle, ... |\psi_n\rangle)$ and $(|\phi_1\rangle, ... |\phi_n\rangle)$. The qudits are not entangled to each other. What procedure can we use to determine whether…
shashvat
- 847
- 5
- 13
4
votes
2 answers
Estimating imaginary part of an inner product of two quantum states
Suppose I want to estimate $Im(\langle \psi_1\lvert \sigma_x\lvert \psi_2\rangle)$ by using quantum circuit.
At first, I thought of using the Swap test, but since it gives $|\langle \psi_1|\psi_2\rangle|^2$, it won't give the imaginary part.
Then, I…
userflux9674
- 335
- 1
- 5
4
votes
1 answer
How to implement the swap test with the help of qiskit?
It's creating a real confusion for me especially the parameterized circuit which I have to create. Can anybody please solve this for me? I want to create this circuit.
sohamb172
- 355
- 2
- 15
3
votes
2 answers
Can the SWAP test only compare registers with the same number of qubits?
I'm using the SWAP test circuit for implementing a qubit registers comparison
From the documentation I could find I've understood it can be applied to input qubits |$\alpha\rangle$ and |$\beta\rangle$ of the same size.
Is that really a…
Gianni
- 364
- 1
- 7
3
votes
3 answers
How can I move a C.NOT over a circuit
I am doing some Quantum Computing Exercises and I am curious on how you go from left to right in this picture...
I see not only how the c-not moves but also a new bond between X gates in second and third qubit..
I have been trying to find the…
3
votes
1 answer
Can we test whether $|\psi\rangle$ is orthogonal to $|\phi\rangle$ without creating a coherent superposition therebetween?
Let a first register store $|\psi\rangle$ and a second register store $|\phi\rangle$, and let us be promised that either $\vert\langle\psi|\phi\rangle\vert^2=0$ or $\vert\langle\psi|\phi\rangle\vert^2=1$; the standard approach to determine which is…
Mark Spinelli
- 15,378
- 3
- 26
- 83
3
votes
1 answer
Integral over Haar measure of squared density matrix of Haar random state is proportional to the identity plus swap operator
I am having some trouble understanding why $\int d\psi (| \psi \rangle \langle \psi | )^{\otimes ^2}\propto \ I+$ SWAP , where $|\psi \rangle =U|\psi _0\rangle$ are Haar random states and $d\psi $ is the Haar measure.
I am somewhat convinced that…
Andrew Dynneson
- 33
- 4