Inner products of two states $\psi$ and $\phi$ are usually performed at the end of a quantum algorithm where we measure the final state, e.g. using the swap test. However, this operation is not unitary. We cannot "undo" the inner product to recover the $\psi$ and $\phi$ states -- for the swap test, we must prepare $\psi$ and $\phi$ multiple times independently to get a good probability estimate and hence the value of inner product.
Has anyone developed a "unitary" way to perform the inner product? If so, we can use it as an intermediate step in some quantum algorithm, as it would be a unitary and reversible operation.