Hadamard test

From testwiki
Jump to navigation Jump to search

Template:Short description

In quantum computation, the Hadamard test is a method used to create a random variable whose expected value is the expected real part Reψ|U|ψ, where |ψ is a quantum state and U is a unitary gate acting on the space of |ψ.[1] The Hadamard test produces a random variable whose image is in {±1} and whose expected value is exactly Reψ|U|ψ. It is possible to modify the circuit to produce a random variable whose expected value is Imψ|U|ψ by applying an S gate after the first Hadamard gate.[1]

Description of the circuit

To perform the Hadamard test we first calculate the state 12(|0+|1)|ψ. We then apply the unitary operator on |ψ conditioned on the first qubit to obtain the state 12(|0|ψ+|1U|ψ). We then apply the Hadamard gate to the first qubit, yielding 12(|0(I+U)|ψ+|1(IU)|ψ).

Measuring the first qubit, the result is |0 with probability 14ψ|(I+U)(I+U)|ψ, in which case we output 1. The result is |1 with probability 14ψ|(IU)(IU)|ψ, in which case we output 1. The expected value of the output will then be the difference between the two probabilities, which is 12ψ|(U+U)|ψ=Reψ|U|ψ

To obtain a random variable whose expectation is Imψ|U|ψ follow exactly the same procedure but start with 12(|0i|1)|ψ.[2]

The Hadamard test has many applications in quantum algorithms such as the Aharonov-Jones-Landau algorithm. Via a very simple modification it can be used to compute inner product between two states |ϕ1 and |ϕ2:[3] instead of starting from a state |ψ it suffice to start from the ground state |0, and perform two controlled operations on the ancilla qubit. Controlled on the ancilla register being |0, we apply the unitary that produces |ϕ1 in the second register, and controlled on the ancilla register being in the state |1, we create |ϕ2 in the second register. The expected value of the measurements of the ancilla qubits leads to an estimate of ϕ1|ϕ2. The number of samples needed to estimate the expected value with absolute error ϵ is O(1ϵ2), because of a Chernoff bound. This value can be improved to O(1ϵ) using amplitude estimation techniques.[3]

References

Template:Reflist ,