2
$\begingroup$

If I use the matrix product state method in Qiskit to simulate quantum circuits, I can obtain the exepctation value of an observable by using a finite amount of shots. Is there a way to obtain the exact expectation value wihout using the state vector?

If it is useful, I'm interested in $\langle \psi | Z_1 | \psi \rangle$, i.e. the expectation value of the Pauli Z matrix of the first qubit.

EDIT: I asked this question also in this thread, but it was an EDIT of the original question, so I thought it was better to create another thread.

$\endgroup$

1 Answer 1

0
$\begingroup$

By default, the matrix product state method in Qiskit does not compute the state vector when computing the expectation value for a Pauli matrix. For a general matrix, it does compute the density matrix first. For this purpose, should should define your observable as a pauli string, for example (if you are using qiskit runtime):

from qiskit.quantum_info import SparsePauliOp
observable = SparsePauliOp("XZ")
$\endgroup$
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.