统一执行入口
- 主信息:submit 拿任务号,wait 拿统一结果——字段之间有确定的换算关系
- 代码卡片:
submit_task(circuit, backend="dummy:local:simulator", shots=1024) → wait_for_result(task_id)
- 输出卡片(摘录):
UnifiedResult(counts={'00': 512, '11': 512}, probabilities={'00': 0.5, '11': 0.5}, shots=1024, ...)
- 演算行:p̂(x) = n_x/N → p̂('00') = 512/1024 = 0.5,p̂('11') = 512/1024 = 0.5;Σₓ p̂(x) = 0.5+0.5 = 1 ✓
- 字段卡片:counts(二进制串键)/ probabilities = counts/shots / shots / platform / task_id;换真机 = 改 backend 字符串,代码与后处理一字不动(token 配置见第 11 课)
类型code-walkthrough + formula-card