- CHANGELOG.md:v2.8.0 条目(中英双语); - README.md:版本行 2.7.1→2.8.0 + 愿景第 6 条(知识可证明); - doc/releases/v2.8.0.md:双语发版说明(亮点/用法/已知限制); - skills/marqdo-dev/index.mq.md:新增 prove 任务(路径/目录模式/ require_lean/json;参数用 + 行声明升参,check 与 narrative-ratio 通过); - 设计文档 §12.5 标记已合入;发版链接统一指向 doc/releases/v2.8.0.md。
51 lines
1.0 KiB
Markdown
Executable File
51 lines
1.0 KiB
Markdown
Executable File
---
|
|
markup: occlusion
|
|
title: quantum linalg smoke
|
|
description: Q7a density / partial_trace / expect / schmidt / purity
|
|
import:
|
|
quantum: ext/quantum/circuit/index.mq.md
|
|
math: lib/math.mq.md
|
|
---
|
|
|
|
# main
|
|
|
|
**qc = > quantum.circuit qubits=2**
|
|
**qc = > `qc`.h qubit=0**
|
|
**qc = > `qc`.cx control=0 target=1**
|
|
|
|
**rho = > `qc`.density**
|
|
**pur = > `rho`.purity**
|
|
**lo = > math.div a=9 b=10**
|
|
1. `pur` > `lo`
|
|
> print text=purity-ok
|
|
2. *
|
|
> print text=purity-fail
|
|
|
|
**red = > `rho`.partial_trace keep=0**
|
|
**rpur = > `red`.purity**
|
|
**half_lo = > math.div a=4 b=10**
|
|
**half_hi = > math.div a=6 b=10**
|
|
1. `rpur` > `half_lo`
|
|
1. `rpur` < `half_hi`
|
|
> print text=reduce-ok
|
|
2. *
|
|
> print text=reduce-fail
|
|
2. *
|
|
> print text=reduce-fail
|
|
|
|
**zz = "ZZ"**
|
|
**ezz = > `qc`.expect obs=`zz`**
|
|
**zzi = > math.div a=9 b=10**
|
|
1. `ezz` > `zzi`
|
|
> print text=expect-ok
|
|
2. *
|
|
> print text=expect-fail
|
|
|
|
**sch = > `qc`.schmidt cut=1**
|
|
**ent = [entropy](access(sch, "entropy"))**
|
|
**elo = > math.div a=1 b=2**
|
|
1. `ent` > `elo`
|
|
> print text=schmidt-ok
|
|
2. *
|
|
> print text=schmidt-fail
|