1 Answer
- Newest
- Most votes
- Most comments
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.
answered a year ago
Relevant content
- Accepted Answerasked a month ago
- asked 7 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
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.
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?