Release 2.7.0: executable handbooks and native user-site workflows
This commit is contained in:
1 parent
aa0c4d0f55
commit
d9aef957f7
562 files changed
+21064
-20387
No files matched your search
@@ -9,10 +9,19 @@ import:
|
||||
|
||||
# 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
|
||||
|
||||
| 返回 | 类型 | 说明 |
|
||||
|---|---|---|
|
||||
| result | any | None; execute this page's documented steps in order and observe their output or stated effects |
|
||||
|
||||
Prepare a two-qubit Bell state by applying H and then controlled-X. The full density matrix is pure, while tracing out one qubit leaves a mixed reduced state; these are different questions about the same state. The ZZ expectation and Schmidt entropy give complementary checks, not additional measurements of an evolving physical device.
|
||||
|
||||
The five SVG outputs are real artifacts written through the quantum drawing API, so run in a disposable filesystem root with its required plugin and write effects. Their different views share the calculated state. Keep both numeric observations and generated paths when verifying the example; a successful file write alone does not establish the entanglement values.
|
||||
|
||||
`steps` =
|
||||
|
||||
| step | gate | qubits |
|
||||
@@ -20,28 +29,28 @@ Build |Φ⁺⟩ with H then CX. Full-state purity stays 1; tracing out one qubit
|
||||
| 1 | H | 0 |
|
||||
| 2 | CX | 0,1 |
|
||||
|
||||
**qc = > quantum.circuit qubits=2 steps=`steps`**
|
||||
**p = > `qc`.probabilities**
|
||||
We first **qc = [Compute qc](quantum.circuit(qubits=2, steps=`steps`))** for the next step.
|
||||
We first **p = [Compute p](> `qc`.probabilities)** for the next step.
|
||||
|
||||
**rho = > `qc`.density**
|
||||
**pur = > `rho`.purity**
|
||||
**red = > `rho`.partial_trace keep=0**
|
||||
**rpur = > `red`.purity**
|
||||
We first **rho = [Compute rho](> `qc`.density)** for the next step.
|
||||
We first **pur = [Compute pur](> `rho`.purity)** for the next step.
|
||||
We first **red = [Compute red](> `rho`.partial_trace keep=0)** for the next step.
|
||||
We first **rpur = [Compute rpur](> `red`.purity)** for the next step.
|
||||
|
||||
**zz = "ZZ"**
|
||||
**ezz = > `qc`.expect obs=`zz`**
|
||||
We first **zz = "ZZ"** for the next step.
|
||||
We first **ezz = [Compute ezz](> `qc`.expect obs=`zz`)** for the next step.
|
||||
|
||||
**sch = > `qc`.schmidt cut=1**
|
||||
**ent = [entropy](access(sch, "entropy"))**
|
||||
We first **sch = [Compute sch](> `qc`.schmidt cut=1)** for the next step.
|
||||
We first **ent = [entropy](access(`sch`, "entropy"))** for the next step.
|
||||
|
||||
**_ = > `qc`.draw path="entangle-circuit.svg" theme="dark"**
|
||||
**_ = > `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"**
|
||||
We first **_ = [Compute _](> `qc`.draw path="entangle-circuit.svg" theme="dark")** for the next step.
|
||||
We first **_ = [Compute _](> `qc`.draw kind="hinton" path="entangle-hinton.svg")** for the next step.
|
||||
We first **_ = [Compute _](> `qc`.draw kind="qsphere" path="entangle-qsphere.svg")** for the next step.
|
||||
We first **_ = [Compute _](> `qc`.draw kind="multibloch" path="entangle-multibloch.svg")** for the next step.
|
||||
We first **_ = [Compute _](> `rho`.draw kind="city" path="entangle-city.svg")** for the next step.
|
||||
|
||||
> print text=`p`
|
||||
> print text=`pur`
|
||||
> print text=`rpur`
|
||||
> print text=`ezz`
|
||||
> print text=`ent`
|
||||
We now **[Display this step's result](> print text=`p`)**.
|
||||
We now **[Display this step's result](> print text=`pur`)**.
|
||||
We now **[Display this step's result](> print text=`rpur`)**.
|
||||
We now **[Display this step's result](> print text=`ezz`)**.
|
||||
We now **[Display this step's result](> print text=`ent`)**.
|
||||
Reference in new issue
Block a user