2
$\begingroup$

Is there a way to do partial Measurement in AWS Braket? Basically, if I have a circuit with $N$ qubits, can I measure only $n$ qubits out of them with the result type "expectation"?

$\endgroup$

1 Answer 1

2
$\begingroup$

Physically, there is currently no way to perform a partial measurement (on hardware in particular, all qubits are measured); you'll have to slice out the unwanted qubits if you're using raw measurements directly. As for result types, you can definitely measure the expectation of an observable on only a subset of qubits:

from braket.circuits import Circuit, observables
from braket.devices import LocalSimulator

dev = LocalSimulator()
circ = Circuit().h(0).cnot(0, 1).cnot(1, 2).expectation(observables.Z() @ observables.Z(), [0, 2])
dev.run(circ).result().values
[1.0]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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