# Measure an operator that is a product of many local operators?

**URL:** <https://itensor.discourse.group/t/measure-an-operator-that-is-a-product-of-many-local-operators/1718>\
**Category:** ITensor C++ Questions\
**Tags:** cpp, dmrg, mps, mpo, fermions\
**Created:** [May 16, 2024, 6:02am UTC](https://itensor.discourse.group/t/measure-an-operator-that-is-a-product-of-many-local-operators/1718 "2024-05-16T06:02:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sysy](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@sysy](https://itensor.discourse.group/u/sysy)\
**Post date:** [May 16, 2024, 6:02am UTC](https://itensor.discourse.group/t/measure-an-operator-that-is-a-product-of-many-local-operators/1718/1 "2024-05-16T06:02:22Z")

</div>

Dear itensor:

I want to measure the following operator:

\prod\_{m=1}^{N\_o}{\left( c\_{m,1}^{\dagger}c\_{m,2}+c\_{m,2}^{\dagger}c\_{m,1} \right)} 

the operator c^\dagger,c represents the spinless fermion creation or annihilation operator. The index ( m ) represents the index of the unit cell, with two lattice sites(1,2) within each unit cell. The entire operator is a product of a series of operators. Is there a method in ITensor to measure this operator?

thanks!

---

<div class="post-metadata">

**Author:** ![miles](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/miles/32/6_2.png) [@miles](https://itensor.discourse.group/u/miles)\
**Post date:** [May 16, 2024, 7:41am UTC](https://itensor.discourse.group/t/measure-an-operator-that-is-a-product-of-many-local-operators/1718/2 "2024-05-16T07:41:45Z")

</div>

I think the best strategy for measuring this operator would be the following:

1. form this operator as a two-site “gate” type of tensor (not that it is any type of quantum gate, but just that it has the structure of a general two-site operator tensor)
2. using the procedure [outlined here](http://itensor.org/docs.cgi?vers=cppv3&page=formulas/gate) apply it to a copy of the state you are measuring
3. take the overlap of that modified state with the original state

Let me know if that seems like a good plan to you.
