How to exactly compute observable of 1 qubit in Braket TN1 and don't measure the rest?

2

I am aware that exact simulation (on the local simulator) to get the state vector can be done by setting shots=0. However, TN1 only allows shots range of [1, 1000]. I tried to reduce the computation cost of my QFT circuit by doing

qft = make_qft_circuit(10)
qft.expectation(observable=Observable.Z(), target=0)
result = device.run(qc, shots=100).result()

However, upon checking the result, I found that all the 10 qubits are being measured, with the counts stats, whereas I only need the expectation of the Pauli Z on the 0th qubit. Is there a way to prevent the wasteful computation of the remainder 9 qubits (since this is tensor network simulation after all)? Even better if it is possible to do an exact simulation along the line of shots=0 for the statevector.

rht
질문됨 일 년 전316회 조회
1개 답변
2
수락된 답변

For the first question, despite all the qubits are measured, we can extract the expectation value for a subset of qubits via result.values. Suppose we want to measure the expectation of the Pauli Z on the 0th qubit, then we can do the following [In the given example, qc is not defined, and I changed that]

qc = make_qft_circuit(10)
qc.expectation(observable=Observable.Z(), target=0)
result = device.run(qc, shots=100).result()
Z_0 = result.values[0] # This is the expectation value desired.

For the second question, no, TN1 does not support shots=0 result type.

AWS
Mao Lin
답변함 일 년 전
  • Thank you for the answer. Yes, I am aware that I can extract the expectation value, but I want to prevent the wasteful measurement of all of the qubits.

    For the second question, no, TN1 does not support shots=0 result type.

    Does that mean it is impossible to get exact computation from TN1?

  • No, we currently don't have a way to measure only a subset of qubits, or do shots=0. Because we have to sample the result at the end of the computation for TN1, yes, there will always be shot noise in the sampled result.

  • OK, thank you for the clarification!

  • @rht, we would love to hear more about your use case and understand better how measuring subsets of qubits or shots=0 would help you. Would you be open to share some details here or, if you prefer, via email at braket-feedback@amazon.com?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠