# How to perform a phase operator on register that contains two or more qubits？

My problem is easy to understand, just how to calculate the matrix of phase operator(or phase gate) acts on multi-qubits so that i can perfrom it in quantum circuit on IBM Quantum Experience

just like the controlled-U gate in phase estimation:

for example:

$$U(y)|φ\rangle=\exp(2πiy)|φ\rangle$$

where $$|φ\rangle$$ is a two- or three-qubit register.

• Welcome to QCSE! The way it's currently defined, $U$ is identity up to global phase, so controlled-$U$ is just a single-qubit $Z$ rotation on the control qubit. Is this really the operation you have in mind? – Adam Zalcman Feb 14 at 17:44
• @Adam Zalcman thanks a lot for viewing this The operation U in my mind is the one defined in Phase Estimation,I know that normal U gate can change the phase of a single-qubit, and I want to find a way to define 'U' gate that can change the phase of a quantum state contains multi-qubit,such as |000>,|010> and so on. Simply apply U gate on each single-qubit doesn't work cause the phase on single-qubit will also join the tensor product process. I think it's possible to find the matrix of such operator use linear algebra knowledge but so far I haven't find a way – leafkoi Feb 15 at 2:24
• I'm still not clear what it is you're asking for. Are you wanting to know how to implement controlled-$e^{i\theta}U$ instead of controlled-$U$? – DaftWullie Mar 12 at 8:48
• You can check the answer given by Dhruv B, it's may be easier to understand. Several days ago I'm trying to verify a quantum program's correctness in Qiskit, and one step of it needs a gate to change the phase of quantum register which contains two qubits at least, that's the birth of this question . I review some books about linear algebra knowledge and found the solution, just treat exp(2πiy) as eigenvalue and |φ⟩ as its corresponding eigenvector,then the matrix is easy to get.@DaftWullie – leafkoi Mar 13 at 9:33

I believe your question is about the phase estimation algorithm. The controlled U-gate in the case of phase estimation algorithm is formed from some unitary operator U. The phase estimation algorithm assumes that you know the unitary U beforehand, and you want to estimate the phase of a particular eigenvalue of U. Also, in this algorithm, you supply an eigenvector of U in |$$\psi$$>, and you select this eigenvector of U in a way that it corresponds to the eigenvalue of U whose phase you desire to estimate. So, in general, U in your equation results in a pure phase operation only when |$$\psi$$> is an eigenvector of U. So, in general, U|$$\psi$$> = $$e^{2 \pi i y}$$|$$\psi$$> is ot true for every |$$\psi$$>.