Obtain ALL the pauli combinations(correlators) for measuring them


I have an issue. I’d like to reconstruct density matrices obtained from the limited number of shots. I guess the only way is to calculate it back from the measurements obtained from the Pauli basis, say all the tensor combinations of local Pauli.
In one word: how can I insert them in a [ expval(o) for o in allCorrelators] approach? I don’t know how to handle the “@” syntax.

Many thanks

# Put code here

If you want help with diagnosing an error, please put the full error message below:

# Put full error message here

And, finally, make sure to include the versions of your packages. Specifically, show us the output of qml.about().

Hey @AdriQD!

I might not be understanding exactly what you want to accomplish, but I think the Pauli module is worth a look: qml.pauli — PennyLane 0.34.0 documentation

There are several functions for creating Pauli words and sentences :slight_smile:. Let me know if that helps!

Hi Isac,

I had a look and this might be of help, thank you!

1 Like

Let me know if you have any follow-up questions! :slight_smile: