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:
1 parent
60d570756f
commit
b842644686
13 files changed
+287
-14
No files matched your search
@@ -0,0 +1,37 @@
|
||||
---
|
||||
title: quantum author API zh smoke
|
||||
description: 屏障 / 测量 / 追加 / 态 / 绘图.
|
||||
> ext/quantum/量子.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
*`qc` = > 量子.电路 比特数=2 *
|
||||
*`qc` = > `qc`.哈达玛 比特=0 *
|
||||
*`qc` = > `qc`.屏障 *
|
||||
*`qc` = > `qc`.控非 控制=0 目标=1 *
|
||||
*`qc` = > `qc`.测量 *
|
||||
|
||||
*`st` = > `qc`.态 *
|
||||
*`dim` = `st`[^dim] *
|
||||
1. `dim` == 4
|
||||
> print text=state-ok
|
||||
2. *
|
||||
> print text=state-fail
|
||||
|
||||
*`img` = > `qc`.绘图 路径=quantum-author-zh-draw.svg *
|
||||
*`kind` = `img`[^kind] *
|
||||
1. `kind` == circuit
|
||||
> print text=draw-ok
|
||||
2. *
|
||||
> print text=draw-fail
|
||||
|
||||
*`other` = > 量子.电路 比特数=2 *
|
||||
*`other` = > `other`.泡利X 比特=1 *
|
||||
*`qc2` = > `qc`.追加 操作=`other` *
|
||||
*`ops` = `qc2`[^ops] *
|
||||
*`n` = > len `ops` *
|
||||
1. `n` == 5
|
||||
> print text=append-ok
|
||||
2. *
|
||||
> print text=append-fail
|
||||
@@ -0,0 +1,16 @@
|
||||
---
|
||||
title: quantum gate matrix heatmap smoke
|
||||
description: gate.draw kind=matrix writes SVG heatmap.
|
||||
> ext/quantum/quantum.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
*`H` = > quantum.gate name=H *
|
||||
*`img` = > `H`.draw kind=matrix path=quantum-gate-heatmap.svg *
|
||||
*`kind` = `img`[^kind] *
|
||||
|
||||
1. `kind` == matrix
|
||||
> print text=heatmap-ok
|
||||
2. *
|
||||
> print text=heatmap-fail
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
title: quantum noise zh smoke
|
||||
description: 噪声 bitflip p=1 后 I 使全部射中 |1⟩.
|
||||
> ext/quantum/量子.mq.md
|
||||
---
|
||||
|
||||
# main
|
||||
|
||||
*`qc` = > 量子.电路 比特数=1 *
|
||||
*`qc` = > `qc`.单位 比特=0 *
|
||||
*`qc` = > `qc`.噪声 种类=bitflip 概率=1 *
|
||||
*`r` = > `qc`.运行 次数=32 种子=3 *
|
||||
*`c1` = `r`[^counts][^1] *
|
||||
|
||||
1. `c1` == 32
|
||||
> print text=noise-ok
|
||||
2. *
|
||||
> print text=noise-fail
|
||||
Reference in new issue
Block a user