# Can we design a circuit that outputs desired estimates?

If we have state $$\lvert\psi\rangle \in (\mathbb{C}^{2})^{\otimes n}$$ in an $$\textit{n}$$-qubit system with Pauli operators $$P$$ such that $$P \in \{I, X, Y, Z\}^{n}$$, how can we design a circuit/procedure using multiple circuits and/or classical processing that would output a real output $$\alpha$$ which is on average equal to $$Tr((P_{1} \otimes ... \otimes P_{n})\lvert \psi \rangle \langle \psi \rvert)$$

Maybe as a start, say our possible outcomes are $$x \in \{0, 1\}^{n}$$, so that when we measure an individual qubit $$j$$ of $$\lvert \psi \rangle$$ with projections $$\{P_{j, 0}, P_{j, 1}\}$$ we get an outcome $$x_{i} \in \{0/1\}$$. Can we obtain outcomes $$x_{1},...,x_{n}$$ simultaneously and what is the probability of obtaining those outcomes simultaneously? If I'm understanding observables correctly, the observable for this system would be $$O = \sum\limits_{i \in \{I, X, Y, Z\}^{n}} \sum\limits_{j \in \{0, 1\}} x_{j} P_{i, j}$$ although I'm not 100% sure if that's relevant to the problem.

To get the expectation that you want, you don't need to measure the individual observables. Instead, it would be sufficient to use $$O=P_1\otimes P_2\otimes\ldots\otimes P_n.$$ You can measure this (which has a single $$\pm 1$$ outcome) by introducing a single ancilla and applying the circuit where (because I'm lazy and used an image I already had), I've used $$\sigma_i$$ in place of $$P_i$$.
If $$p_0$$ and $$p_1$$ are the probabilities of getting 0 and 1 outcomes, then $$\langle\psi|O|\psi\rangle=p_0-p_1=2p_0-1.$$