docs(quantum): Q7c entanglement example and skill summary
Add examples/quantum-entanglement lab, update skill/reference/examples and public feature page for Q7 density/viz APIs; mark roadmap Q7 complete. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
88fe076216
commit
f3fe7f268e
13 files changed
+212
-16
No files matched your search
@@ -0,0 +1,13 @@
|
||||
# quantum-entanglement
|
||||
|
||||
Bell |Φ⁺⟩ **entanglement lab** via `ext/quantum` Q7: density matrix, partial trace, Schmidt entropy, and advanced SVG (hinton / qsphere / multibloch / city).
|
||||
|
||||
```bash
|
||||
cargo build --release -p marqdo_plugin_quantum
|
||||
marqdo ext add quantum # once
|
||||
marqdo run examples/quantum-entanglement/index.mq.md
|
||||
```
|
||||
|
||||
Prints probabilities, full/reduced purity, ⟨ZZ⟩, and Schmidt entropy; writes SVGs next to the program (sandbox cwd).
|
||||
|
||||
Design: [ext-quantum-q7.md](../../doc/design/ext-quantum-q7.md) · sibling demo: [quantum-bell](../quantum-bell/).
|
||||
@@ -0,0 +1,45 @@
|
||||
---
|
||||
title: Entanglement lab
|
||||
description: Bell state — density, partial trace, Schmidt, advanced SVG (Q7).
|
||||
import quantum:ext/quantum/quantum.mq.md
|
||||
import math:lib/math.mq.md
|
||||
---
|
||||
|
||||
# Entanglement from a runnable document
|
||||
|
||||
Build |Φ⁺⟩ with H then CX. Full-state purity stays 1; tracing out one qubit yields a mixed state (purity 1/2). Schmidt coefficients and entropy quantify the bipartition. SVG plots (hinton / qsphere / multibloch) make the same facts visible.
|
||||
|
||||
# main
|
||||
|
||||
`steps` =
|
||||
|
||||
| step | gate | qubits |
|
||||
|------|------|--------|
|
||||
| 1 | H | 0 |
|
||||
| 2 | CX | 0,1 |
|
||||
|
||||
*qc = > quantum.circuit qubits=2 steps=`steps`*
|
||||
*p = > `qc`.probabilities*
|
||||
|
||||
*rho = > `qc`.density*
|
||||
*pur = > `rho`.purity*
|
||||
*red = > `rho`.partial_trace keep=0*
|
||||
*rpur = > `red`.purity*
|
||||
|
||||
*zz = "ZZ"*
|
||||
*ezz = > `qc`.expect obs=`zz`*
|
||||
|
||||
*sch = > `qc`.schmidt cut=1*
|
||||
*ent = sch[^entropy]*
|
||||
|
||||
*_ = > `qc`.draw path="entangle-circuit.svg"*
|
||||
*_ = > `qc`.draw kind="hinton" path="entangle-hinton.svg"*
|
||||
*_ = > `qc`.draw kind="qsphere" path="entangle-qsphere.svg"*
|
||||
*_ = > `qc`.draw kind="multibloch" path="entangle-multibloch.svg"*
|
||||
*_ = > `rho`.draw kind="city" path="entangle-city.svg"*
|
||||
|
||||
> print text=`p`
|
||||
> print text=`pur`
|
||||
> print text=`rpur`
|
||||
> print text=`ezz`
|
||||
> print text=`ent`
|
||||
Reference in new issue
Block a user