# Applying projective operator to MPS

+1 vote

In the iTensor documentation, a default projective operator is mentioned, with the example code

auto sites = SpinHalf(N);
//Projects site 3 onto state 2 (i.e. the down state)
auto P3_2 = op(sites,"Proj",3,{"State",2});


However, I'm confused as to what form this operator is in, and how it can be actually applied to a spin-half MPS. Treating P3_2 as an MPO and running applyMPO(P3_2, psi) gives an error, as are my attempts to package P3_2 into an AutoMPO object somehow. What does the intended usage of these operators look like?

selected by

Hi,

You would apply it by contracting it with an MPS that has the indices sites, i.e.:

psi(3) *= P3_2;
psi(3).noPrime();  // To make the site index unprimed again


It can help to print objects that you are unsure about, for example with:

PrintData(P3_2);


you can see that it is an ITensor with a pair of unprimed and primed indices.

-Matt