Running jobs
Result types
Attach Braket result types to ask QXel for more than measurement counts. The result comes back under result_types, alongside measurement_counts.
Sampled results (shots > 0)
With shots greater than zero, QXel samples the circuit. You get measurement_counts plus any sampled result type such as Expectation, Variance, or Probability.
python
from braket.circuits import Circuit, Observable
circuit = Circuit().h(0).cnot(0, 1)
circuit.expectation(Observable.Z(), target=0)
result = sim.run(circuit, shots=256)Analytic results (shots = 0)
Set shots=0 for exact, analytic result types. State vector, amplitude, and density matrix are analytic-only and require shots=0; there are no measurement_counts in this mode.
python
circuit = Circuit().h(0).cnot(0, 1)
circuit.probability()
circuit.state_vector()
circuit.amplitude(state=["00", "11"])
result = sim.run(circuit, shots=0)Which result types need which shots:
• Sample (measurement_counts): shots > 0
• Probability, Expectation, Variance: shots = 0 or shots > 0
• StateVector, Amplitude, DensityMatrix: shots = 0 only