Add gate matrix heatmaps, GHZ example, and ZH quantum golds.

Completes the Q4 matrix-draw follow-up and mirrors author/noise APIs in Chinese smokes.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-08-12 13:57:13 +08:00
1 parent 60d570756f
commit b842644686
13 files changed
+287 -14

No files matched your search

+6 -3
View File
@@ -1,6 +1,6 @@
---
title: Quantum circuits (ext/quantum)
description: Official quantum simulator — tables, gates, probs/Bloch SVG
description: Official quantum simulator — tables, gates, probs/Bloch/matrix SVG
> ext/quantum/quantum.mq.md
---
@@ -8,7 +8,7 @@ description: Official quantum simulator — tables, gates, probs/Bloch SVG
Optional package (not stdlib). Install: `marqdo ext add quantum` (or build `marqdo_plugin_quantum`).
Bell state: H then CX. Ideal |00⟩ / |11⟩ each ≈ 1/2. `draw kind=probs` embeds a probability bar chart in view.
GHZ (3 qubits): H on q0, then CX 0→1 and 0→2. Ideal |000⟩ / |111⟩ each ≈ 1/2. `draw kind=probs` embeds probability bars; `gate.draw kind=matrix` shows a heatmap.
`steps` =
@@ -16,10 +16,13 @@ Bell state: H then CX. Ideal |00⟩ / |11⟩ each ≈ 1/2. `draw kind=probs` emb
|------|------|--------|
| 1 | H | 0 |
| 2 | CX | 0,1 |
| 3 | CX | 0,2 |
*`qc` = > quantum.circuit qubits=2 steps=`steps` *
*`qc` = > quantum.circuit qubits=3 steps=`steps` *
*`p` = > `qc`.probabilities *
*`_` = > `qc`.draw kind=probs *
*`H` = > quantum.gate name=H *
*`__` = > `H`.draw kind=matrix *
> print text=`p`
> print text=quantum-feature-ok
+6 -3
View File
@@ -1,6 +1,6 @@
---
title: 量子电路(ext/quantum)
description: 官方量子模拟 — 表、门、概率/布洛赫 SVG
description: 官方量子模拟 — 表、门、概率/布洛赫/矩阵热图 SVG
> ext/quantum/量子.mq.md
---
@@ -8,7 +8,7 @@ description: 官方量子模拟 — 表、门、概率/布洛赫 SVG
可选扩展(非 stdlib)。安装:`marqdo ext add quantum`(或编译 `marqdo_plugin_quantum`)。
贝尔态:先哈达玛再控非。理想 |00⟩ / |11⟩ 各约 1/2。`绘图 种类=probs` 在 view 嵌入概率条。
GHZ(3 比特):q0 哈达玛,再控非 0→1、0→2。理想 |000⟩ / |111⟩ 各约 1/2。`绘图 种类=probs` 嵌入概率条;`门.绘图 种类=matrix` 为矩阵热图。
`步骤` =
@@ -16,10 +16,13 @@ description: 官方量子模拟 — 表、门、概率/布洛赫 SVG
|----|----|------|
| 1 | H | 0 |
| 2 | CX | 0,1 |
| 3 | CX | 0,2 |
*`qc` = > 量子.电路 比特数=2 步骤=`步骤` *
*`qc` = > 量子.电路 比特数=3 步骤=`步骤` *
*`p` = > `qc`.概率 *
*`_` = > `qc`.绘图 种类=probs *
*`H` = > 量子.门 名=H *
*`__` = > `H`.绘图 种类=matrix *
> 打印 内容=`p`
> 打印 内容=量子特性-ok