How are projective measurements done in actual hardware?

I had a doubt regarding projective measurement specifically using qml.Projector. I am not able to understand how we can know the exact expectation value of |\langle\psi|\phi\rangle|^2 as we don’t have access to exact state vectors.

Hi @Ashish_Padhy !
Welcome to the forum.
Let me try to understand the question first. Do you mean how do projective measurements happen in real quantum devices? If that’s the question, it depends on the platform and the way you had encoded your qubit. I mean, maybe your qubit is in polarization, so the projective measurement will be a polarizer followed by a detector. You will repeat this many times and find the average value of the projector.
But regarding qml.Projector, do you have a particular example in mind? In what situation you don’t have access to state vectors? The example in the documentation

dev = qml.device("default.qubit", wires=2)
@qml.qnode(dev)
def circuit(state):
    return qml.expval(qml.Projector(state, wires=[0, 1]))
zero_state = [0, 0]
circuit(zero_state)
plusplus_state = np.array([1, 1, 1, 1]) / 2
circuit(plusplus_state)

shows that one does have knowledge about both state vectors. One being specified and the other one initialized by default in the program, the 00 state.

Let me know if this was helpful or you need further clarification.

@daniela.murcillo thanks for following up on this. What I meant was AFAIK any measurement done on a quantum state is through a gate which is Hermitian. However, I am not sure how a projective measurement is Hermitian.

For example: P_{00} = |00\rangle\langle00| is a projective matrix and is used for measurement as shown in the code example. However, it is not Hermitian.

i.e Expectation = \langle\psi|00\rangle\langle00|\psi\rangle

PS: I might be very wrong as I am pretty new to this, so would appreciate it if you could point me in correct direction.

Hi!
yes, all the observable quantities that you can measure from a quantum system are the eigenvalues of Hermitian operators.
Projectors are Hermitian as well. I am curious to know why you think they are not.
In the example you quote, for a two-qubit system, we can find the matrix representation for that projector P_{00} = |00\rangle\langle00| and it will be a 4x4 matrix with the (0,0) entry equal to 1. It corresponds to a Hermitian matrix.
The documentation for qml.Projector also mentions it by saying: Observable corresponding to the state projector.

Let me know your thoughts.

Aaah!! Somewhere down the lie I confused myself into thinking Hermitian is unitary as well. Thanks for pointing out my folly.

Also, I would highly appreciate it if you could guide me towards resources on these:

  • How actual measurements happen in quantum hardware (the physics underlying it)
  • Why we need to have hermitian observables?

Thanks again.

Sure thing.
For the hardware related questions, you can read a few demos by our team explaining different quantum computing platforms: trapped ions, superconductors, photonics, and neutral atoms.
The answer about why they have to be Hermitian operators is, long story short, because all we have access in the real world when we measure a physical quantity is Real numbers. Having Hermitian operators guarantees real eigenvalues to fit what we observe when we perform a measurement. However, I think you can find more complete answers in textbooks. For example, you can consult this one or this one.

I hope this is helpful!