feat(markup): finish v0.3 stock migration and green gold
Migrate remaining .mq.md (tests/ext/public/examples), stop elevating local assigns to params, inject form_target in Go libweb, and skip live LLM gold without a real key. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
bfb10d172b
commit
b5c07385e9
324 files changed
+4572
-4339
No files matched your search
+43
-43
@@ -10,7 +10,7 @@ import json:lib/json.mq.md
|
||||
|
||||
Load the ABI v2 `quantum` plugin once.
|
||||
|
||||
*p = > plugin.native_path name="quantum"*
|
||||
**p = > plugin.native_path name="quantum"**
|
||||
1. `p`
|
||||
> plugin.load path=`p`
|
||||
2. *
|
||||
@@ -25,7 +25,7 @@ Load the ABI v2 `quantum` plugin once.
|
||||
Tensor product of two states or square matrices.
|
||||
|
||||
> ensure_plugin
|
||||
**> quantum_kron a=`a` b=`b`**
|
||||
*> quantum_kron a=`a` b=`b`*
|
||||
|
||||
## schmidt
|
||||
+ `state`
|
||||
@@ -34,7 +34,7 @@ Tensor product of two states or square matrices.
|
||||
Schmidt decomposition of a pure state / circuit across `cut` (subsystem A = low qubits).
|
||||
|
||||
> ensure_plugin
|
||||
**> quantum_schmidt state=`state` cut=`cut`**
|
||||
*> quantum_schmidt state=`state` cut=`cut`*
|
||||
|
||||
## fidelity
|
||||
+ `a`
|
||||
@@ -43,7 +43,7 @@ Schmidt decomposition of a pure state / circuit across `cut` (subsystem A = low
|
||||
Pure-state fidelity |⟨a|b⟩|².
|
||||
|
||||
> ensure_plugin
|
||||
**> quantum_fidelity a=`a` b=`b`**
|
||||
*> quantum_fidelity a=`a` b=`b`*
|
||||
|
||||
# circuit
|
||||
+ `qubits`=1
|
||||
@@ -52,98 +52,98 @@ Pure-state fidelity |⟨a|b⟩|².
|
||||
State-vector circuit (default |0…0⟩). Optional `steps=` gate table (column or row records). Methods append gates and return an updated handle.
|
||||
|
||||
> ensure_plugin
|
||||
**> quantum_circuit_new qubits=`qubits` steps=`steps`**
|
||||
*> quantum_circuit_new qubits=`qubits` steps=`steps`*
|
||||
|
||||
## h
|
||||
+ `qubit`=0
|
||||
|
||||
**> quantum_h circuit=`self` qubit=`qubit`**
|
||||
*> quantum_h circuit=`self` qubit=`qubit`*
|
||||
|
||||
## x
|
||||
+ `qubit`=0
|
||||
|
||||
**> quantum_x circuit=`self` qubit=`qubit`**
|
||||
*> quantum_x circuit=`self` qubit=`qubit`*
|
||||
|
||||
## y
|
||||
+ `qubit`=0
|
||||
|
||||
**> quantum_y circuit=`self` qubit=`qubit`**
|
||||
*> quantum_y circuit=`self` qubit=`qubit`*
|
||||
|
||||
## z
|
||||
+ `qubit`=0
|
||||
|
||||
**> quantum_z circuit=`self` qubit=`qubit`**
|
||||
*> quantum_z circuit=`self` qubit=`qubit`*
|
||||
|
||||
## s
|
||||
+ `qubit`=0
|
||||
|
||||
**> quantum_s circuit=`self` qubit=`qubit`**
|
||||
*> quantum_s circuit=`self` qubit=`qubit`*
|
||||
|
||||
## t
|
||||
+ `qubit`=0
|
||||
|
||||
**> quantum_t circuit=`self` qubit=`qubit`**
|
||||
*> quantum_t circuit=`self` qubit=`qubit`*
|
||||
|
||||
## i
|
||||
+ `qubit`=0
|
||||
|
||||
**> quantum_i circuit=`self` qubit=`qubit`**
|
||||
*> quantum_i circuit=`self` qubit=`qubit`*
|
||||
|
||||
## rx
|
||||
+ `qubit`=0
|
||||
+ `theta`
|
||||
|
||||
**> quantum_rx circuit=`self` qubit=`qubit` theta=`theta`**
|
||||
*> quantum_rx circuit=`self` qubit=`qubit` theta=`theta`*
|
||||
|
||||
## ry
|
||||
+ `qubit`=0
|
||||
+ `theta`
|
||||
|
||||
**> quantum_ry circuit=`self` qubit=`qubit` theta=`theta`**
|
||||
*> quantum_ry circuit=`self` qubit=`qubit` theta=`theta`*
|
||||
|
||||
## rz
|
||||
+ `qubit`=0
|
||||
+ `theta`
|
||||
|
||||
**> quantum_rz circuit=`self` qubit=`qubit` theta=`theta`**
|
||||
*> quantum_rz circuit=`self` qubit=`qubit` theta=`theta`*
|
||||
|
||||
## cx
|
||||
+ `control`=0
|
||||
+ `target`=1
|
||||
|
||||
**> quantum_cx circuit=`self` control=`control` target=`target`**
|
||||
*> quantum_cx circuit=`self` control=`control` target=`target`*
|
||||
|
||||
## cz
|
||||
+ `control`=0
|
||||
+ `target`=1
|
||||
|
||||
**> quantum_cz circuit=`self` control=`control` target=`target`**
|
||||
*> quantum_cz circuit=`self` control=`control` target=`target`*
|
||||
|
||||
## swap
|
||||
+ `a`=0
|
||||
+ `b`=1
|
||||
|
||||
**> quantum_swap circuit=`self` a=`a` b=`b`**
|
||||
*> quantum_swap circuit=`self` a=`a` b=`b`*
|
||||
|
||||
## barrier
|
||||
|
||||
Visual separator only (no state change).
|
||||
|
||||
**> quantum_barrier circuit=`self`**
|
||||
*> quantum_barrier circuit=`self`*
|
||||
|
||||
## measure
|
||||
+ `qubits`=None
|
||||
|
||||
Mark computational-basis readout (`None` / empty = all qubits). Affects which bits `run` reports.
|
||||
|
||||
**> quantum_measure circuit=`self` qubits=`qubits`**
|
||||
*> quantum_measure circuit=`self` qubits=`qubits`*
|
||||
|
||||
## append
|
||||
+ `op`
|
||||
|
||||
Append another circuit's ops or a `{gate,qubits}` op map.
|
||||
|
||||
**> quantum_append circuit=`self` op=`op`**
|
||||
*> quantum_append circuit=`self` op=`op`*
|
||||
|
||||
## apply
|
||||
+ `gate`
|
||||
@@ -151,7 +151,7 @@ Append another circuit's ops or a `{gate,qubits}` op map.
|
||||
|
||||
Apply a gate handle (named or custom `matrix=`) on `qubits` (int or list).
|
||||
|
||||
**> quantum_apply circuit=`self` gate=`gate` qubits=`qubits`**
|
||||
*> quantum_apply circuit=`self` gate=`gate` qubits=`qubits`*
|
||||
|
||||
## noise
|
||||
+ `kind`
|
||||
@@ -159,25 +159,25 @@ Apply a gate handle (named or custom `matrix=`) on `qubits` (int or list).
|
||||
|
||||
Teaching noise for `run` trajectories (`bitflip` / `depolarizing` / `amplitude_damping`). Ignored by `simulate` / `probabilities`.
|
||||
|
||||
**> quantum_noise circuit=`self` kind=`kind` p=`p`**
|
||||
*> quantum_noise circuit=`self` kind=`kind` p=`p`*
|
||||
|
||||
## simulate
|
||||
|
||||
Return state vector amplitudes `{re,im}` (ideal; no noise).
|
||||
|
||||
**> quantum_simulate circuit=`self`**
|
||||
*> quantum_simulate circuit=`self`*
|
||||
|
||||
## state
|
||||
|
||||
Ideal state vector (same amplitudes as `simulate`).
|
||||
|
||||
**> quantum_state circuit=`self`**
|
||||
*> quantum_state circuit=`self`*
|
||||
|
||||
## probabilities
|
||||
|
||||
Return map of basis label → probability (qubit 0 = rightmost bit). Ideal; ignores noise.
|
||||
|
||||
**> quantum_probabilities circuit=`self`**
|
||||
*> quantum_probabilities circuit=`self`*
|
||||
|
||||
## run
|
||||
+ `shots`=1024
|
||||
@@ -185,7 +185,7 @@ Return map of basis label → probability (qubit 0 = rightmost bit). Ideal; igno
|
||||
|
||||
Sample computational-basis shots (deterministic with `seed=`). Applies circuit `noise` if set.
|
||||
|
||||
**> quantum_run circuit=`self` shots=`shots` seed=`seed`**
|
||||
*> quantum_run circuit=`self` shots=`shots` seed=`seed`*
|
||||
|
||||
## draw
|
||||
+ `path`=None
|
||||
@@ -195,27 +195,27 @@ Sample computational-basis shots (deterministic with `seed=`). Applies circuit `
|
||||
|
||||
Circuit rail / probability bars / Bloch / advanced state plots (`kind=circuit|probs|bloch|hinton|city|density|paulivec|qsphere|multibloch`). Theme `dark` (default tech lab) / `light` / `bw`. Records into view/CLI plots via host `record_plot`.
|
||||
|
||||
**> quantum_draw_circuit circuit=`self` path=`path` kind=`kind` qubit=`qubit` theme=`theme`**
|
||||
*> quantum_draw_circuit circuit=`self` path=`path` kind=`kind` qubit=`qubit` theme=`theme`*
|
||||
|
||||
## density
|
||||
|
||||
Pure-state density matrix ρ=|ψ⟩⟨ψ| after ideal simulate.
|
||||
|
||||
**> density state=`self`**
|
||||
*> density state=`self`*
|
||||
|
||||
## expect
|
||||
+ `obs`
|
||||
|
||||
Pauli string (left = high bit) or matrix expectation on the ideal state.
|
||||
|
||||
**> quantum_density_expect density=`self` obs=`obs`**
|
||||
*> quantum_density_expect density=`self` obs=`obs`*
|
||||
|
||||
## schmidt
|
||||
+ `cut`=1
|
||||
|
||||
Schmidt / singular values across a bipartition (`cut` = qubits in subsystem A, low bits).
|
||||
|
||||
**> quantum_schmidt state=`self` cut=`cut`**
|
||||
*> quantum_schmidt state=`self` cut=`cut`*
|
||||
|
||||
# gate
|
||||
+ `name`=None
|
||||
@@ -225,17 +225,17 @@ Schmidt / singular values across a bipartition (`cut` = qubits in subsystem A, l
|
||||
Named built-in gate (`name=H`) or custom unitary from `matrix=` (nested list or formula matrix fence). Optional `name=` label for custom gates (default `U`).
|
||||
|
||||
> ensure_plugin
|
||||
**> quantum_gate_new name=`name` theta=`theta` matrix=`matrix`**
|
||||
*> quantum_gate_new name=`name` theta=`theta` matrix=`matrix`*
|
||||
|
||||
## matrix
|
||||
|
||||
**> quantum_gate_matrix gate=`self`**
|
||||
*> quantum_gate_matrix gate=`self`*
|
||||
|
||||
## matches_matrix
|
||||
+ `matrix`
|
||||
+ `tol`=0.000000001
|
||||
|
||||
**> quantum_gate_matches_matrix gate=`self` matrix=`matrix` tol=`tol`**
|
||||
*> quantum_gate_matches_matrix gate=`self` matrix=`matrix` tol=`tol`*
|
||||
|
||||
## draw
|
||||
+ `path`=None
|
||||
@@ -243,7 +243,7 @@ Named built-in gate (`name=H`) or custom unitary from `matrix=` (nested list or
|
||||
|
||||
Gate glyph or complex-matrix heatmap (`kind=gate|matrix`). Records via host `record_plot`.
|
||||
|
||||
**> quantum_gate_draw gate=`self` path=`path` kind=`kind`**
|
||||
*> quantum_gate_draw gate=`self` path=`path` kind=`kind`*
|
||||
|
||||
# density
|
||||
+ `state`=None
|
||||
@@ -253,37 +253,37 @@ Density matrix from a state/circuit (`state=`) or an explicit Hermitian `matrix=
|
||||
|
||||
> ensure_plugin
|
||||
1. `matrix`
|
||||
**> quantum_density_from_matrix matrix=`matrix`**
|
||||
*> quantum_density_from_matrix matrix=`matrix`*
|
||||
2. *
|
||||
**> quantum_density_from_state state=`state`**
|
||||
*> quantum_density_from_state state=`state`*
|
||||
|
||||
## matrix
|
||||
|
||||
**> quantum_density_matrix density=`self`**
|
||||
*> quantum_density_matrix density=`self`*
|
||||
|
||||
## purity
|
||||
|
||||
Tr(ρ²).
|
||||
|
||||
**> quantum_density_purity density=`self`**
|
||||
*> quantum_density_purity density=`self`*
|
||||
|
||||
## partial_trace
|
||||
+ `keep`
|
||||
|
||||
Keep listed qubits (LSB=0); trace out the rest.
|
||||
|
||||
**> quantum_density_partial_trace density=`self` keep=`keep`**
|
||||
*> quantum_density_partial_trace density=`self` keep=`keep`*
|
||||
|
||||
## eig
|
||||
|
||||
Hermitian spectrum → `{eigenvalues, eigenvectors}`.
|
||||
|
||||
**> quantum_density_eig density=`self`**
|
||||
*> quantum_density_eig density=`self`*
|
||||
|
||||
## expect
|
||||
+ `obs`
|
||||
|
||||
**> quantum_density_expect density=`self` obs=`obs`**
|
||||
*> quantum_density_expect density=`self` obs=`obs`*
|
||||
|
||||
## draw
|
||||
+ `path`=None
|
||||
@@ -291,4 +291,4 @@ Hermitian spectrum → `{eigenvalues, eigenvectors}`.
|
||||
|
||||
Hinton / city / density-cells / Pauli vector SVG (`kind=hinton` or city or density or paulivec).
|
||||
|
||||
**> quantum_density_draw density=`self` path=`path` kind=`kind`**
|
||||
*> quantum_density_draw density=`self` path=`path` kind=`kind`*
|
||||
+43
-43
@@ -10,7 +10,7 @@ import json:lib/json.mq.md
|
||||
|
||||
加载 ABI v2 `quantum` 插件。
|
||||
|
||||
*p = > plugin.native_path name="quantum"*
|
||||
**p = > plugin.native_path name="quantum"**
|
||||
1. `p`
|
||||
> plugin.load path=`p`
|
||||
2. *
|
||||
@@ -25,14 +25,14 @@ import json:lib/json.mq.md
|
||||
两态或方阵的张量积。
|
||||
|
||||
> 确保插件
|
||||
**> quantum_kron a=`左` b=`右`**
|
||||
*> quantum_kron a=`左` b=`右`*
|
||||
|
||||
## 施密特分解
|
||||
+ `态`
|
||||
+ `分割`=1
|
||||
|
||||
> 确保插件
|
||||
**> quantum_schmidt state=`态` cut=`分割`**
|
||||
*> quantum_schmidt state=`态` cut=`分割`*
|
||||
|
||||
## 保真度
|
||||
+ `左`
|
||||
@@ -41,7 +41,7 @@ import json:lib/json.mq.md
|
||||
纯态保真度 |⟨a|b⟩|²。
|
||||
|
||||
> 确保插件
|
||||
**> quantum_fidelity a=`左` b=`右`**
|
||||
*> quantum_fidelity a=`左` b=`右`*
|
||||
|
||||
# 电路
|
||||
+ `比特数`=1
|
||||
@@ -50,98 +50,98 @@ import json:lib/json.mq.md
|
||||
状态向量电路(默认 |0…0⟩)。可选 `步骤=` 门序列表。方法追加门并返回更新后的句柄。
|
||||
|
||||
> 确保插件
|
||||
**> quantum_circuit_new qubits=`比特数` steps=`步骤`**
|
||||
*> quantum_circuit_new qubits=`比特数` steps=`步骤`*
|
||||
|
||||
## 哈达玛
|
||||
+ `比特`=0
|
||||
|
||||
**> quantum_h circuit=`self` qubit=`比特`**
|
||||
*> quantum_h circuit=`self` qubit=`比特`*
|
||||
|
||||
## 泡利X
|
||||
+ `比特`=0
|
||||
|
||||
**> quantum_x circuit=`self` qubit=`比特`**
|
||||
*> quantum_x circuit=`self` qubit=`比特`*
|
||||
|
||||
## 泡利Y
|
||||
+ `比特`=0
|
||||
|
||||
**> quantum_y circuit=`self` qubit=`比特`**
|
||||
*> quantum_y circuit=`self` qubit=`比特`*
|
||||
|
||||
## 泡利Z
|
||||
+ `比特`=0
|
||||
|
||||
**> quantum_z circuit=`self` qubit=`比特`**
|
||||
*> quantum_z circuit=`self` qubit=`比特`*
|
||||
|
||||
## 相位S
|
||||
+ `比特`=0
|
||||
|
||||
**> quantum_s circuit=`self` qubit=`比特`**
|
||||
*> quantum_s circuit=`self` qubit=`比特`*
|
||||
|
||||
## 相位T
|
||||
+ `比特`=0
|
||||
|
||||
**> quantum_t circuit=`self` qubit=`比特`**
|
||||
*> quantum_t circuit=`self` qubit=`比特`*
|
||||
|
||||
## 单位
|
||||
+ `比特`=0
|
||||
|
||||
**> quantum_i circuit=`self` qubit=`比特`**
|
||||
*> quantum_i circuit=`self` qubit=`比特`*
|
||||
|
||||
## 绕X
|
||||
+ `比特`=0
|
||||
+ `参数`
|
||||
|
||||
**> quantum_rx circuit=`self` qubit=`比特` theta=`参数`**
|
||||
*> quantum_rx circuit=`self` qubit=`比特` theta=`参数`*
|
||||
|
||||
## 绕Y
|
||||
+ `比特`=0
|
||||
+ `参数`
|
||||
|
||||
**> quantum_ry circuit=`self` qubit=`比特` theta=`参数`**
|
||||
*> quantum_ry circuit=`self` qubit=`比特` theta=`参数`*
|
||||
|
||||
## 绕Z
|
||||
+ `比特`=0
|
||||
+ `参数`
|
||||
|
||||
**> quantum_rz circuit=`self` qubit=`比特` theta=`参数`**
|
||||
*> quantum_rz circuit=`self` qubit=`比特` theta=`参数`*
|
||||
|
||||
## 控非
|
||||
+ `控制`=0
|
||||
+ `目标`=1
|
||||
|
||||
**> quantum_cx circuit=`self` control=`控制` target=`目标`**
|
||||
*> quantum_cx circuit=`self` control=`控制` target=`目标`*
|
||||
|
||||
## 控相
|
||||
+ `控制`=0
|
||||
+ `目标`=1
|
||||
|
||||
**> quantum_cz circuit=`self` control=`控制` target=`目标`**
|
||||
*> quantum_cz circuit=`self` control=`控制` target=`目标`*
|
||||
|
||||
## 交换
|
||||
+ `比特甲`=0
|
||||
+ `比特乙`=1
|
||||
|
||||
**> quantum_swap circuit=`self` a=`比特甲` b=`比特乙`**
|
||||
*> quantum_swap circuit=`self` a=`比特甲` b=`比特乙`*
|
||||
|
||||
## 屏障
|
||||
|
||||
仅可视化分隔(不改态)。
|
||||
|
||||
**> quantum_barrier circuit=`self`**
|
||||
*> quantum_barrier circuit=`self`*
|
||||
|
||||
## 测量
|
||||
+ `比特`=None
|
||||
|
||||
标记计算基读出(空 = 全部比特)。影响 `运行` 报告哪些位。
|
||||
|
||||
**> quantum_measure circuit=`self` qubits=`比特`**
|
||||
*> quantum_measure circuit=`self` qubits=`比特`*
|
||||
|
||||
## 追加
|
||||
+ `操作`
|
||||
|
||||
追加另一电路的 ops,或 `{gate,qubits}` 操作表。
|
||||
|
||||
**> quantum_append circuit=`self` op=`操作`**
|
||||
*> quantum_append circuit=`self` op=`操作`*
|
||||
|
||||
## 施加
|
||||
+ `门`
|
||||
@@ -149,7 +149,7 @@ import json:lib/json.mq.md
|
||||
|
||||
将门句柄(具名或 `矩阵=` 自定义)施加到 `比特`(整数或列表)。
|
||||
|
||||
**> quantum_apply circuit=`self` gate=`门` qubits=`比特`**
|
||||
*> quantum_apply circuit=`self` gate=`门` qubits=`比特`*
|
||||
|
||||
## 噪声
|
||||
+ `种类`
|
||||
@@ -157,25 +157,25 @@ import json:lib/json.mq.md
|
||||
|
||||
教学噪声,供 `运行` 轨迹使用(`bitflip` / `depolarizing` / `amplitude_damping`,或中文:比特翻转 / 退极化 / 振幅阻尼)。`模拟` / `概率` 忽略。
|
||||
|
||||
**> quantum_noise circuit=`self` kind=`种类` p=`概率`**
|
||||
*> quantum_noise circuit=`self` kind=`种类` p=`概率`*
|
||||
|
||||
## 模拟
|
||||
|
||||
返回态矢量振幅 `{re,im}`(理想;无噪声)。
|
||||
|
||||
**> quantum_simulate circuit=`self`**
|
||||
*> quantum_simulate circuit=`self`*
|
||||
|
||||
## 态
|
||||
|
||||
理想态矢量(与 `模拟` 相同振幅)。
|
||||
|
||||
**> quantum_state circuit=`self`**
|
||||
*> quantum_state circuit=`self`*
|
||||
|
||||
## 概率
|
||||
|
||||
基矢标签 → 概率(qubit 0 为最右侧比特)。理想;忽略噪声。
|
||||
|
||||
**> quantum_probabilities circuit=`self`**
|
||||
*> quantum_probabilities circuit=`self`*
|
||||
|
||||
## 运行
|
||||
+ `次数`=1024
|
||||
@@ -183,7 +183,7 @@ import json:lib/json.mq.md
|
||||
|
||||
计算基采样(`种子=` 可复现)。若设置了电路噪声则启用。
|
||||
|
||||
**> quantum_run circuit=`self` shots=`次数` seed=`种子`**
|
||||
*> quantum_run circuit=`self` shots=`次数` seed=`种子`*
|
||||
|
||||
## 绘图
|
||||
+ `路径`=None
|
||||
@@ -193,27 +193,27 @@ import json:lib/json.mq.md
|
||||
|
||||
电路轨线 / 概率条 / 布洛赫 / 高级态图(种类 circuit、probs、bloch、hinton、city、density、paulivec、qsphere、multibloch)。主题 dark(默认科技感)/ light / bw。经 record_plot 进入 view/CLI plots。
|
||||
|
||||
**> quantum_draw_circuit circuit=`self` path=`路径` kind=`种类` qubit=`比特` theme=`主题`**
|
||||
*> quantum_draw_circuit circuit=`self` path=`路径` kind=`种类` qubit=`比特` theme=`主题`*
|
||||
|
||||
## 密度
|
||||
|
||||
理想模拟后的纯态密度矩阵 ρ=|ψ⟩⟨ψ|。
|
||||
|
||||
**> 密度 态=`self`**
|
||||
*> 密度 态=`self`*
|
||||
|
||||
## 期望
|
||||
+ `可观测量`
|
||||
|
||||
Pauli 串(左端=高比特)或矩阵期望值。
|
||||
|
||||
**> quantum_density_expect density=`self` obs=`可观测量`**
|
||||
*> quantum_density_expect density=`self` obs=`可观测量`*
|
||||
|
||||
## 施密特
|
||||
+ `分割`=1
|
||||
|
||||
二分施密特分解(`分割`=子系统 A 的比特数,低位)。
|
||||
|
||||
**> quantum_schmidt state=`self` cut=`分割`**
|
||||
*> quantum_schmidt state=`self` cut=`分割`*
|
||||
|
||||
# 门
|
||||
+ `名`=None
|
||||
@@ -223,17 +223,17 @@ Pauli 串(左端=高比特)或矩阵期望值。
|
||||
具名内置门(`名=H`)或由 `矩阵=`(嵌套 list 或公式矩阵围栏)定义的自定义酉门。自定义门可选 `名=`(默认 `U`)。
|
||||
|
||||
> 确保插件
|
||||
**> quantum_gate_new name=`名` theta=`参数` matrix=`矩阵`**
|
||||
*> quantum_gate_new name=`名` theta=`参数` matrix=`矩阵`*
|
||||
|
||||
## 矩阵
|
||||
|
||||
**> quantum_gate_matrix gate=`self`**
|
||||
*> quantum_gate_matrix gate=`self`*
|
||||
|
||||
## 匹配矩阵
|
||||
+ `矩阵`
|
||||
+ `容差`=0.000000001
|
||||
|
||||
**> quantum_gate_matches_matrix gate=`self` matrix=`矩阵` tol=`容差`**
|
||||
*> quantum_gate_matches_matrix gate=`self` matrix=`矩阵` tol=`容差`*
|
||||
|
||||
## 绘图
|
||||
+ `路径`=None
|
||||
@@ -241,7 +241,7 @@ Pauli 串(左端=高比特)或矩阵期望值。
|
||||
|
||||
门符号或复矩阵热力图(`种类=gate|matrix`)。经 `record_plot` 记录。
|
||||
|
||||
**> quantum_gate_draw gate=`self` path=`路径` kind=`种类`**
|
||||
*> quantum_gate_draw gate=`self` path=`路径` kind=`种类`*
|
||||
|
||||
# 密度
|
||||
+ `态`=None
|
||||
@@ -251,37 +251,37 @@ Pauli 串(左端=高比特)或矩阵期望值。
|
||||
|
||||
> 确保插件
|
||||
1. `矩阵`
|
||||
**> quantum_density_from_matrix matrix=`矩阵`**
|
||||
*> quantum_density_from_matrix matrix=`矩阵`*
|
||||
2. *
|
||||
**> quantum_density_from_state state=`态`**
|
||||
*> quantum_density_from_state state=`态`*
|
||||
|
||||
## 矩阵
|
||||
|
||||
**> quantum_density_matrix density=`self`**
|
||||
*> quantum_density_matrix density=`self`*
|
||||
|
||||
## 纯度
|
||||
|
||||
Tr(ρ²)。
|
||||
|
||||
**> quantum_density_purity density=`self`**
|
||||
*> quantum_density_purity density=`self`*
|
||||
|
||||
## 部分迹
|
||||
+ `保留`
|
||||
|
||||
保留所列比特(LSB=0),对其余求迹。
|
||||
|
||||
**> quantum_density_partial_trace density=`self` keep=`保留`**
|
||||
*> quantum_density_partial_trace density=`self` keep=`保留`*
|
||||
|
||||
## 本征
|
||||
|
||||
厄米谱 → `{eigenvalues, eigenvectors}`。
|
||||
|
||||
**> quantum_density_eig density=`self`**
|
||||
*> quantum_density_eig density=`self`*
|
||||
|
||||
## 期望
|
||||
+ `可观测量`
|
||||
|
||||
**> quantum_density_expect density=`self` obs=`可观测量`**
|
||||
*> quantum_density_expect density=`self` obs=`可观测量`*
|
||||
|
||||
## 绘图
|
||||
+ `路径`=None
|
||||
@@ -289,4 +289,4 @@ Tr(ρ²)。
|
||||
|
||||
Hinton / 城市 / 密度格 / 泡利向量 SVG(`种类=hinton` 或 city / density / paulivec)。
|
||||
|
||||
**> quantum_density_draw density=`self` path=`路径` kind=`种类`**
|
||||
*> quantum_density_draw density=`self` path=`路径` kind=`种类`*
|
||||
Reference in new issue
Block a user