Questions tagged [hadamard-test]

15 questions
11
votes
1 answer

What is the original reference for the Hadamard test?

The Hadamard test is a widely used routine in quantum computing to compute the real and imaginary part of expectation values of unitary operators. However, all papers I have come across in the literature that make use of the Hadamard test fail to…
bm442
  • 1,317
  • 1
  • 6
  • 17
6
votes
1 answer

Generalized version of the Hadamard test for $\text{Re} \langle \phi | U | \psi \rangle$

I am wondering if it is possible to generalize the Hadamard test for computing $\text{Re} \langle \phi | U | \psi \rangle$ (different states for left and right operands).
francler
  • 181
  • 1
  • 8
6
votes
2 answers

What is a Hadamard test?

What is a Hadamard test? I have seen this term at many places in video lectures and on various weblinks. A detailed answer on this would be a great help. This is what Wikipedia says, but I really could not understand anything. Edit I have some…
Manu
  • 247
  • 2
  • 13
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
4
votes
1 answer

Modified hadamard test with $O(\frac{1}{\epsilon})$ samples using amplitude estimation

On the wikipedia entry for the Hadamard test, it mentions the test can be used with amplitude estimation to only require $O(\frac{1}{\epsilon})$ samples, rather than $O(\frac{1}{\epsilon^2})$ samples. The wikipedia entry cites…
2
votes
0 answers

Efficient way to compute the $L^1$ norm of quantum state

We all know that the $L^2$ norm $$ ||\psi||_2 = \sqrt{\sum_i |c_i|^2} $$ of a quantum state $|\psi\rangle = \sum_i c_i |i\rangle$ is always equal to $1$. It is possible to compute the $L^1$ norm $$ ||\psi||_1 = \sum_i |c_i| $$ by brute force by…
francler
  • 181
  • 1
  • 8
2
votes
0 answers

Given three quantum states, how to compute the triple product of amplitudes $\sum_i u_i v_i w_i$?

Assume I have three quantum states $|u\rangle$, $|v\rangle$ and $|w\rangle$ which can be obtained with three quantum circuits $U$, $V$ and $W$. We know that we can easily estimate the inner product $\langle u|v\rangle$ or with any of the three…
francler
  • 181
  • 1
  • 8
1
vote
0 answers

Issue with Implementing Hadamard Test and Trotterized Time Evolution in Qiskit

I'm following a Qiskit tutorial that appear in the following link: https://learning.quantum.ibm.com/tutorial/krylov-subspace-expansion, where a version of the Quantum Krylov subspace diagonalization is exposed. In order to compute the Krylov…
1
vote
1 answer

Was Deutsch contemplating a positive-operator valued measurement to distinguish balancedness from constancy?

This is a follow up to a couple of questions on Deutsch's foundational paper on quantum Turing machines. In it, he determines $f(0)\oplus f(1)$ with a single query by measuring a state prepared as $\frac{1}{\sqrt 2}|0,f(0)\rangle+\frac{1}{\sqrt…
Mark Spinelli
  • 15,378
  • 3
  • 26
  • 83
1
vote
0 answers

How to modify the Hadamard test for a non-unitary operator

Assuming I am doing statevector simulations, I need to compute an inner product of the type $$ X_b = \langle\psi | I_0^{\otimes (n-1)} \otimes X | \psi \rangle, $$ where $\psi$ is a generic input state (also $| \textbf{0} \rangle$) with real…
francler
  • 181
  • 1
  • 8
0
votes
1 answer

Realization of the gate $(I\pm U)/2$

The state after applying the Hadamard test (before measurement) is $$\newcommand{\ket}[1]{|#1\rangle}\newcommand{\bra}[1]{\langle#1|}\ket{0}\frac{I+U}{2}\ket{\psi} + \ket{1}\frac{I-U}{2}\ket{\psi}.$$ Therefore, the density matrix of $\ket{\psi'}$…
upe
  • 321
  • 2
  • 9
0
votes
1 answer

Removing ancilla qubit from circuit with Hadamard test controlled-Z gate

I want to remove the ancilla qubit from the following quantum circuit: Is this possible? The final state of $\newcommand{\ket}[1]{\vert#1\rangle}\newcommand{\bra}[1]{\langle#1\vert}\ket{\psi_1}$ is $\frac{1}{2}\left(\ket{\psi_1}\bra{\psi} +…
upe
  • 321
  • 2
  • 9
0
votes
0 answers

Compute the inner product with an operator given by the tensor product of two tensors

Assume I have a quantum register made of $N$ qubits. Assume I want to compute the inner product $$ \langle \psi|I_{n_y} \otimes A_{n_x}| \psi \rangle . $$ Note that I am using statevetor simulations for the moment. Here, the state $\psi$ has…
francler
  • 181
  • 1
  • 8
0
votes
2 answers

How to transform an Hamiltonian operator to a controlled gate (Hadamard test) in Pennylane?

I would like to perform an Hadamard test on a given Hamiltonian operator $\hat{H}$ acting on a 2-qubits system. For instance, suppose $\hat{H}$ can be decomposed into a qml.PauliX on the first wire and a qml.PauliZ on the second wire, and it could…
-1
votes
1 answer

Help in understanding the algebra of hadamard test

I am new to quantum computing and was looking through the jupyter notebook of Variational Quantum Linear Solver by Qiskit. I came across the hadamard test and was not understanding how it works. It is written there, Circuit: [Hadamard…
Vaishnav
  • 27
  • 4