> ## Documentation Index
> Fetch the complete documentation index at: https://tsim.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Quantum State Encoding with a Color Code

```python theme={null}
from tsim import Circuit
import sinter
import numpy as np
import matplotlib.pyplot as plt
from tesseract_decoder import tesseract, TesseractSinterDecoder
from utils.no_decoder import NoDecoder
```

This tutorial showcases the basic functionality of **Tsim**.

tsim is a circuit sampler for Clifford+T circuits, based on stabilizer rank decomposition and ZX-calculus techniques. It closely follows the API of stim and directly uses stim's circuit format.

In contrast to Stim, Tsim supports `T` and `T_DAG` instructions.

The following circuit demonstrates this by preparing and measuring the state

$$
H\,T\,|+\rangle
= e^{i\pi/8}\Big[\cos\!\left(\tfrac{\pi}{8}\right)\,|0\rangle
\;-\; i\,\sin\!\left(\tfrac{\pi}{8}\right)\,|1\rangle\Big].
$$

```python theme={null}
c = Circuit("""
    RX 0
    T 0
    H 0
    M 0
    """)
c.diagram("timeline-svg", height=150)
```

<iframe
  srcDoc="<!doctype html><html><head><meta charset=&#x22;utf-8&#x22;><style>html,body{margin:0;padding:0;height:100%;overflow:hidden;}</style></head><body><div data-tsim-zoom=&#x22;tsim-zoom-001&#x22; style=&#x22;width:100%; height:100%; box-sizing:border-box; font-size:0; line-height:0; overflow:auto; background:white; border:none; position:relative;&#x22;>
<div style=&#x22;display:inline-block; overflow:hidden; width:330.0px; height:150.0px;&#x22;>
<div style=&#x22;transform-origin:0 0; display:block; width:352.0px; height:160.0px; transform:scale(0.9375);&#x22;>
<svg width=&#x22;352.0&#x22; height=&#x22;160.0&#x22; xmlns=&#x22;http://www.w3.org/2000/svg&#x22; viewBox=&#x22;0 0 352 160&#x22; version=&#x22;1.1&#x22;>
<g id=&#x22;qubit_lines&#x22;>
<path id=&#x22;qubit_line:0&#x22; d=&#x22;M64,64 L320,64 &#x22; stroke=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;end&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;64&#x22; y=&#x22;64&#x22;>q0</text>
</g>
<rect x=&#x22;80&#x22; y=&#x22;48&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;26&#x22; x=&#x22;96&#x22; y=&#x22;64&#x22; fill=&#x22;white&#x22;>R<tspan baseline-shift=&#x22;sub&#x22; font-size=&#x22;16&#x22;>X</tspan></text>
<rect x=&#x22;144&#x22; y=&#x22;48&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;160&#x22; y=&#x22;64&#x22;>T</text><rect x=&#x22;208&#x22; y=&#x22;48&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;224&#x22; y=&#x22;64&#x22;>H</text>
<rect x=&#x22;272&#x22; y=&#x22;48&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;288&#x22; y=&#x22;64&#x22; fill=&#x22;white&#x22;>M</text>
<text text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;8&#x22; x=&#x22;288&#x22; y=&#x22;44&#x22;>rec[0]</text>
</svg>
</div>
</div>
</div>
<script>
(function() {
var wrap = document.querySelector('[data-tsim-zoom=&#x22;tsim-zoom-001&#x22;]');
if (!wrap || wrap.dataset.tsimZoomInit) return;
wrap.dataset.tsimZoomInit = &#x22;1&#x22;;
var size = wrap.firstElementChild;
var xform = size.firstElementChild;
var natW = 352.0;
var natH = 160.0;
var scale = 0.9375;
var cw = wrap.clientWidth;
if (cw > 0 && natW > 0) {
/* keep height-fit initial scale */
}
function apply() {
xform.style.transform = 'scale(' + scale + ')';
size.style.width = (natW * scale) + 'px';
size.style.height = (natH * scale) + 'px';
}
apply();
wrap.addEventListener('wheel', function(e) {
if (e.ctrlKey || e.metaKey) {
e.preventDefault();
var rect = wrap.getBoundingClientRect();
var mx = e.clientX - rect.left + wrap.scrollLeft;
var my = e.clientY - rect.top + wrap.scrollTop;
var factor = Math.exp(-e.deltaY * 0.01);
var newScale = Math.min(Math.max(0.02, scale * factor), 40);
var ratio = newScale / scale;
scale = newScale;
apply();
wrap.scrollLeft = mx * ratio - (e.clientX - rect.left);
wrap.scrollTop = my * ratio - (e.clientY - rect.top);
}
}, { passive: false });
})();
</script></body></html>"
  width="100%"
  height="154"
  style={{border: "1px solid #eee", borderRadius: "0.5rem"}}
  title="Circuit diagram 1"
  loading="lazy"
/>

To sample from this circuit, we first compile it into a sampler:

```python theme={null}
sampler = c.compile_sampler()
```

We can now sample bitstrings from the measurement instructions:

```python theme={null}
sampler.sample(shots=10)
```

```text title="Output" theme={null}
array([[False],
       [False],
       [False],
       [False],
       [False],
       [False],
       [False],
       [False],
       [False],
       [False]])
```

Let's run a large number of shots to estimate the probability of measuring `1`.

```python theme={null}
samples = sampler.sample(shots=10_000_000, batch_size=1_000_000)
int(np.count_nonzero(samples)) / len(samples)
```

```text title="Output" theme={null}
0.1463239
```

As expected, the probability is close to $\sin(\pi/8)^2 \approx 0.1464$.

## Detectors and Observables

Next, we consider a more complex example: an encoding circuit for the \[\[7,1,3]] Steane code. This circuit prepares the logical state

$\frac{1}{2}\Big[(1 + e^{i\pi/4})|\bar{0}\rangle + (1 - e^{i\pi/4})|\bar{1}\rangle\Big]$

```python theme={null}
c = Circuit("""
    RX 6
    T 6
    H 6
    R 0 1 2 3 4 5
    SQRT_Y_DAG 0 1 2 3 4 5
    CZ 1 2 3 4 5 6
    SQRT_Y 6
    CZ 0 3 2 5 4 6
    SQRT_Y 2 3 4 5 6
    CZ 0 1 2 3 4 5
    SQRT_Y 1 2 4
    X 3
    TICK
    M 0 1 2 3 4 5 6
    DETECTOR rec[-7] rec[-6] rec[-5] rec[-4]
    DETECTOR rec[-6] rec[-5] rec[-3] rec[-2]
    DETECTOR rec[-5] rec[-4] rec[-3] rec[-1]
    OBSERVABLE_INCLUDE(0) rec[-7] rec[-6] rec[-2]
    """)
```

tsim supports multiple visualization methods. The default makes use of `stim`'s "timeline-svg" visualization function:

```python theme={null}
c.diagram(height=350)
```

<iframe
  srcDoc="<!doctype html><html><head><meta charset=&#x22;utf-8&#x22;><style>html,body{margin:0;padding:0;height:100%;overflow:hidden;}</style></head><body><div data-tsim-zoom=&#x22;tsim-zoom-002&#x22; style=&#x22;width:100%; height:100%; box-sizing:border-box; font-size:0; line-height:0; overflow:auto; background:white; border:none; position:relative;&#x22;>
<div style=&#x22;display:inline-block; overflow:hidden; width:1008.8235294117648px; height:350.0px;&#x22;>
<div style=&#x22;transform-origin:0 0; display:block; width:1568.0px; height:544.0px; transform:scale(0.6433823529411765);&#x22;>
<svg width=&#x22;1568.0&#x22; height=&#x22;544.0&#x22; xmlns=&#x22;http://www.w3.org/2000/svg&#x22; viewBox=&#x22;0 0 1568 544&#x22; version=&#x22;1.1&#x22;>
<g id=&#x22;qubit_lines&#x22;>
<path id=&#x22;qubit_line:0&#x22; d=&#x22;M64,64 L1536,64 &#x22; stroke=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;end&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;64&#x22; y=&#x22;64&#x22;>q0</text>
<path id=&#x22;qubit_line:1&#x22; d=&#x22;M64,128 L1536,128 &#x22; stroke=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;end&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;64&#x22; y=&#x22;128&#x22;>q1</text>
<path id=&#x22;qubit_line:2&#x22; d=&#x22;M64,192 L1536,192 &#x22; stroke=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;end&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;64&#x22; y=&#x22;192&#x22;>q2</text>
<path id=&#x22;qubit_line:3&#x22; d=&#x22;M64,256 L1536,256 &#x22; stroke=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;end&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;64&#x22; y=&#x22;256&#x22;>q3</text>
<path id=&#x22;qubit_line:4&#x22; d=&#x22;M64,320 L1536,320 &#x22; stroke=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;end&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;64&#x22; y=&#x22;320&#x22;>q4</text>
<path id=&#x22;qubit_line:5&#x22; d=&#x22;M64,384 L1536,384 &#x22; stroke=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;end&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;64&#x22; y=&#x22;384&#x22;>q5</text>
<path id=&#x22;qubit_line:6&#x22; d=&#x22;M64,448 L1536,448 &#x22; stroke=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;end&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;64&#x22; y=&#x22;448&#x22;>q6</text>
</g>
<rect x=&#x22;80&#x22; y=&#x22;432&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;26&#x22; x=&#x22;96&#x22; y=&#x22;448&#x22; fill=&#x22;white&#x22;>R<tspan baseline-shift=&#x22;sub&#x22; font-size=&#x22;16&#x22;>X</tspan></text>
<rect x=&#x22;144&#x22; y=&#x22;432&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;160&#x22; y=&#x22;448&#x22;>T</text><rect x=&#x22;208&#x22; y=&#x22;432&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;224&#x22; y=&#x22;448&#x22;>H</text>
<rect x=&#x22;208&#x22; y=&#x22;48&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;224&#x22; y=&#x22;64&#x22; fill=&#x22;white&#x22;>R</text>
<rect x=&#x22;208&#x22; y=&#x22;112&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;224&#x22; y=&#x22;128&#x22; fill=&#x22;white&#x22;>R</text>
<rect x=&#x22;208&#x22; y=&#x22;176&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;224&#x22; y=&#x22;192&#x22; fill=&#x22;white&#x22;>R</text>
<rect x=&#x22;208&#x22; y=&#x22;240&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;224&#x22; y=&#x22;256&#x22; fill=&#x22;white&#x22;>R</text>
<rect x=&#x22;208&#x22; y=&#x22;304&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;224&#x22; y=&#x22;320&#x22; fill=&#x22;white&#x22;>R</text>
<rect x=&#x22;208&#x22; y=&#x22;368&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;224&#x22; y=&#x22;384&#x22; fill=&#x22;white&#x22;>R</text>
<rect x=&#x22;272&#x22; y=&#x22;48&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;18&#x22; x=&#x22;288&#x22; y=&#x22;64&#x22;>√Y<tspan baseline-shift=&#x22;super&#x22; font-size=&#x22;14&#x22;>†</tspan></text>
<rect x=&#x22;272&#x22; y=&#x22;112&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;18&#x22; x=&#x22;288&#x22; y=&#x22;128&#x22;>√Y<tspan baseline-shift=&#x22;super&#x22; font-size=&#x22;14&#x22;>†</tspan></text>
<rect x=&#x22;272&#x22; y=&#x22;176&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;18&#x22; x=&#x22;288&#x22; y=&#x22;192&#x22;>√Y<tspan baseline-shift=&#x22;super&#x22; font-size=&#x22;14&#x22;>†</tspan></text>
<rect x=&#x22;272&#x22; y=&#x22;240&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;18&#x22; x=&#x22;288&#x22; y=&#x22;256&#x22;>√Y<tspan baseline-shift=&#x22;super&#x22; font-size=&#x22;14&#x22;>†</tspan></text>
<rect x=&#x22;272&#x22; y=&#x22;304&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;18&#x22; x=&#x22;288&#x22; y=&#x22;320&#x22;>√Y<tspan baseline-shift=&#x22;super&#x22; font-size=&#x22;14&#x22;>†</tspan></text>
<rect x=&#x22;272&#x22; y=&#x22;368&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;18&#x22; x=&#x22;288&#x22; y=&#x22;384&#x22;>√Y<tspan baseline-shift=&#x22;super&#x22; font-size=&#x22;14&#x22;>†</tspan></text>
<path d=&#x22;M352,128 L352,192 &#x22; stroke=&#x22;black&#x22;/>
<circle cx=&#x22;352&#x22; cy=&#x22;128&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<circle cx=&#x22;352&#x22; cy=&#x22;192&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<path d=&#x22;M352,256 L352,320 &#x22; stroke=&#x22;black&#x22;/>
<circle cx=&#x22;352&#x22; cy=&#x22;256&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<circle cx=&#x22;352&#x22; cy=&#x22;320&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<path d=&#x22;M352,384 L352,448 &#x22; stroke=&#x22;black&#x22;/>
<circle cx=&#x22;352&#x22; cy=&#x22;384&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<circle cx=&#x22;352&#x22; cy=&#x22;448&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<rect x=&#x22;400&#x22; y=&#x22;432&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;24&#x22; x=&#x22;416&#x22; y=&#x22;448&#x22;>√Y</text>
<path d=&#x22;M416,64 L416,256 &#x22; stroke=&#x22;black&#x22;/>
<circle cx=&#x22;416&#x22; cy=&#x22;64&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<circle cx=&#x22;416&#x22; cy=&#x22;256&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<path d=&#x22;M480,192 L480,384 &#x22; stroke=&#x22;black&#x22;/>
<circle cx=&#x22;480&#x22; cy=&#x22;192&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<circle cx=&#x22;480&#x22; cy=&#x22;384&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<path d=&#x22;M544,320 L544,448 &#x22; stroke=&#x22;black&#x22;/>
<circle cx=&#x22;544&#x22; cy=&#x22;320&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<circle cx=&#x22;544&#x22; cy=&#x22;448&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<rect x=&#x22;528&#x22; y=&#x22;176&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;24&#x22; x=&#x22;544&#x22; y=&#x22;192&#x22;>√Y</text>
<rect x=&#x22;528&#x22; y=&#x22;240&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;24&#x22; x=&#x22;544&#x22; y=&#x22;256&#x22;>√Y</text>
<rect x=&#x22;592&#x22; y=&#x22;304&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;24&#x22; x=&#x22;608&#x22; y=&#x22;320&#x22;>√Y</text>
<rect x=&#x22;592&#x22; y=&#x22;368&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;24&#x22; x=&#x22;608&#x22; y=&#x22;384&#x22;>√Y</text>
<rect x=&#x22;592&#x22; y=&#x22;432&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;24&#x22; x=&#x22;608&#x22; y=&#x22;448&#x22;>√Y</text>
<path d=&#x22;M608,64 L608,128 &#x22; stroke=&#x22;black&#x22;/>
<circle cx=&#x22;608&#x22; cy=&#x22;64&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<circle cx=&#x22;608&#x22; cy=&#x22;128&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<path d=&#x22;M608,192 L608,256 &#x22; stroke=&#x22;black&#x22;/>
<circle cx=&#x22;608&#x22; cy=&#x22;192&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<circle cx=&#x22;608&#x22; cy=&#x22;256&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<path d=&#x22;M672,320 L672,384 &#x22; stroke=&#x22;black&#x22;/>
<circle cx=&#x22;672&#x22; cy=&#x22;320&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<circle cx=&#x22;672&#x22; cy=&#x22;384&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<rect x=&#x22;656&#x22; y=&#x22;112&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;24&#x22; x=&#x22;672&#x22; y=&#x22;128&#x22;>√Y</text>
<rect x=&#x22;656&#x22; y=&#x22;176&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;24&#x22; x=&#x22;672&#x22; y=&#x22;192&#x22;>√Y</text>
<rect x=&#x22;720&#x22; y=&#x22;304&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;24&#x22; x=&#x22;736&#x22; y=&#x22;320&#x22;>√Y</text>
<rect x=&#x22;720&#x22; y=&#x22;240&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;736&#x22; y=&#x22;256&#x22;>X</text>
<path d=&#x22;M68,40 L68,32 L764,32 L764,40 &#x22; stroke=&#x22;black&#x22; fill=&#x22;none&#x22;/>
<path d=&#x22;M68,504 L68,512 L764,512 L764,504 &#x22; stroke=&#x22;black&#x22; fill=&#x22;none&#x22;/>
<rect x=&#x22;784&#x22; y=&#x22;48&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;800&#x22; y=&#x22;64&#x22; fill=&#x22;white&#x22;>M</text>
<text text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;8&#x22; x=&#x22;800&#x22; y=&#x22;44&#x22;>rec[0]</text>
<rect x=&#x22;784&#x22; y=&#x22;112&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;800&#x22; y=&#x22;128&#x22; fill=&#x22;white&#x22;>M</text>
<text text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;8&#x22; x=&#x22;800&#x22; y=&#x22;108&#x22;>rec[1]</text>
<rect x=&#x22;784&#x22; y=&#x22;176&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;800&#x22; y=&#x22;192&#x22; fill=&#x22;white&#x22;>M</text>
<text text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;8&#x22; x=&#x22;800&#x22; y=&#x22;172&#x22;>rec[2]</text>
<rect x=&#x22;784&#x22; y=&#x22;240&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;800&#x22; y=&#x22;256&#x22; fill=&#x22;white&#x22;>M</text>
<text text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;8&#x22; x=&#x22;800&#x22; y=&#x22;236&#x22;>rec[3]</text>
<rect x=&#x22;784&#x22; y=&#x22;304&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;800&#x22; y=&#x22;320&#x22; fill=&#x22;white&#x22;>M</text>
<text text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;8&#x22; x=&#x22;800&#x22; y=&#x22;300&#x22;>rec[4]</text>
<rect x=&#x22;784&#x22; y=&#x22;368&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;800&#x22; y=&#x22;384&#x22; fill=&#x22;white&#x22;>M</text>
<text text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;8&#x22; x=&#x22;800&#x22; y=&#x22;364&#x22;>rec[5]</text>
<rect x=&#x22;784&#x22; y=&#x22;432&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;800&#x22; y=&#x22;448&#x22; fill=&#x22;white&#x22;>M</text>
<text text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;8&#x22; x=&#x22;800&#x22; y=&#x22;428&#x22;>rec[6]</text>
<rect x=&#x22;848&#x22; y=&#x22;48&#x22; width=&#x22;352&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;lightgray&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;16&#x22; x=&#x22;1024&#x22; y=&#x22;64&#x22;>DETECTOR</text>
<text text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;8&#x22; x=&#x22;1024&#x22; y=&#x22;44&#x22;>D0 = rec[0]*rec[1]*rec[2]*rec[3]</text>
<rect x=&#x22;848&#x22; y=&#x22;112&#x22; width=&#x22;352&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;lightgray&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;16&#x22; x=&#x22;1024&#x22; y=&#x22;128&#x22;>DETECTOR</text>
<text text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;8&#x22; x=&#x22;1024&#x22; y=&#x22;108&#x22;>D1 = rec[1]*rec[2]*rec[4]*rec[5]</text>
<rect x=&#x22;848&#x22; y=&#x22;176&#x22; width=&#x22;352&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;lightgray&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;16&#x22; x=&#x22;1024&#x22; y=&#x22;192&#x22;>DETECTOR</text>
<text text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;8&#x22; x=&#x22;1024&#x22; y=&#x22;172&#x22;>D2 = rec[2]*rec[3]*rec[4]*rec[6]</text>
<rect x=&#x22;1232&#x22; y=&#x22;48&#x22; width=&#x22;288&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;lightgray&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;16&#x22; x=&#x22;1376&#x22; y=&#x22;64&#x22;>OBS_INCLUDE(0)</text>
<text text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;8&#x22; x=&#x22;1376&#x22; y=&#x22;44&#x22;>L0 *= rec[0]*rec[1]*rec[5]</text>
<path d=&#x22;M772,40 L772,32 L1532,32 L1532,40 &#x22; stroke=&#x22;black&#x22; fill=&#x22;none&#x22;/>
<path d=&#x22;M772,504 L772,512 L1532,512 L1532,504 &#x22; stroke=&#x22;black&#x22; fill=&#x22;none&#x22;/>
</svg>
</div>
</div>
</div>
<script>
(function() {
var wrap = document.querySelector('[data-tsim-zoom=&#x22;tsim-zoom-002&#x22;]');
if (!wrap || wrap.dataset.tsimZoomInit) return;
wrap.dataset.tsimZoomInit = &#x22;1&#x22;;
var size = wrap.firstElementChild;
var xform = size.firstElementChild;
var natW = 1568.0;
var natH = 544.0;
var scale = 0.6433823529411765;
var cw = wrap.clientWidth;
if (cw > 0 && natW > 0) {
/* keep height-fit initial scale */
}
function apply() {
xform.style.transform = 'scale(' + scale + ')';
size.style.width = (natW * scale) + 'px';
size.style.height = (natH * scale) + 'px';
}
apply();
wrap.addEventListener('wheel', function(e) {
if (e.ctrlKey || e.metaKey) {
e.preventDefault();
var rect = wrap.getBoundingClientRect();
var mx = e.clientX - rect.left + wrap.scrollLeft;
var my = e.clientY - rect.top + wrap.scrollTop;
var factor = Math.exp(-e.deltaY * 0.01);
var newScale = Math.min(Math.max(0.02, scale * factor), 40);
var ratio = newScale / scale;
scale = newScale;
apply();
wrap.scrollLeft = mx * ratio - (e.clientX - rect.left);
wrap.scrollTop = my * ratio - (e.clientY - rect.top);
}
}, { passive: false });
})();
</script></body></html>"
  width="100%"
  height="354"
  style={{border: "1px solid #eee", borderRadius: "0.5rem"}}
  title="Circuit diagram 2"
  loading="lazy"
/>

Tsim also supports visualization as a ZX diagram, where measurement vertices are annotated with `rec[i]`, and detector and observable vertices are annotated with `det[i]` and `obs[i]`, respectively.

```python theme={null}
c.diagram("pyzx");
```

<iframe
  srcDoc="<!doctype html><html><head><meta charset=&#x22;utf-8&#x22;><style>html,body{margin:0;padding:0;height:100%;overflow:hidden;}[id^=&#x22;graph-output-&#x22;]{width:100%;height:100%;overflow:auto;box-sizing:border-box;}</style></head><body><div style=&#x22;overflow:auto; background-color: white&#x22; id=&#x22;graph-output-001&#x22;></div><script type=&#x22;module&#x22;>
var d3;
if (d3 == null) { d3 = await import(&#x22;https://esm.sh/d3@5&#x22;); }
var _settings_colors = JSON.parse('{&#x22;edge&#x22;: &#x22;#000000&#x22;, &#x22;Hedge&#x22;: &#x22;#0088ff&#x22;, &#x22;Xedge&#x22;: &#x22;#999999&#x22;, &#x22;Bedge&#x22;: &#x22;#000000&#x22;, &#x22;HBedge&#x22;: &#x22;#0088ff&#x22;, &#x22;boundary&#x22;: &#x22;#000000&#x22;, &#x22;X&#x22;: &#x22;#ff8888&#x22;, &#x22;Y&#x22;: &#x22;#aabbff&#x22;, &#x22;Z&#x22;: &#x22;#ccffcc&#x22;, &#x22;H&#x22;: &#x22;#ffff66&#x22;, &#x22;W&#x22;: &#x22;#000000&#x22;, &#x22;Zalt&#x22;: &#x22;#ccffcc&#x22;, &#x22;Walt&#x22;: &#x22;#000000&#x22;, &#x22;Zbold&#x22;: &#x22;#ccffcc&#x22;, &#x22;Xbold&#x22;: &#x22;#ff8888&#x22;, &#x22;Xdark&#x22;: &#x22;#ff8888&#x22;, &#x22;Ydark&#x22;: &#x22;#aabbff&#x22;, &#x22;Zdark&#x22;: &#x22;#99dd99&#x22;}');
// PyZX - Python library for quantum circuit rewriting 
//        and optimisation using the ZX-calculus
// Copyright (C) 2018 - Aleks Kissinger and John van de Wetering

// Licensed under the Apache License, Version 2.0 (the &#x22;License&#x22;);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

//    http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an &#x22;AS IS&#x22; BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// styling functions
function nodeColor(t) {
if (t == 0) return _settings_colors['boundary'];
else if (t == 1) return _settings_colors['Z']; // &#x22;#ccffcc&#x22;;
else if (t == 2) return _settings_colors['X']; // &#x22;#ff8888&#x22;;
else if (t == 3) return _settings_colors['H']; // &#x22;yellow&#x22;;
else if (t == 4) return _settings_colors['W']; // &#x22;black&#x22;;
else if (t == 5) return _settings_colors['Walt']; // &#x22;black&#x22;;
else if (t == 6) return _settings_colors['Zalt']; // &#x22;#ccffcc&#x22;;
else if (t == 7) return _settings_colors['Zbold']; // &#x22;#ccffcc&#x22; bold Z
else if (t == 8) return _settings_colors['Xbold']; // &#x22;#ff8888&#x22; bold X
}

function edgeColor(t) {
if (t == 1) return _settings_colors['edge']; //&#x22;black&#x22;;
else if (t == 2) return _settings_colors['Hedge']; // &#x22;#08f&#x22;;
else if (t == 3) return _settings_colors['Xedge']; // &#x22;gray&#x22;;
else if (t == 4) return _settings_colors['Bedge']; // &#x22;black&#x22; bold
else if (t == 5) return _settings_colors['HBedge']; // &#x22;#0088ff&#x22; bold hadamard
}

function isBoldEdge(t) {
return t == 4 || t == 5;
}

function webColor(t) {
if (t == 'X') return _settings_colors['Xdark'];
else if (t == 'Y') return _settings_colors['Ydark'];
else if (t == 'Z') return _settings_colors['Zdark'];
else if (t == 'I') return '#dddddd';
}

function nodeStyle(selected, t) {
var bold = (t == 7 || t == 8);
if (selected) return &#x22;stroke-width: &#x22; + (bold ? &#x22;4&#x22; : &#x22;2&#x22;) + &#x22;px; stroke: #00f&#x22;;
return &#x22;stroke-width: &#x22; + (bold ? &#x22;3&#x22; : &#x22;1.5&#x22;) + &#x22;px&#x22;;
}

var symbolGround = {
draw: function(context, size){
let s = size/2;

context.moveTo(0,-s);
context.lineTo(0,0);

context.moveTo(-s,0);
context.lineTo(s,0);

context.moveTo(-2*s/3,s/3);
context.lineTo(2*s/3,s/3);

context.moveTo(-s/3,2*s/3);
context.lineTo(s/3,2*s/3);
}
}

function showGraph(tag, graph, width, height, scale, node_size, auto_hbox, show_labels, scalar_str) {
var ntab = {};

var groundOffset = 2.5 * node_size;

graph.nodes.forEach(function(d) {
ntab[d.name] = d;
d.selected = false;
d.previouslySelected = false;
d.nhd = [];
});

var spiders_and_boundaries = graph.nodes.filter(function(d) {
return d.t != 3;
});

graph.links.forEach(function(d) {
var s = ntab[d.source];
var t = ntab[d.target];
d.source = s;
d.target = t;
s.nhd.push(t);
t.nhd.push(s);
});

graph.pauli_web.forEach(function(d) {
var s = ntab[d.source];
var t = ntab[d.target];
d.source = s;
d.target = t;
});

var shiftKey;

// SETUP SVG ITEMS

var svg = d3.select(tag)
//.attr(&#x22;tabindex&#x22;, 1)
.on(&#x22;keydown.brush&#x22;, function() {shiftKey = d3.event.shiftKey || d3.event.metaKey;})
.on(&#x22;keyup.brush&#x22;, function() {shiftKey = d3.event.shiftKey || d3.event.metaKey;})
//.each(function() { this.focus(); })
.append(&#x22;svg&#x22;)
.attr(&#x22;style&#x22;, &#x22;max-width: none; max-height: none&#x22;)
.attr(&#x22;width&#x22;, width)
.attr(&#x22;height&#x22;, height);

var web = svg.append(&#x22;g&#x22;)
.attr(&#x22;class&#x22;, &#x22;web&#x22;)
.selectAll(&#x22;line&#x22;)
.data(graph.pauli_web)
.enter().append(&#x22;path&#x22;)
.attr(&#x22;stroke&#x22;, function(d) { return webColor(d.t); })
.attr(&#x22;fill&#x22;, &#x22;transparent&#x22;)
.attr(&#x22;style&#x22;, &#x22;stroke-width: 7px&#x22;);

var link = svg.append(&#x22;g&#x22;)
.attr(&#x22;class&#x22;, &#x22;link&#x22;)
.selectAll(&#x22;line&#x22;)
.data(graph.links)
.enter().append(&#x22;path&#x22;)
.attr(&#x22;stroke&#x22;, function(d) { return edgeColor(d.t); })
.attr(&#x22;fill&#x22;, &#x22;transparent&#x22;)
.attr(&#x22;style&#x22;, function(d) { return isBoldEdge(d.t) ? &#x22;stroke-width: 3.5px&#x22; : &#x22;stroke-width: 1.5px&#x22;; });

var brush = svg.append(&#x22;g&#x22;)
.attr(&#x22;class&#x22;, &#x22;brush&#x22;);

var node = svg.append(&#x22;g&#x22;)
.attr(&#x22;class&#x22;, &#x22;node&#x22;)
.selectAll(&#x22;g&#x22;)
.data(graph.nodes)
.enter().append(&#x22;g&#x22;)
.attr(&#x22;transform&#x22;, function(d) {
return &#x22;translate(&#x22; + d.x + &#x22;,&#x22; + d.y +&#x22;)&#x22;;
});

// Draw a ground symbol connected to the node.
node.filter(function(d) { return d.ground; })
.append(&#x22;path&#x22;)
.attr(&#x22;stroke&#x22;, &#x22;black&#x22;)
.attr(&#x22;style&#x22;, &#x22;stroke-width: 1.5px&#x22;)
.attr(&#x22;fill&#x22;, &#x22;none&#x22;)
.attr(&#x22;d&#x22;, &#x22;M 0 0 L 0 &#x22;+(groundOffset))
.attr(&#x22;class&#x22;, &#x22;selectable&#x22;);
node.filter(function(d) { return d.ground; })
.append(&#x22;path&#x22;)
.attr(&#x22;stroke&#x22;, &#x22;black&#x22;)
.attr(&#x22;style&#x22;, &#x22;stroke-width: 1.5px&#x22;)
.attr(&#x22;fill&#x22;, &#x22;none&#x22;)
.attr(&#x22;d&#x22;, d3.symbol().type(symbolGround).size(node_size*1.5))
.attr(&#x22;transform&#x22;, &#x22;translate(0,&#x22;+groundOffset+&#x22;)&#x22;)
.attr(&#x22;class&#x22;, &#x22;selectable&#x22;);

node.filter(function(d) { return d.t != 3 && d.t != 5 && d.t != 6; })
.append(&#x22;circle&#x22;)
.attr(&#x22;r&#x22;, function(d) {
if (d.t == 0) return 0.5 * node_size;
else if (d.t == 4) return 0.25 * node_size;
else return node_size;
})
.attr(&#x22;fill&#x22;, function(d) { return nodeColor(d.t); })
.attr(&#x22;stroke&#x22;, &#x22;black&#x22;)
.attr(&#x22;stroke-width&#x22;, function(d) { return (d.t == 7 || d.t == 8) ? 3 : 1.5; })
.attr(&#x22;class&#x22;, &#x22;selectable&#x22;);

var hbox = node.filter(function(d) { return d.t == 3; });

hbox.append(&#x22;rect&#x22;)
.attr(&#x22;x&#x22;, -0.75 * node_size).attr(&#x22;y&#x22;, -0.75 * node_size)
.attr(&#x22;width&#x22;, node_size * 1.5).attr(&#x22;height&#x22;, node_size * 1.5)
.attr(&#x22;fill&#x22;, function(d) { return nodeColor(d.t); })
.attr(&#x22;stroke&#x22;, &#x22;black&#x22;)
.attr(&#x22;class&#x22;, &#x22;selectable&#x22;);

// draw a triangle for d.t == 5
node.filter(function(d) { return d.t == 5; })
.append(&#x22;path&#x22;)
.attr(&#x22;d&#x22;, &#x22;M 0 0 L &#x22;+node_size+&#x22; &#x22;+node_size+&#x22; L -&#x22;+node_size+&#x22; &#x22;+node_size+&#x22; Z&#x22;)
.attr(&#x22;fill&#x22;, function(d) { return nodeColor(d.t); })
.attr(&#x22;stroke&#x22;, &#x22;black&#x22;)
.attr(&#x22;class&#x22;, &#x22;selectable&#x22;)
.attr(&#x22;transform&#x22;, &#x22;translate(&#x22; + (-node_size/2) + &#x22;, 0) rotate(-90)&#x22;);

// draw a square for Z box: d.t == 6
node.filter(function(d) { return d.t == 6; })
.append(&#x22;rect&#x22;)
.attr(&#x22;x&#x22;, -0.75 * node_size).attr(&#x22;y&#x22;, -0.75 * node_size)
.attr(&#x22;width&#x22;, node_size * 1.5).attr(&#x22;height&#x22;, node_size * 1.5)
.attr(&#x22;fill&#x22;, function(d) { return nodeColor(d.t); })
.attr(&#x22;stroke&#x22;, &#x22;black&#x22;)
.attr(&#x22;class&#x22;, &#x22;selectable&#x22;);

node.filter(function(d) { return d.phase != '' && d.phase.indexOf('[') === -1; })
.append(&#x22;text&#x22;)
.attr(&#x22;y&#x22;, 0.7 * node_size + 14)
.text(function (d) { return d.phase })
.attr(&#x22;text-anchor&#x22;, &#x22;middle&#x22;)
.attr(&#x22;font-size&#x22;, &#x22;12px&#x22;)
.attr(&#x22;font-family&#x22;, &#x22;monospace&#x22;)
.attr(&#x22;fill&#x22;, &#x22;#00d&#x22;)
.attr('style', 'pointer-events: none; user-select: none;');

node.filter(function(d) { return d.phase != '' && d.phase.indexOf('[') !== -1; })
.append(&#x22;text&#x22;)
.attr(&#x22;y&#x22;, -0.7 * node_size - 8)
.text(function (d) { return d.phase })
.attr(&#x22;text-anchor&#x22;, &#x22;middle&#x22;)
.attr(&#x22;font-size&#x22;, &#x22;12px&#x22;)
.attr(&#x22;font-family&#x22;, &#x22;monospace&#x22;)
.attr(&#x22;fill&#x22;, &#x22;black&#x22;)
.attr('style', 'pointer-events: none; user-select: none;');

if (show_labels) {
node.append(&#x22;text&#x22;)
.attr(&#x22;y&#x22;, -0.7 * node_size - 8)
.text(function (d) { return d.name; })
.attr(&#x22;text-anchor&#x22;, &#x22;middle&#x22;)
.attr(&#x22;font-size&#x22;, &#x22;10px&#x22;)
.attr(&#x22;font-family&#x22;, &#x22;monospace&#x22;)
.attr(&#x22;fill&#x22;, &#x22;#999&#x22;)
.attr('style', 'pointer-events: none; user-select: none;');
}

// Display the chosen data fields over the node.
node.filter(d => d.vdata.length > 0)
.append(&#x22;text&#x22;)
.attr(&#x22;y&#x22;, d => -0.7 * node_size - 14 - 10 * d.vdata.length)
.attr(&#x22;text-anchor&#x22;, &#x22;middle&#x22;)
.attr(&#x22;font-size&#x22;, &#x22;8px&#x22;)
.attr(&#x22;font-family&#x22;, &#x22;monospace&#x22;)
.attr(&#x22;fill&#x22;, &#x22;#c66&#x22;)
.attr('style', 'pointer-events: none; user-select: none;')
.selectAll(&#x22;tspan&#x22;)
.data(d => d.vdata)
.enter()
.append(&#x22;tspan&#x22;)
.attr(&#x22;x&#x22;, &#x22;0&#x22;)
.attr(&#x22;dy&#x22;, &#x22;1.2em&#x22;)
.text(x => x.join(&#x22;: &#x22;));

if (scalar_str != &#x22;&#x22;) {
svg.append(&#x22;text&#x22;)
.text(scalar_str)
.attr(&#x22;x&#x22;, 60).attr(&#x22;y&#x22;, 40)
.attr(&#x22;text-anchor&#x22;, &#x22;middle&#x22;)
}

function update_hboxes() {
if (auto_hbox) {
var pos = {};
hbox.attr(&#x22;transform&#x22;, function(d) {
// calculate barycenter of non-hbox neighbours, then nudge a bit
// to the NE.
var x=0,y=0,sz=0;
for (var i = 0; i < d.nhd.length; ++i) {
if (d.nhd[i].t != 3) {
sz++;
x += d.nhd[i].x;
y += d.nhd[i].y;
}
}

offset = 0.25 * scale;

if (sz != 0) {
x = (x/sz) + offset;
y = (y/sz) - offset;

while (pos[[x,y]]) {
x += offset;
}
d.x = x;
d.y = y;
pos[[x,y]] = true;
}

return &#x22;translate(&#x22;+d.x+&#x22;,&#x22;+d.y+&#x22;)&#x22;;
});
}
}

update_hboxes();

var link_curve = function(d) {
var x1 = d.source.x, x2 = d.target.x, y1 = d.source.y, y2 = d.target.y;
if (x1 == x2 && y1 == y2 && d.num_parallel == 1) {
var cx1 = x1 - 40;
var cy1 = y1 - 40;
var cx2 = x1 + 40;
var cy2 = y1 - 40;
return `M ${x1} ${y1} C ${cx1} ${cy1}, ${cx2} ${cy2}, ${x2} ${y2}`;
} else if (x1 == x2 && y1 == y2) {
var pos = d.index + 1;
var cx1 = x1 - 20 - pos * 10;
var cy1 = y1 - 20 - pos * 10;
var cx2 = x1 + 20 + pos * 10;
var cy2 = y1 - 20 - pos * 10;
return `M ${x1} ${y1} C ${cx1} ${cy1}, ${cx2} ${cy2}, ${x2} ${y2}`;
} else if (d.num_parallel == 1) {
return `M ${x1} ${y1} L ${x2} ${y2}`;
} else {
var dx = x2 - x1, dy = y2 - y1;
var midx = 0.5 * (x1 + x2), midy = 0.5 * (y1 + y2);
var pos = (d.index / (d.num_parallel-1)) - 0.5;
var cx = midx - pos * dy;
var cy = midy + pos * dx;
return `M ${x1} ${y1} Q ${cx} ${cy}, ${x2} ${y2}`;
// return `M ${x1} ${y1} L ${x2} ${y2}`;
}
};
link.attr(&#x22;d&#x22;, link_curve);


var web_curve = function(d) {
var x1 = d.source.x, x2 = (x1 + d.target.x)/2, y1 = d.source.y, y2 = (y1 + d.target.y)/2;
return `M ${x1} ${y1} L ${x2} ${y2}`;
}
web.attr(&#x22;d&#x22;, web_curve);

// EVENTS FOR DRAGGING AND SELECTION

node.on(&#x22;mousedown&#x22;, function(d) {
if (shiftKey) {
d3.select(this).selectAll(&#x22;.selectable&#x22;).attr(&#x22;style&#x22;, nodeStyle(d.selected = !d.selected, d.t));
d3.event.stopImmediatePropagation();
} else if (!d.selected) {
node.selectAll(&#x22;.selectable&#x22;).attr(&#x22;style&#x22;, function(p) { return nodeStyle(p.selected = d === p, p.t); });
}
})
.call(d3.drag().on(&#x22;drag&#x22;, function(d) {
var dx = d3.event.dx;
var dy = d3.event.dy;
// node.filter(function(d) { return d.selected; })
//     .attr(&#x22;cx&#x22;, function(d) { return d.x += dx; })
//     .attr(&#x22;cy&#x22;, function(d) { return d.y += dy; });
node.filter(function(d) { return d.selected; })
.attr(&#x22;transform&#x22;, function(d) {
d.x += dx;
d.y += dy;
return &#x22;translate(&#x22; + d.x + &#x22;,&#x22; + d.y +&#x22;)&#x22;;
});

update_hboxes();

link.filter(function(d) { return d.source.selected || d.target.selected ||
(auto_hbox && d.source.t == 3); })
.attr(&#x22;d&#x22;, link_curve);
web.filter(function(d) { return d.source.selected || d.target.selected; })
.attr(&#x22;d&#x22;, web_curve);
}));

brush.call(d3.brush().keyModifiers(false)
.extent([[0, 0], [width, height]])
.on(&#x22;start&#x22;, function() {
if (d3.event.sourceEvent.type !== &#x22;end&#x22;) {
node.selectAll(&#x22;.selectable&#x22;).attr(&#x22;style&#x22;, function(d) {
return nodeStyle(
d.selected = d.previouslySelected = shiftKey &&
d.selected, d.t);
});
}
})
.on(&#x22;brush&#x22;, function() {
if (d3.event.sourceEvent.type !== &#x22;end&#x22;) {
var selection = d3.event.selection;
node.selectAll(&#x22;.selectable&#x22;).attr(&#x22;style&#x22;, function(d) {
return nodeStyle(d.selected = d.previouslySelected ^
(selection != null
&& selection[0][0] <= d.x && d.x < selection[1][0]
&& selection[0][1] <= d.y && d.y < selection[1][1]), d.t);
});
}
})
.on(&#x22;end&#x22;, function() {
if (d3.event.selection != null) {
d3.select(this).call(d3.event.target.move, null);
}
}));
}


showGraph('#graph-output-001',
JSON.parse('{&#x22;nodes&#x22;: [{&#x22;name&#x22;: &#x22;0&#x22;, &#x22;x&#x22;: 50.0, &#x22;y&#x22;: 525.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;1&#x22;, &#x22;x&#x22;: 100.0, &#x22;y&#x22;: 525.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0/4&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;2&#x22;, &#x22;x&#x22;: 150.0, &#x22;y&#x22;: 525.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;3&#x22;, &#x22;x&#x22;: 50.0, &#x22;y&#x22;: 225.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;4&#x22;, &#x22;x&#x22;: 100.0, &#x22;y&#x22;: 225.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;5&#x22;, &#x22;x&#x22;: 50.0, &#x22;y&#x22;: 275.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;6&#x22;, &#x22;x&#x22;: 100.0, &#x22;y&#x22;: 275.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;7&#x22;, &#x22;x&#x22;: 50.0, &#x22;y&#x22;: 325.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;8&#x22;, &#x22;x&#x22;: 100.0, &#x22;y&#x22;: 325.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;9&#x22;, &#x22;x&#x22;: 50.0, &#x22;y&#x22;: 375.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;10&#x22;, &#x22;x&#x22;: 100.0, &#x22;y&#x22;: 375.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;11&#x22;, &#x22;x&#x22;: 50.0, &#x22;y&#x22;: 425.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;12&#x22;, &#x22;x&#x22;: 100.0, &#x22;y&#x22;: 425.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;13&#x22;, &#x22;x&#x22;: 50.0, &#x22;y&#x22;: 475.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;14&#x22;, &#x22;x&#x22;: 100.0, &#x22;y&#x22;: 475.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;15&#x22;, &#x22;x&#x22;: 200.0, &#x22;y&#x22;: 225.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;16&#x22;, &#x22;x&#x22;: 150.0, &#x22;y&#x22;: 275.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;17&#x22;, &#x22;x&#x22;: 150.0, &#x22;y&#x22;: 325.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;18&#x22;, &#x22;x&#x22;: 150.0, &#x22;y&#x22;: 375.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;19&#x22;, &#x22;x&#x22;: 150.0, &#x22;y&#x22;: 425.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;20&#x22;, &#x22;x&#x22;: 150.0, &#x22;y&#x22;: 475.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;21&#x22;, &#x22;x&#x22;: 250.0, &#x22;y&#x22;: 275.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;22&#x22;, &#x22;x&#x22;: 200.0, &#x22;y&#x22;: 325.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;23&#x22;, &#x22;x&#x22;: 200.0, &#x22;y&#x22;: 375.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;24&#x22;, &#x22;x&#x22;: 250.0, &#x22;y&#x22;: 425.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;25&#x22;, &#x22;x&#x22;: 200.0, &#x22;y&#x22;: 475.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;26&#x22;, &#x22;x&#x22;: 200.0, &#x22;y&#x22;: 525.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;27&#x22;, &#x22;x&#x22;: 250.0, &#x22;y&#x22;: 525.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;28&#x22;, &#x22;x&#x22;: 250.0, &#x22;y&#x22;: 225.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;29&#x22;, &#x22;x&#x22;: 250.0, &#x22;y&#x22;: 375.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;30&#x22;, &#x22;x&#x22;: 250.0, &#x22;y&#x22;: 325.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;31&#x22;, &#x22;x&#x22;: 250.0, &#x22;y&#x22;: 475.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;32&#x22;, &#x22;x&#x22;: 300.0, &#x22;y&#x22;: 425.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;33&#x22;, &#x22;x&#x22;: 300.0, &#x22;y&#x22;: 525.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;34&#x22;, &#x22;x&#x22;: 300.0, &#x22;y&#x22;: 325.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;35&#x22;, &#x22;x&#x22;: 300.0, &#x22;y&#x22;: 375.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;36&#x22;, &#x22;x&#x22;: 350.0, &#x22;y&#x22;: 425.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;37&#x22;, &#x22;x&#x22;: 350.0, &#x22;y&#x22;: 475.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;38&#x22;, &#x22;x&#x22;: 450.0, &#x22;y&#x22;: 525.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 1, &#x22;phase&#x22;: &#x22;rec[6]&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;39&#x22;, &#x22;x&#x22;: 450.0, &#x22;y&#x22;: 225.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 1, &#x22;phase&#x22;: &#x22;rec[0]&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;40&#x22;, &#x22;x&#x22;: 300.0, &#x22;y&#x22;: 275.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;41&#x22;, &#x22;x&#x22;: 350.0, &#x22;y&#x22;: 325.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;42&#x22;, &#x22;x&#x22;: 350.0, &#x22;y&#x22;: 375.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;43&#x22;, &#x22;x&#x22;: 400.0, &#x22;y&#x22;: 425.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;44&#x22;, &#x22;x&#x22;: 450.0, &#x22;y&#x22;: 475.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 1, &#x22;phase&#x22;: &#x22;rec[5]&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;45&#x22;, &#x22;x&#x22;: 450.0, &#x22;y&#x22;: 275.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 1, &#x22;phase&#x22;: &#x22;rec[1]&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;46&#x22;, &#x22;x&#x22;: 450.0, &#x22;y&#x22;: 325.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 1, &#x22;phase&#x22;: &#x22;rec[2]&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;47&#x22;, &#x22;x&#x22;: 450.0, &#x22;y&#x22;: 425.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 1, &#x22;phase&#x22;: &#x22;rec[4]&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;48&#x22;, &#x22;x&#x22;: 450.0, &#x22;y&#x22;: 375.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 1, &#x22;phase&#x22;: &#x22;rec[3]&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;49&#x22;, &#x22;x&#x22;: 500.0, &#x22;y&#x22;: 225.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 0, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;50&#x22;, &#x22;x&#x22;: 500.0, &#x22;y&#x22;: 275.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 0, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;51&#x22;, &#x22;x&#x22;: 500.0, &#x22;y&#x22;: 325.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 0, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;52&#x22;, &#x22;x&#x22;: 500.0, &#x22;y&#x22;: 375.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 0, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;53&#x22;, &#x22;x&#x22;: 500.0, &#x22;y&#x22;: 425.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 0, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;54&#x22;, &#x22;x&#x22;: 500.0, &#x22;y&#x22;: 475.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 0, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;55&#x22;, &#x22;x&#x22;: 500.0, &#x22;y&#x22;: 525.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 0, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;56&#x22;, &#x22;x&#x22;: 425.0, &#x22;y&#x22;: 175.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 2, &#x22;phase&#x22;: &#x22;det[0]&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;57&#x22;, &#x22;x&#x22;: 475.0, &#x22;y&#x22;: 175.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 2, &#x22;phase&#x22;: &#x22;det[1]&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;58&#x22;, &#x22;x&#x22;: 525.0, &#x22;y&#x22;: 175.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 2, &#x22;phase&#x22;: &#x22;det[2]&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;59&#x22;, &#x22;x&#x22;: 575.0, &#x22;y&#x22;: 175.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 2, &#x22;phase&#x22;: &#x22;obs[0]&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;60&#x22;, &#x22;x&#x22;: 425.0, &#x22;y&#x22;: 125.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 0, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;61&#x22;, &#x22;x&#x22;: 475.0, &#x22;y&#x22;: 125.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 0, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;62&#x22;, &#x22;x&#x22;: 525.0, &#x22;y&#x22;: 125.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 0, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;63&#x22;, &#x22;x&#x22;: 575.0, &#x22;y&#x22;: 100.0, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 0, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}], &#x22;links&#x22;: [{&#x22;source&#x22;: &#x22;0&#x22;, &#x22;target&#x22;: &#x22;1&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;1&#x22;, &#x22;target&#x22;: &#x22;2&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;2&#x22;, &#x22;target&#x22;: &#x22;26&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;2&#x22;, &#x22;target&#x22;: &#x22;20&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;3&#x22;, &#x22;target&#x22;: &#x22;4&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;4&#x22;, &#x22;target&#x22;: &#x22;15&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;5&#x22;, &#x22;target&#x22;: &#x22;6&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;6&#x22;, &#x22;target&#x22;: &#x22;16&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;7&#x22;, &#x22;target&#x22;: &#x22;8&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;8&#x22;, &#x22;target&#x22;: &#x22;17&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;9&#x22;, &#x22;target&#x22;: &#x22;10&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;10&#x22;, &#x22;target&#x22;: &#x22;18&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;11&#x22;, &#x22;target&#x22;: &#x22;12&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;12&#x22;, &#x22;target&#x22;: &#x22;19&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;13&#x22;, &#x22;target&#x22;: &#x22;14&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;14&#x22;, &#x22;target&#x22;: &#x22;20&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;15&#x22;, &#x22;target&#x22;: &#x22;28&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;15&#x22;, &#x22;target&#x22;: &#x22;23&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;16&#x22;, &#x22;target&#x22;: &#x22;21&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;16&#x22;, &#x22;target&#x22;: &#x22;17&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;17&#x22;, &#x22;target&#x22;: &#x22;22&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;18&#x22;, &#x22;target&#x22;: &#x22;23&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;18&#x22;, &#x22;target&#x22;: &#x22;19&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;19&#x22;, &#x22;target&#x22;: &#x22;24&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;20&#x22;, &#x22;target&#x22;: &#x22;25&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;21&#x22;, &#x22;target&#x22;: &#x22;40&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;21&#x22;, &#x22;target&#x22;: &#x22;28&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;22&#x22;, &#x22;target&#x22;: &#x22;30&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;22&#x22;, &#x22;target&#x22;: &#x22;25&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;23&#x22;, &#x22;target&#x22;: &#x22;29&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;24&#x22;, &#x22;target&#x22;: &#x22;32&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;24&#x22;, &#x22;target&#x22;: &#x22;27&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;25&#x22;, &#x22;target&#x22;: &#x22;31&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;26&#x22;, &#x22;target&#x22;: &#x22;27&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;27&#x22;, &#x22;target&#x22;: &#x22;33&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;28&#x22;, &#x22;target&#x22;: &#x22;39&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;29&#x22;, &#x22;target&#x22;: &#x22;35&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;30&#x22;, &#x22;target&#x22;: &#x22;34&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;31&#x22;, &#x22;target&#x22;: &#x22;37&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;32&#x22;, &#x22;target&#x22;: &#x22;36&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;33&#x22;, &#x22;target&#x22;: &#x22;38&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;34&#x22;, &#x22;target&#x22;: &#x22;41&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;34&#x22;, &#x22;target&#x22;: &#x22;35&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;35&#x22;, &#x22;target&#x22;: &#x22;42&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;36&#x22;, &#x22;target&#x22;: &#x22;43&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;36&#x22;, &#x22;target&#x22;: &#x22;37&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;37&#x22;, &#x22;target&#x22;: &#x22;44&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;38&#x22;, &#x22;target&#x22;: &#x22;55&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;38&#x22;, &#x22;target&#x22;: &#x22;58&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;39&#x22;, &#x22;target&#x22;: &#x22;49&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;39&#x22;, &#x22;target&#x22;: &#x22;56&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;39&#x22;, &#x22;target&#x22;: &#x22;59&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;40&#x22;, &#x22;target&#x22;: &#x22;45&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;41&#x22;, &#x22;target&#x22;: &#x22;46&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;42&#x22;, &#x22;target&#x22;: &#x22;48&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;43&#x22;, &#x22;target&#x22;: &#x22;47&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;44&#x22;, &#x22;target&#x22;: &#x22;54&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;44&#x22;, &#x22;target&#x22;: &#x22;57&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;44&#x22;, &#x22;target&#x22;: &#x22;59&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;45&#x22;, &#x22;target&#x22;: &#x22;50&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;45&#x22;, &#x22;target&#x22;: &#x22;56&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;45&#x22;, &#x22;target&#x22;: &#x22;57&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;45&#x22;, &#x22;target&#x22;: &#x22;59&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;46&#x22;, &#x22;target&#x22;: &#x22;51&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;46&#x22;, &#x22;target&#x22;: &#x22;56&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;46&#x22;, &#x22;target&#x22;: &#x22;57&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;46&#x22;, &#x22;target&#x22;: &#x22;58&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;47&#x22;, &#x22;target&#x22;: &#x22;53&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;47&#x22;, &#x22;target&#x22;: &#x22;57&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;47&#x22;, &#x22;target&#x22;: &#x22;58&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;48&#x22;, &#x22;target&#x22;: &#x22;52&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;48&#x22;, &#x22;target&#x22;: &#x22;56&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;48&#x22;, &#x22;target&#x22;: &#x22;58&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;56&#x22;, &#x22;target&#x22;: &#x22;60&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;57&#x22;, &#x22;target&#x22;: &#x22;61&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;58&#x22;, &#x22;target&#x22;: &#x22;62&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;59&#x22;, &#x22;target&#x22;: &#x22;63&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}], &#x22;pauli_web&#x22;: []}'), 625.0, 575.0, 50,
10.0, false, false, '');
</script></body></html>"
  width="100%"
  height="587"
  style={{border: "1px solid #eee", borderRadius: "0.5rem"}}
  title="ZX diagram 1"
  loading="lazy"
/>

To sample detection events and logical observables, we can compile a detector sampler, similar to `stim`.

```python theme={null}
det_sampler = c.compile_detector_sampler(seed=1)
```

```python theme={null}
det_samples, obs_samples = det_sampler.sample(shots=100_000, separate_observables=True)
print(det_samples[:5])
print(obs_samples[:5])
```

```text title="Output" theme={null}
[[False False False]
 [False False False]
 [False False False]
 [False False False]
 [False False False]]
[[False]
 [False]
 [False]
 [ True]
 [False]]
```

Since the circuit is just a logical encoding of the 1-qubit circuit from the beginning of the tutorial, the logical observable should behave exactly like the physical qubit in the first example, i.e., the observable should be 1 with probability $\sin(\pi/8)^2 \approx 0.1464$.

Additionally, since the circuit is noiseless, we should not observe any non-zero detection events:

```python theme={null}
assert np.count_nonzero(det_samples) == 0
int(np.count_nonzero(obs_samples)) / len(obs_samples)
```

```text title="Output" theme={null}
0.14618
```

## Adding Noise

A core capability of tsim is its support for Pauli noise channels.

Let's look at a simple example. We'll insert a depolarizing channel `DEPOLARIZE1(0.01)` before the final stabilizer measurements.

```python theme={null}
def make_circuit(p):
    return Circuit(f"""
        RX 6
        T 6
        H 6
        R 0 1 2 3 4 5
        TICK
        SQRT_Y_DAG 0 1 2 3 4 5
        DEPOLARIZE1({p}) 0 1
        TICK
        CZ 1 2 3 4 5 6
        DEPOLARIZE2({p}) 1 2
        TICK
        SQRT_Y 6
        DEPOLARIZE1({p}) 6
        TICK
        CZ 0 3 2 5 4 6
        TICK
        SQRT_Y 2 3 4 5 6
        DEPOLARIZE1({p}) 2 4 6
        TICK
        CZ 0 1 2 3 4 5
        TICK
        DEPOLARIZE1({p}) 0 1 2 3 4 5 6
        SQRT_Y 1 2 4
        X 3
        TICK
        M 0 1 2 3 4 5 6
        DETECTOR rec[-7] rec[-6] rec[-5] rec[-4]
        DETECTOR rec[-6] rec[-5] rec[-3] rec[-2]
        DETECTOR rec[-5] rec[-4] rec[-3] rec[-1]
        OBSERVABLE_INCLUDE(0) rec[-7] rec[-6] rec[-2]
        """)


c = make_circuit(0.01)
```

```python theme={null}
c.diagram("timeline-svg", height=350)
```

<iframe
  srcDoc="<!doctype html><html><head><meta charset=&#x22;utf-8&#x22;><style>html,body{margin:0;padding:0;height:100%;overflow:hidden;}</style></head><body><div data-tsim-zoom=&#x22;tsim-zoom-003&#x22; style=&#x22;width:100%; height:100%; box-sizing:border-box; font-size:0; line-height:0; overflow:auto; background:white; border:none; position:relative;&#x22;>
<div style=&#x22;display:inline-block; overflow:hidden; width:1255.8823529411766px; height:350.0px;&#x22;>
<div style=&#x22;transform-origin:0 0; display:block; width:1952.0px; height:544.0px; transform:scale(0.6433823529411765);&#x22;>
<svg width=&#x22;1952.0&#x22; height=&#x22;544.0&#x22; xmlns=&#x22;http://www.w3.org/2000/svg&#x22; viewBox=&#x22;0 0 1952 544&#x22; version=&#x22;1.1&#x22;>
<g id=&#x22;qubit_lines&#x22;>
<path id=&#x22;qubit_line:0&#x22; d=&#x22;M64,64 L1920,64 &#x22; stroke=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;end&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;64&#x22; y=&#x22;64&#x22;>q0</text>
<path id=&#x22;qubit_line:1&#x22; d=&#x22;M64,128 L1920,128 &#x22; stroke=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;end&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;64&#x22; y=&#x22;128&#x22;>q1</text>
<path id=&#x22;qubit_line:2&#x22; d=&#x22;M64,192 L1920,192 &#x22; stroke=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;end&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;64&#x22; y=&#x22;192&#x22;>q2</text>
<path id=&#x22;qubit_line:3&#x22; d=&#x22;M64,256 L1920,256 &#x22; stroke=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;end&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;64&#x22; y=&#x22;256&#x22;>q3</text>
<path id=&#x22;qubit_line:4&#x22; d=&#x22;M64,320 L1920,320 &#x22; stroke=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;end&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;64&#x22; y=&#x22;320&#x22;>q4</text>
<path id=&#x22;qubit_line:5&#x22; d=&#x22;M64,384 L1920,384 &#x22; stroke=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;end&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;64&#x22; y=&#x22;384&#x22;>q5</text>
<path id=&#x22;qubit_line:6&#x22; d=&#x22;M64,448 L1920,448 &#x22; stroke=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;end&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;64&#x22; y=&#x22;448&#x22;>q6</text>
</g>
<rect x=&#x22;80&#x22; y=&#x22;432&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;26&#x22; x=&#x22;96&#x22; y=&#x22;448&#x22; fill=&#x22;white&#x22;>R<tspan baseline-shift=&#x22;sub&#x22; font-size=&#x22;16&#x22;>X</tspan></text>
<rect x=&#x22;144&#x22; y=&#x22;432&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;160&#x22; y=&#x22;448&#x22;>T</text><rect x=&#x22;208&#x22; y=&#x22;432&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;224&#x22; y=&#x22;448&#x22;>H</text>
<rect x=&#x22;208&#x22; y=&#x22;48&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;224&#x22; y=&#x22;64&#x22; fill=&#x22;white&#x22;>R</text>
<rect x=&#x22;208&#x22; y=&#x22;112&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;224&#x22; y=&#x22;128&#x22; fill=&#x22;white&#x22;>R</text>
<rect x=&#x22;208&#x22; y=&#x22;176&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;224&#x22; y=&#x22;192&#x22; fill=&#x22;white&#x22;>R</text>
<rect x=&#x22;208&#x22; y=&#x22;240&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;224&#x22; y=&#x22;256&#x22; fill=&#x22;white&#x22;>R</text>
<rect x=&#x22;208&#x22; y=&#x22;304&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;224&#x22; y=&#x22;320&#x22; fill=&#x22;white&#x22;>R</text>
<rect x=&#x22;208&#x22; y=&#x22;368&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;224&#x22; y=&#x22;384&#x22; fill=&#x22;white&#x22;>R</text>
<path d=&#x22;M68,40 L68,32 L252,32 L252,40 &#x22; stroke=&#x22;black&#x22; fill=&#x22;none&#x22;/>
<path d=&#x22;M68,504 L68,512 L252,512 L252,504 &#x22; stroke=&#x22;black&#x22; fill=&#x22;none&#x22;/>
<rect x=&#x22;272&#x22; y=&#x22;48&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;18&#x22; x=&#x22;288&#x22; y=&#x22;64&#x22;>√Y<tspan baseline-shift=&#x22;super&#x22; font-size=&#x22;14&#x22;>†</tspan></text>
<rect x=&#x22;272&#x22; y=&#x22;112&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;18&#x22; x=&#x22;288&#x22; y=&#x22;128&#x22;>√Y<tspan baseline-shift=&#x22;super&#x22; font-size=&#x22;14&#x22;>†</tspan></text>
<rect x=&#x22;272&#x22; y=&#x22;176&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;18&#x22; x=&#x22;288&#x22; y=&#x22;192&#x22;>√Y<tspan baseline-shift=&#x22;super&#x22; font-size=&#x22;14&#x22;>†</tspan></text>
<rect x=&#x22;272&#x22; y=&#x22;240&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;18&#x22; x=&#x22;288&#x22; y=&#x22;256&#x22;>√Y<tspan baseline-shift=&#x22;super&#x22; font-size=&#x22;14&#x22;>†</tspan></text>
<rect x=&#x22;272&#x22; y=&#x22;304&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;18&#x22; x=&#x22;288&#x22; y=&#x22;320&#x22;>√Y<tspan baseline-shift=&#x22;super&#x22; font-size=&#x22;14&#x22;>†</tspan></text>
<rect x=&#x22;272&#x22; y=&#x22;368&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;18&#x22; x=&#x22;288&#x22; y=&#x22;384&#x22;>√Y<tspan baseline-shift=&#x22;super&#x22; font-size=&#x22;14&#x22;>†</tspan></text>
<rect x=&#x22;336&#x22; y=&#x22;48&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;pink&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;352&#x22; y=&#x22;64&#x22;>DEP<tspan baseline-shift=&#x22;sub&#x22; font-size=&#x22;10&#x22;>1</tspan></text>
<text dominant-baseline=&#x22;hanging&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;10&#x22; stroke=&#x22;red&#x22; x=&#x22;352&#x22; y=&#x22;84&#x22;>0.01</text>
<rect x=&#x22;336&#x22; y=&#x22;112&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;pink&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;352&#x22; y=&#x22;128&#x22;>DEP<tspan baseline-shift=&#x22;sub&#x22; font-size=&#x22;10&#x22;>1</tspan></text>
<text dominant-baseline=&#x22;hanging&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;10&#x22; stroke=&#x22;red&#x22; x=&#x22;352&#x22; y=&#x22;148&#x22;>0.01</text>
<path d=&#x22;M260,40 L260,32 L380,32 L380,40 &#x22; stroke=&#x22;black&#x22; fill=&#x22;none&#x22;/>
<path d=&#x22;M260,504 L260,512 L380,512 L380,504 &#x22; stroke=&#x22;black&#x22; fill=&#x22;none&#x22;/>
<path d=&#x22;M416,128 L416,192 &#x22; stroke=&#x22;black&#x22;/>
<circle cx=&#x22;416&#x22; cy=&#x22;128&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<circle cx=&#x22;416&#x22; cy=&#x22;192&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<path d=&#x22;M416,256 L416,320 &#x22; stroke=&#x22;black&#x22;/>
<circle cx=&#x22;416&#x22; cy=&#x22;256&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<circle cx=&#x22;416&#x22; cy=&#x22;320&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<path d=&#x22;M416,384 L416,448 &#x22; stroke=&#x22;black&#x22;/>
<circle cx=&#x22;416&#x22; cy=&#x22;384&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<circle cx=&#x22;416&#x22; cy=&#x22;448&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<path d=&#x22;M480,128 L480,192 &#x22; stroke=&#x22;black&#x22;/>
<rect x=&#x22;464&#x22; y=&#x22;112&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;pink&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;480&#x22; y=&#x22;128&#x22;>DEP<tspan baseline-shift=&#x22;sub&#x22; font-size=&#x22;10&#x22;>2</tspan></text>
<rect x=&#x22;464&#x22; y=&#x22;176&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;pink&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;480&#x22; y=&#x22;192&#x22;>DEP<tspan baseline-shift=&#x22;sub&#x22; font-size=&#x22;10&#x22;>2</tspan></text>
<text dominant-baseline=&#x22;hanging&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;10&#x22; stroke=&#x22;red&#x22; x=&#x22;480&#x22; y=&#x22;212&#x22;>0.01</text>
<path d=&#x22;M388,40 L388,32 L508,32 L508,40 &#x22; stroke=&#x22;black&#x22; fill=&#x22;none&#x22;/>
<path d=&#x22;M388,504 L388,512 L508,512 L508,504 &#x22; stroke=&#x22;black&#x22; fill=&#x22;none&#x22;/>
<rect x=&#x22;528&#x22; y=&#x22;432&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;24&#x22; x=&#x22;544&#x22; y=&#x22;448&#x22;>√Y</text>
<rect x=&#x22;592&#x22; y=&#x22;432&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;pink&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;608&#x22; y=&#x22;448&#x22;>DEP<tspan baseline-shift=&#x22;sub&#x22; font-size=&#x22;10&#x22;>1</tspan></text>
<text dominant-baseline=&#x22;hanging&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;10&#x22; stroke=&#x22;red&#x22; x=&#x22;608&#x22; y=&#x22;468&#x22;>0.01</text>
<path d=&#x22;M516,40 L516,32 L636,32 L636,40 &#x22; stroke=&#x22;black&#x22; fill=&#x22;none&#x22;/>
<path d=&#x22;M516,504 L516,512 L636,512 L636,504 &#x22; stroke=&#x22;black&#x22; fill=&#x22;none&#x22;/>
<path d=&#x22;M672,64 L672,256 &#x22; stroke=&#x22;black&#x22;/>
<circle cx=&#x22;672&#x22; cy=&#x22;64&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<circle cx=&#x22;672&#x22; cy=&#x22;256&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<path d=&#x22;M736,192 L736,384 &#x22; stroke=&#x22;black&#x22;/>
<circle cx=&#x22;736&#x22; cy=&#x22;192&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<circle cx=&#x22;736&#x22; cy=&#x22;384&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<path d=&#x22;M800,320 L800,448 &#x22; stroke=&#x22;black&#x22;/>
<circle cx=&#x22;800&#x22; cy=&#x22;320&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<circle cx=&#x22;800&#x22; cy=&#x22;448&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<path d=&#x22;M644,40 L644,32 L828,32 L828,40 &#x22; stroke=&#x22;black&#x22; fill=&#x22;none&#x22;/>
<path d=&#x22;M644,504 L644,512 L828,512 L828,504 &#x22; stroke=&#x22;black&#x22; fill=&#x22;none&#x22;/>
<rect x=&#x22;848&#x22; y=&#x22;176&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;24&#x22; x=&#x22;864&#x22; y=&#x22;192&#x22;>√Y</text>
<rect x=&#x22;848&#x22; y=&#x22;240&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;24&#x22; x=&#x22;864&#x22; y=&#x22;256&#x22;>√Y</text>
<rect x=&#x22;848&#x22; y=&#x22;304&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;24&#x22; x=&#x22;864&#x22; y=&#x22;320&#x22;>√Y</text>
<rect x=&#x22;848&#x22; y=&#x22;368&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;24&#x22; x=&#x22;864&#x22; y=&#x22;384&#x22;>√Y</text>
<rect x=&#x22;848&#x22; y=&#x22;432&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;24&#x22; x=&#x22;864&#x22; y=&#x22;448&#x22;>√Y</text>
<rect x=&#x22;912&#x22; y=&#x22;176&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;pink&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;928&#x22; y=&#x22;192&#x22;>DEP<tspan baseline-shift=&#x22;sub&#x22; font-size=&#x22;10&#x22;>1</tspan></text>
<text dominant-baseline=&#x22;hanging&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;10&#x22; stroke=&#x22;red&#x22; x=&#x22;928&#x22; y=&#x22;212&#x22;>0.01</text>
<rect x=&#x22;912&#x22; y=&#x22;304&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;pink&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;928&#x22; y=&#x22;320&#x22;>DEP<tspan baseline-shift=&#x22;sub&#x22; font-size=&#x22;10&#x22;>1</tspan></text>
<text dominant-baseline=&#x22;hanging&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;10&#x22; stroke=&#x22;red&#x22; x=&#x22;928&#x22; y=&#x22;340&#x22;>0.01</text>
<rect x=&#x22;912&#x22; y=&#x22;432&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;pink&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;928&#x22; y=&#x22;448&#x22;>DEP<tspan baseline-shift=&#x22;sub&#x22; font-size=&#x22;10&#x22;>1</tspan></text>
<text dominant-baseline=&#x22;hanging&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;10&#x22; stroke=&#x22;red&#x22; x=&#x22;928&#x22; y=&#x22;468&#x22;>0.01</text>
<path d=&#x22;M836,40 L836,32 L956,32 L956,40 &#x22; stroke=&#x22;black&#x22; fill=&#x22;none&#x22;/>
<path d=&#x22;M836,504 L836,512 L956,512 L956,504 &#x22; stroke=&#x22;black&#x22; fill=&#x22;none&#x22;/>
<path d=&#x22;M992,64 L992,128 &#x22; stroke=&#x22;black&#x22;/>
<circle cx=&#x22;992&#x22; cy=&#x22;64&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<circle cx=&#x22;992&#x22; cy=&#x22;128&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<path d=&#x22;M992,192 L992,256 &#x22; stroke=&#x22;black&#x22;/>
<circle cx=&#x22;992&#x22; cy=&#x22;192&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<circle cx=&#x22;992&#x22; cy=&#x22;256&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<path d=&#x22;M992,320 L992,384 &#x22; stroke=&#x22;black&#x22;/>
<circle cx=&#x22;992&#x22; cy=&#x22;320&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<circle cx=&#x22;992&#x22; cy=&#x22;384&#x22; r=&#x22;12&#x22; stroke=&#x22;none&#x22; fill=&#x22;black&#x22;/>
<rect x=&#x22;1040&#x22; y=&#x22;48&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;pink&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;1056&#x22; y=&#x22;64&#x22;>DEP<tspan baseline-shift=&#x22;sub&#x22; font-size=&#x22;10&#x22;>1</tspan></text>
<text dominant-baseline=&#x22;hanging&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;10&#x22; stroke=&#x22;red&#x22; x=&#x22;1056&#x22; y=&#x22;84&#x22;>0.01</text>
<rect x=&#x22;1040&#x22; y=&#x22;112&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;pink&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;1056&#x22; y=&#x22;128&#x22;>DEP<tspan baseline-shift=&#x22;sub&#x22; font-size=&#x22;10&#x22;>1</tspan></text>
<text dominant-baseline=&#x22;hanging&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;10&#x22; stroke=&#x22;red&#x22; x=&#x22;1056&#x22; y=&#x22;148&#x22;>0.01</text>
<rect x=&#x22;1040&#x22; y=&#x22;176&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;pink&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;1056&#x22; y=&#x22;192&#x22;>DEP<tspan baseline-shift=&#x22;sub&#x22; font-size=&#x22;10&#x22;>1</tspan></text>
<text dominant-baseline=&#x22;hanging&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;10&#x22; stroke=&#x22;red&#x22; x=&#x22;1056&#x22; y=&#x22;212&#x22;>0.01</text>
<rect x=&#x22;1040&#x22; y=&#x22;240&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;pink&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;1056&#x22; y=&#x22;256&#x22;>DEP<tspan baseline-shift=&#x22;sub&#x22; font-size=&#x22;10&#x22;>1</tspan></text>
<text dominant-baseline=&#x22;hanging&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;10&#x22; stroke=&#x22;red&#x22; x=&#x22;1056&#x22; y=&#x22;276&#x22;>0.01</text>
<rect x=&#x22;1040&#x22; y=&#x22;304&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;pink&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;1056&#x22; y=&#x22;320&#x22;>DEP<tspan baseline-shift=&#x22;sub&#x22; font-size=&#x22;10&#x22;>1</tspan></text>
<text dominant-baseline=&#x22;hanging&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;10&#x22; stroke=&#x22;red&#x22; x=&#x22;1056&#x22; y=&#x22;340&#x22;>0.01</text>
<rect x=&#x22;1040&#x22; y=&#x22;368&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;pink&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;1056&#x22; y=&#x22;384&#x22;>DEP<tspan baseline-shift=&#x22;sub&#x22; font-size=&#x22;10&#x22;>1</tspan></text>
<text dominant-baseline=&#x22;hanging&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;10&#x22; stroke=&#x22;red&#x22; x=&#x22;1056&#x22; y=&#x22;404&#x22;>0.01</text>
<rect x=&#x22;1040&#x22; y=&#x22;432&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;pink&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;12&#x22; x=&#x22;1056&#x22; y=&#x22;448&#x22;>DEP<tspan baseline-shift=&#x22;sub&#x22; font-size=&#x22;10&#x22;>1</tspan></text>
<text dominant-baseline=&#x22;hanging&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;10&#x22; stroke=&#x22;red&#x22; x=&#x22;1056&#x22; y=&#x22;468&#x22;>0.01</text>
<rect x=&#x22;1104&#x22; y=&#x22;112&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;24&#x22; x=&#x22;1120&#x22; y=&#x22;128&#x22;>√Y</text>
<rect x=&#x22;1104&#x22; y=&#x22;176&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;24&#x22; x=&#x22;1120&#x22; y=&#x22;192&#x22;>√Y</text>
<rect x=&#x22;1104&#x22; y=&#x22;304&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;24&#x22; x=&#x22;1120&#x22; y=&#x22;320&#x22;>√Y</text>
<rect x=&#x22;1104&#x22; y=&#x22;240&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;white&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;1120&#x22; y=&#x22;256&#x22;>X</text>
<path d=&#x22;M1028,40 L1028,32 L1148,32 L1148,40 &#x22; stroke=&#x22;black&#x22; fill=&#x22;none&#x22;/>
<path d=&#x22;M1028,504 L1028,512 L1148,512 L1148,504 &#x22; stroke=&#x22;black&#x22; fill=&#x22;none&#x22;/>
<rect x=&#x22;1168&#x22; y=&#x22;48&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;1184&#x22; y=&#x22;64&#x22; fill=&#x22;white&#x22;>M</text>
<text text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;8&#x22; x=&#x22;1184&#x22; y=&#x22;44&#x22;>rec[0]</text>
<rect x=&#x22;1168&#x22; y=&#x22;112&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;1184&#x22; y=&#x22;128&#x22; fill=&#x22;white&#x22;>M</text>
<text text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;8&#x22; x=&#x22;1184&#x22; y=&#x22;108&#x22;>rec[1]</text>
<rect x=&#x22;1168&#x22; y=&#x22;176&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;1184&#x22; y=&#x22;192&#x22; fill=&#x22;white&#x22;>M</text>
<text text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;8&#x22; x=&#x22;1184&#x22; y=&#x22;172&#x22;>rec[2]</text>
<rect x=&#x22;1168&#x22; y=&#x22;240&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;1184&#x22; y=&#x22;256&#x22; fill=&#x22;white&#x22;>M</text>
<text text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;8&#x22; x=&#x22;1184&#x22; y=&#x22;236&#x22;>rec[3]</text>
<rect x=&#x22;1168&#x22; y=&#x22;304&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;1184&#x22; y=&#x22;320&#x22; fill=&#x22;white&#x22;>M</text>
<text text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;8&#x22; x=&#x22;1184&#x22; y=&#x22;300&#x22;>rec[4]</text>
<rect x=&#x22;1168&#x22; y=&#x22;368&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;1184&#x22; y=&#x22;384&#x22; fill=&#x22;white&#x22;>M</text>
<text text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;8&#x22; x=&#x22;1184&#x22; y=&#x22;364&#x22;>rec[5]</text>
<rect x=&#x22;1168&#x22; y=&#x22;432&#x22; width=&#x22;32&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;black&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;30&#x22; x=&#x22;1184&#x22; y=&#x22;448&#x22; fill=&#x22;white&#x22;>M</text>
<text text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;8&#x22; x=&#x22;1184&#x22; y=&#x22;428&#x22;>rec[6]</text>
<rect x=&#x22;1232&#x22; y=&#x22;48&#x22; width=&#x22;352&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;lightgray&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;16&#x22; x=&#x22;1408&#x22; y=&#x22;64&#x22;>DETECTOR</text>
<text text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;8&#x22; x=&#x22;1408&#x22; y=&#x22;44&#x22;>D0 = rec[0]*rec[1]*rec[2]*rec[3]</text>
<rect x=&#x22;1232&#x22; y=&#x22;112&#x22; width=&#x22;352&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;lightgray&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;16&#x22; x=&#x22;1408&#x22; y=&#x22;128&#x22;>DETECTOR</text>
<text text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;8&#x22; x=&#x22;1408&#x22; y=&#x22;108&#x22;>D1 = rec[1]*rec[2]*rec[4]*rec[5]</text>
<rect x=&#x22;1232&#x22; y=&#x22;176&#x22; width=&#x22;352&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;lightgray&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;16&#x22; x=&#x22;1408&#x22; y=&#x22;192&#x22;>DETECTOR</text>
<text text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;8&#x22; x=&#x22;1408&#x22; y=&#x22;172&#x22;>D2 = rec[2]*rec[3]*rec[4]*rec[6]</text>
<rect x=&#x22;1616&#x22; y=&#x22;48&#x22; width=&#x22;288&#x22; height=&#x22;32&#x22; stroke=&#x22;black&#x22; fill=&#x22;lightgray&#x22;/>
<text dominant-baseline=&#x22;central&#x22; text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;16&#x22; x=&#x22;1760&#x22; y=&#x22;64&#x22;>OBS_INCLUDE(0)</text>
<text text-anchor=&#x22;middle&#x22; font-family=&#x22;monospace&#x22; font-size=&#x22;8&#x22; x=&#x22;1760&#x22; y=&#x22;44&#x22;>L0 *= rec[0]*rec[1]*rec[5]</text>
<path d=&#x22;M1156,40 L1156,32 L1916,32 L1916,40 &#x22; stroke=&#x22;black&#x22; fill=&#x22;none&#x22;/>
<path d=&#x22;M1156,504 L1156,512 L1916,512 L1916,504 &#x22; stroke=&#x22;black&#x22; fill=&#x22;none&#x22;/>
</svg>
</div>
</div>
</div>
<script>
(function() {
var wrap = document.querySelector('[data-tsim-zoom=&#x22;tsim-zoom-003&#x22;]');
if (!wrap || wrap.dataset.tsimZoomInit) return;
wrap.dataset.tsimZoomInit = &#x22;1&#x22;;
var size = wrap.firstElementChild;
var xform = size.firstElementChild;
var natW = 1952.0;
var natH = 544.0;
var scale = 0.6433823529411765;
var cw = wrap.clientWidth;
if (cw > 0 && natW > 0) {
/* keep height-fit initial scale */
}
function apply() {
xform.style.transform = 'scale(' + scale + ')';
size.style.width = (natW * scale) + 'px';
size.style.height = (natH * scale) + 'px';
}
apply();
wrap.addEventListener('wheel', function(e) {
if (e.ctrlKey || e.metaKey) {
e.preventDefault();
var rect = wrap.getBoundingClientRect();
var mx = e.clientX - rect.left + wrap.scrollLeft;
var my = e.clientY - rect.top + wrap.scrollTop;
var factor = Math.exp(-e.deltaY * 0.01);
var newScale = Math.min(Math.max(0.02, scale * factor), 40);
var ratio = newScale / scale;
scale = newScale;
apply();
wrap.scrollLeft = mx * ratio - (e.clientX - rect.left);
wrap.scrollTop = my * ratio - (e.clientY - rect.top);
}
}, { passive: false });
})();
</script></body></html>"
  width="100%"
  height="354"
  style={{border: "1px solid #eee", borderRadius: "0.5rem"}}
  title="Circuit diagram 3"
  loading="lazy"
/>

In the ZX diagram, the noise is represented by parametrized vertices with binary parameters `e0`, `e1`, etc. Since a depolarizing channel either applies X, Y, Z gates, each channel requires two bits, i.e. an X and a Z vertex.

```python theme={null}
c.diagram("pyzx");
```

<iframe
  srcDoc="<!doctype html><html><head><meta charset=&#x22;utf-8&#x22;><style>html,body{margin:0;padding:0;height:100%;overflow:hidden;}[id^=&#x22;graph-output-&#x22;]{width:100%;height:100%;overflow:auto;box-sizing:border-box;}</style></head><body><div style=&#x22;overflow:auto; background-color: white&#x22; id=&#x22;graph-output-002&#x22;></div><script type=&#x22;module&#x22;>
var d3;
if (d3 == null) { d3 = await import(&#x22;https://esm.sh/d3@5&#x22;); }
var _settings_colors = JSON.parse('{&#x22;edge&#x22;: &#x22;#000000&#x22;, &#x22;Hedge&#x22;: &#x22;#0088ff&#x22;, &#x22;Xedge&#x22;: &#x22;#999999&#x22;, &#x22;Bedge&#x22;: &#x22;#000000&#x22;, &#x22;HBedge&#x22;: &#x22;#0088ff&#x22;, &#x22;boundary&#x22;: &#x22;#000000&#x22;, &#x22;X&#x22;: &#x22;#ff8888&#x22;, &#x22;Y&#x22;: &#x22;#aabbff&#x22;, &#x22;Z&#x22;: &#x22;#ccffcc&#x22;, &#x22;H&#x22;: &#x22;#ffff66&#x22;, &#x22;W&#x22;: &#x22;#000000&#x22;, &#x22;Zalt&#x22;: &#x22;#ccffcc&#x22;, &#x22;Walt&#x22;: &#x22;#000000&#x22;, &#x22;Zbold&#x22;: &#x22;#ccffcc&#x22;, &#x22;Xbold&#x22;: &#x22;#ff8888&#x22;, &#x22;Xdark&#x22;: &#x22;#ff8888&#x22;, &#x22;Ydark&#x22;: &#x22;#aabbff&#x22;, &#x22;Zdark&#x22;: &#x22;#99dd99&#x22;}');
// PyZX - Python library for quantum circuit rewriting 
//        and optimisation using the ZX-calculus
// Copyright (C) 2018 - Aleks Kissinger and John van de Wetering

// Licensed under the Apache License, Version 2.0 (the &#x22;License&#x22;);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

//    http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an &#x22;AS IS&#x22; BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// styling functions
function nodeColor(t) {
if (t == 0) return _settings_colors['boundary'];
else if (t == 1) return _settings_colors['Z']; // &#x22;#ccffcc&#x22;;
else if (t == 2) return _settings_colors['X']; // &#x22;#ff8888&#x22;;
else if (t == 3) return _settings_colors['H']; // &#x22;yellow&#x22;;
else if (t == 4) return _settings_colors['W']; // &#x22;black&#x22;;
else if (t == 5) return _settings_colors['Walt']; // &#x22;black&#x22;;
else if (t == 6) return _settings_colors['Zalt']; // &#x22;#ccffcc&#x22;;
else if (t == 7) return _settings_colors['Zbold']; // &#x22;#ccffcc&#x22; bold Z
else if (t == 8) return _settings_colors['Xbold']; // &#x22;#ff8888&#x22; bold X
}

function edgeColor(t) {
if (t == 1) return _settings_colors['edge']; //&#x22;black&#x22;;
else if (t == 2) return _settings_colors['Hedge']; // &#x22;#08f&#x22;;
else if (t == 3) return _settings_colors['Xedge']; // &#x22;gray&#x22;;
else if (t == 4) return _settings_colors['Bedge']; // &#x22;black&#x22; bold
else if (t == 5) return _settings_colors['HBedge']; // &#x22;#0088ff&#x22; bold hadamard
}

function isBoldEdge(t) {
return t == 4 || t == 5;
}

function webColor(t) {
if (t == 'X') return _settings_colors['Xdark'];
else if (t == 'Y') return _settings_colors['Ydark'];
else if (t == 'Z') return _settings_colors['Zdark'];
else if (t == 'I') return '#dddddd';
}

function nodeStyle(selected, t) {
var bold = (t == 7 || t == 8);
if (selected) return &#x22;stroke-width: &#x22; + (bold ? &#x22;4&#x22; : &#x22;2&#x22;) + &#x22;px; stroke: #00f&#x22;;
return &#x22;stroke-width: &#x22; + (bold ? &#x22;3&#x22; : &#x22;1.5&#x22;) + &#x22;px&#x22;;
}

var symbolGround = {
draw: function(context, size){
let s = size/2;

context.moveTo(0,-s);
context.lineTo(0,0);

context.moveTo(-s,0);
context.lineTo(s,0);

context.moveTo(-2*s/3,s/3);
context.lineTo(2*s/3,s/3);

context.moveTo(-s/3,2*s/3);
context.lineTo(s/3,2*s/3);
}
}

function showGraph(tag, graph, width, height, scale, node_size, auto_hbox, show_labels, scalar_str) {
var ntab = {};

var groundOffset = 2.5 * node_size;

graph.nodes.forEach(function(d) {
ntab[d.name] = d;
d.selected = false;
d.previouslySelected = false;
d.nhd = [];
});

var spiders_and_boundaries = graph.nodes.filter(function(d) {
return d.t != 3;
});

graph.links.forEach(function(d) {
var s = ntab[d.source];
var t = ntab[d.target];
d.source = s;
d.target = t;
s.nhd.push(t);
t.nhd.push(s);
});

graph.pauli_web.forEach(function(d) {
var s = ntab[d.source];
var t = ntab[d.target];
d.source = s;
d.target = t;
});

var shiftKey;

// SETUP SVG ITEMS

var svg = d3.select(tag)
//.attr(&#x22;tabindex&#x22;, 1)
.on(&#x22;keydown.brush&#x22;, function() {shiftKey = d3.event.shiftKey || d3.event.metaKey;})
.on(&#x22;keyup.brush&#x22;, function() {shiftKey = d3.event.shiftKey || d3.event.metaKey;})
//.each(function() { this.focus(); })
.append(&#x22;svg&#x22;)
.attr(&#x22;style&#x22;, &#x22;max-width: none; max-height: none&#x22;)
.attr(&#x22;width&#x22;, width)
.attr(&#x22;height&#x22;, height);

var web = svg.append(&#x22;g&#x22;)
.attr(&#x22;class&#x22;, &#x22;web&#x22;)
.selectAll(&#x22;line&#x22;)
.data(graph.pauli_web)
.enter().append(&#x22;path&#x22;)
.attr(&#x22;stroke&#x22;, function(d) { return webColor(d.t); })
.attr(&#x22;fill&#x22;, &#x22;transparent&#x22;)
.attr(&#x22;style&#x22;, &#x22;stroke-width: 7px&#x22;);

var link = svg.append(&#x22;g&#x22;)
.attr(&#x22;class&#x22;, &#x22;link&#x22;)
.selectAll(&#x22;line&#x22;)
.data(graph.links)
.enter().append(&#x22;path&#x22;)
.attr(&#x22;stroke&#x22;, function(d) { return edgeColor(d.t); })
.attr(&#x22;fill&#x22;, &#x22;transparent&#x22;)
.attr(&#x22;style&#x22;, function(d) { return isBoldEdge(d.t) ? &#x22;stroke-width: 3.5px&#x22; : &#x22;stroke-width: 1.5px&#x22;; });

var brush = svg.append(&#x22;g&#x22;)
.attr(&#x22;class&#x22;, &#x22;brush&#x22;);

var node = svg.append(&#x22;g&#x22;)
.attr(&#x22;class&#x22;, &#x22;node&#x22;)
.selectAll(&#x22;g&#x22;)
.data(graph.nodes)
.enter().append(&#x22;g&#x22;)
.attr(&#x22;transform&#x22;, function(d) {
return &#x22;translate(&#x22; + d.x + &#x22;,&#x22; + d.y +&#x22;)&#x22;;
});

// Draw a ground symbol connected to the node.
node.filter(function(d) { return d.ground; })
.append(&#x22;path&#x22;)
.attr(&#x22;stroke&#x22;, &#x22;black&#x22;)
.attr(&#x22;style&#x22;, &#x22;stroke-width: 1.5px&#x22;)
.attr(&#x22;fill&#x22;, &#x22;none&#x22;)
.attr(&#x22;d&#x22;, &#x22;M 0 0 L 0 &#x22;+(groundOffset))
.attr(&#x22;class&#x22;, &#x22;selectable&#x22;);
node.filter(function(d) { return d.ground; })
.append(&#x22;path&#x22;)
.attr(&#x22;stroke&#x22;, &#x22;black&#x22;)
.attr(&#x22;style&#x22;, &#x22;stroke-width: 1.5px&#x22;)
.attr(&#x22;fill&#x22;, &#x22;none&#x22;)
.attr(&#x22;d&#x22;, d3.symbol().type(symbolGround).size(node_size*1.5))
.attr(&#x22;transform&#x22;, &#x22;translate(0,&#x22;+groundOffset+&#x22;)&#x22;)
.attr(&#x22;class&#x22;, &#x22;selectable&#x22;);

node.filter(function(d) { return d.t != 3 && d.t != 5 && d.t != 6; })
.append(&#x22;circle&#x22;)
.attr(&#x22;r&#x22;, function(d) {
if (d.t == 0) return 0.5 * node_size;
else if (d.t == 4) return 0.25 * node_size;
else return node_size;
})
.attr(&#x22;fill&#x22;, function(d) { return nodeColor(d.t); })
.attr(&#x22;stroke&#x22;, &#x22;black&#x22;)
.attr(&#x22;stroke-width&#x22;, function(d) { return (d.t == 7 || d.t == 8) ? 3 : 1.5; })
.attr(&#x22;class&#x22;, &#x22;selectable&#x22;);

var hbox = node.filter(function(d) { return d.t == 3; });

hbox.append(&#x22;rect&#x22;)
.attr(&#x22;x&#x22;, -0.75 * node_size).attr(&#x22;y&#x22;, -0.75 * node_size)
.attr(&#x22;width&#x22;, node_size * 1.5).attr(&#x22;height&#x22;, node_size * 1.5)
.attr(&#x22;fill&#x22;, function(d) { return nodeColor(d.t); })
.attr(&#x22;stroke&#x22;, &#x22;black&#x22;)
.attr(&#x22;class&#x22;, &#x22;selectable&#x22;);

// draw a triangle for d.t == 5
node.filter(function(d) { return d.t == 5; })
.append(&#x22;path&#x22;)
.attr(&#x22;d&#x22;, &#x22;M 0 0 L &#x22;+node_size+&#x22; &#x22;+node_size+&#x22; L -&#x22;+node_size+&#x22; &#x22;+node_size+&#x22; Z&#x22;)
.attr(&#x22;fill&#x22;, function(d) { return nodeColor(d.t); })
.attr(&#x22;stroke&#x22;, &#x22;black&#x22;)
.attr(&#x22;class&#x22;, &#x22;selectable&#x22;)
.attr(&#x22;transform&#x22;, &#x22;translate(&#x22; + (-node_size/2) + &#x22;, 0) rotate(-90)&#x22;);

// draw a square for Z box: d.t == 6
node.filter(function(d) { return d.t == 6; })
.append(&#x22;rect&#x22;)
.attr(&#x22;x&#x22;, -0.75 * node_size).attr(&#x22;y&#x22;, -0.75 * node_size)
.attr(&#x22;width&#x22;, node_size * 1.5).attr(&#x22;height&#x22;, node_size * 1.5)
.attr(&#x22;fill&#x22;, function(d) { return nodeColor(d.t); })
.attr(&#x22;stroke&#x22;, &#x22;black&#x22;)
.attr(&#x22;class&#x22;, &#x22;selectable&#x22;);

node.filter(function(d) { return d.phase != '' && d.phase.indexOf('[') === -1; })
.append(&#x22;text&#x22;)
.attr(&#x22;y&#x22;, 0.7 * node_size + 14)
.text(function (d) { return d.phase })
.attr(&#x22;text-anchor&#x22;, &#x22;middle&#x22;)
.attr(&#x22;font-size&#x22;, &#x22;12px&#x22;)
.attr(&#x22;font-family&#x22;, &#x22;monospace&#x22;)
.attr(&#x22;fill&#x22;, &#x22;#00d&#x22;)
.attr('style', 'pointer-events: none; user-select: none;');

node.filter(function(d) { return d.phase != '' && d.phase.indexOf('[') !== -1; })
.append(&#x22;text&#x22;)
.attr(&#x22;y&#x22;, -0.7 * node_size - 8)
.text(function (d) { return d.phase })
.attr(&#x22;text-anchor&#x22;, &#x22;middle&#x22;)
.attr(&#x22;font-size&#x22;, &#x22;12px&#x22;)
.attr(&#x22;font-family&#x22;, &#x22;monospace&#x22;)
.attr(&#x22;fill&#x22;, &#x22;black&#x22;)
.attr('style', 'pointer-events: none; user-select: none;');

if (show_labels) {
node.append(&#x22;text&#x22;)
.attr(&#x22;y&#x22;, -0.7 * node_size - 8)
.text(function (d) { return d.name; })
.attr(&#x22;text-anchor&#x22;, &#x22;middle&#x22;)
.attr(&#x22;font-size&#x22;, &#x22;10px&#x22;)
.attr(&#x22;font-family&#x22;, &#x22;monospace&#x22;)
.attr(&#x22;fill&#x22;, &#x22;#999&#x22;)
.attr('style', 'pointer-events: none; user-select: none;');
}

// Display the chosen data fields over the node.
node.filter(d => d.vdata.length > 0)
.append(&#x22;text&#x22;)
.attr(&#x22;y&#x22;, d => -0.7 * node_size - 14 - 10 * d.vdata.length)
.attr(&#x22;text-anchor&#x22;, &#x22;middle&#x22;)
.attr(&#x22;font-size&#x22;, &#x22;8px&#x22;)
.attr(&#x22;font-family&#x22;, &#x22;monospace&#x22;)
.attr(&#x22;fill&#x22;, &#x22;#c66&#x22;)
.attr('style', 'pointer-events: none; user-select: none;')
.selectAll(&#x22;tspan&#x22;)
.data(d => d.vdata)
.enter()
.append(&#x22;tspan&#x22;)
.attr(&#x22;x&#x22;, &#x22;0&#x22;)
.attr(&#x22;dy&#x22;, &#x22;1.2em&#x22;)
.text(x => x.join(&#x22;: &#x22;));

if (scalar_str != &#x22;&#x22;) {
svg.append(&#x22;text&#x22;)
.text(scalar_str)
.attr(&#x22;x&#x22;, 60).attr(&#x22;y&#x22;, 40)
.attr(&#x22;text-anchor&#x22;, &#x22;middle&#x22;)
}

function update_hboxes() {
if (auto_hbox) {
var pos = {};
hbox.attr(&#x22;transform&#x22;, function(d) {
// calculate barycenter of non-hbox neighbours, then nudge a bit
// to the NE.
var x=0,y=0,sz=0;
for (var i = 0; i < d.nhd.length; ++i) {
if (d.nhd[i].t != 3) {
sz++;
x += d.nhd[i].x;
y += d.nhd[i].y;
}
}

offset = 0.25 * scale;

if (sz != 0) {
x = (x/sz) + offset;
y = (y/sz) - offset;

while (pos[[x,y]]) {
x += offset;
}
d.x = x;
d.y = y;
pos[[x,y]] = true;
}

return &#x22;translate(&#x22;+d.x+&#x22;,&#x22;+d.y+&#x22;)&#x22;;
});
}
}

update_hboxes();

var link_curve = function(d) {
var x1 = d.source.x, x2 = d.target.x, y1 = d.source.y, y2 = d.target.y;
if (x1 == x2 && y1 == y2 && d.num_parallel == 1) {
var cx1 = x1 - 40;
var cy1 = y1 - 40;
var cx2 = x1 + 40;
var cy2 = y1 - 40;
return `M ${x1} ${y1} C ${cx1} ${cy1}, ${cx2} ${cy2}, ${x2} ${y2}`;
} else if (x1 == x2 && y1 == y2) {
var pos = d.index + 1;
var cx1 = x1 - 20 - pos * 10;
var cy1 = y1 - 20 - pos * 10;
var cx2 = x1 + 20 + pos * 10;
var cy2 = y1 - 20 - pos * 10;
return `M ${x1} ${y1} C ${cx1} ${cy1}, ${cx2} ${cy2}, ${x2} ${y2}`;
} else if (d.num_parallel == 1) {
return `M ${x1} ${y1} L ${x2} ${y2}`;
} else {
var dx = x2 - x1, dy = y2 - y1;
var midx = 0.5 * (x1 + x2), midy = 0.5 * (y1 + y2);
var pos = (d.index / (d.num_parallel-1)) - 0.5;
var cx = midx - pos * dy;
var cy = midy + pos * dx;
return `M ${x1} ${y1} Q ${cx} ${cy}, ${x2} ${y2}`;
// return `M ${x1} ${y1} L ${x2} ${y2}`;
}
};
link.attr(&#x22;d&#x22;, link_curve);


var web_curve = function(d) {
var x1 = d.source.x, x2 = (x1 + d.target.x)/2, y1 = d.source.y, y2 = (y1 + d.target.y)/2;
return `M ${x1} ${y1} L ${x2} ${y2}`;
}
web.attr(&#x22;d&#x22;, web_curve);

// EVENTS FOR DRAGGING AND SELECTION

node.on(&#x22;mousedown&#x22;, function(d) {
if (shiftKey) {
d3.select(this).selectAll(&#x22;.selectable&#x22;).attr(&#x22;style&#x22;, nodeStyle(d.selected = !d.selected, d.t));
d3.event.stopImmediatePropagation();
} else if (!d.selected) {
node.selectAll(&#x22;.selectable&#x22;).attr(&#x22;style&#x22;, function(p) { return nodeStyle(p.selected = d === p, p.t); });
}
})
.call(d3.drag().on(&#x22;drag&#x22;, function(d) {
var dx = d3.event.dx;
var dy = d3.event.dy;
// node.filter(function(d) { return d.selected; })
//     .attr(&#x22;cx&#x22;, function(d) { return d.x += dx; })
//     .attr(&#x22;cy&#x22;, function(d) { return d.y += dy; });
node.filter(function(d) { return d.selected; })
.attr(&#x22;transform&#x22;, function(d) {
d.x += dx;
d.y += dy;
return &#x22;translate(&#x22; + d.x + &#x22;,&#x22; + d.y +&#x22;)&#x22;;
});

update_hboxes();

link.filter(function(d) { return d.source.selected || d.target.selected ||
(auto_hbox && d.source.t == 3); })
.attr(&#x22;d&#x22;, link_curve);
web.filter(function(d) { return d.source.selected || d.target.selected; })
.attr(&#x22;d&#x22;, web_curve);
}));

brush.call(d3.brush().keyModifiers(false)
.extent([[0, 0], [width, height]])
.on(&#x22;start&#x22;, function() {
if (d3.event.sourceEvent.type !== &#x22;end&#x22;) {
node.selectAll(&#x22;.selectable&#x22;).attr(&#x22;style&#x22;, function(d) {
return nodeStyle(
d.selected = d.previouslySelected = shiftKey &&
d.selected, d.t);
});
}
})
.on(&#x22;brush&#x22;, function() {
if (d3.event.sourceEvent.type !== &#x22;end&#x22;) {
var selection = d3.event.selection;
node.selectAll(&#x22;.selectable&#x22;).attr(&#x22;style&#x22;, function(d) {
return nodeStyle(d.selected = d.previouslySelected ^
(selection != null
&& selection[0][0] <= d.x && d.x < selection[1][0]
&& selection[0][1] <= d.y && d.y < selection[1][1]), d.t);
});
}
})
.on(&#x22;end&#x22;, function() {
if (d3.event.selection != null) {
d3.select(this).call(d3.event.target.move, null);
}
}));
}


showGraph('#graph-output-002',
JSON.parse('{&#x22;nodes&#x22;: [{&#x22;name&#x22;: &#x22;0&#x22;, &#x22;x&#x22;: 34.04255319148936, &#x22;y&#x22;: 357.4468085106383, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;1&#x22;, &#x22;x&#x22;: 68.08510638297872, &#x22;y&#x22;: 357.4468085106383, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0/4&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;2&#x22;, &#x22;x&#x22;: 204.25531914893617, &#x22;y&#x22;: 357.4468085106383, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;3&#x22;, &#x22;x&#x22;: 34.04255319148936, &#x22;y&#x22;: 153.1914893617021, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;4&#x22;, &#x22;x&#x22;: 102.12765957446808, &#x22;y&#x22;: 153.1914893617021, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;5&#x22;, &#x22;x&#x22;: 34.04255319148936, &#x22;y&#x22;: 187.2340425531915, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;6&#x22;, &#x22;x&#x22;: 102.12765957446808, &#x22;y&#x22;: 187.2340425531915, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;7&#x22;, &#x22;x&#x22;: 34.04255319148936, &#x22;y&#x22;: 221.27659574468083, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;8&#x22;, &#x22;x&#x22;: 102.12765957446808, &#x22;y&#x22;: 221.27659574468083, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;9&#x22;, &#x22;x&#x22;: 34.04255319148936, &#x22;y&#x22;: 255.31914893617022, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;10&#x22;, &#x22;x&#x22;: 102.12765957446808, &#x22;y&#x22;: 255.31914893617022, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;11&#x22;, &#x22;x&#x22;: 34.04255319148936, &#x22;y&#x22;: 289.36170212765956, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;12&#x22;, &#x22;x&#x22;: 102.12765957446808, &#x22;y&#x22;: 289.36170212765956, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;13&#x22;, &#x22;x&#x22;: 34.04255319148936, &#x22;y&#x22;: 323.40425531914894, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;14&#x22;, &#x22;x&#x22;: 102.12765957446808, &#x22;y&#x22;: 323.40425531914894, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;15&#x22;, &#x22;x&#x22;: 136.17021276595744, &#x22;y&#x22;: 153.1914893617021, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;e0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;16&#x22;, &#x22;x&#x22;: 136.17021276595744, &#x22;y&#x22;: 187.2340425531915, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;e2&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;17&#x22;, &#x22;x&#x22;: 204.25531914893617, &#x22;y&#x22;: 221.27659574468083, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;18&#x22;, &#x22;x&#x22;: 204.25531914893617, &#x22;y&#x22;: 255.31914893617022, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;19&#x22;, &#x22;x&#x22;: 204.25531914893617, &#x22;y&#x22;: 289.36170212765956, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;20&#x22;, &#x22;x&#x22;: 204.25531914893617, &#x22;y&#x22;: 323.40425531914894, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;21&#x22;, &#x22;x&#x22;: 170.2127659574468, &#x22;y&#x22;: 153.1914893617021, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;e1&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;22&#x22;, &#x22;x&#x22;: 408.51063829787233, &#x22;y&#x22;: 153.1914893617021, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;23&#x22;, &#x22;x&#x22;: 170.2127659574468, &#x22;y&#x22;: 187.2340425531915, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;e3&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;24&#x22;, &#x22;x&#x22;: 204.25531914893617, &#x22;y&#x22;: 187.2340425531915, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;25&#x22;, &#x22;x&#x22;: 238.29787234042553, &#x22;y&#x22;: 187.2340425531915, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;e4&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;26&#x22;, &#x22;x&#x22;: 238.29787234042553, &#x22;y&#x22;: 221.27659574468083, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;e6&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;27&#x22;, &#x22;x&#x22;: 408.51063829787233, &#x22;y&#x22;: 255.31914893617022, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;28&#x22;, &#x22;x&#x22;: 408.51063829787233, &#x22;y&#x22;: 289.36170212765956, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;29&#x22;, &#x22;x&#x22;: 408.51063829787233, &#x22;y&#x22;: 323.40425531914894, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;30&#x22;, &#x22;x&#x22;: 306.3829787234042, &#x22;y&#x22;: 357.4468085106383, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;31&#x22;, &#x22;x&#x22;: 272.3404255319149, &#x22;y&#x22;: 187.2340425531915, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;e5&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;32&#x22;, &#x22;x&#x22;: 544.6808510638298, &#x22;y&#x22;: 187.2340425531915, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;33&#x22;, &#x22;x&#x22;: 272.3404255319149, &#x22;y&#x22;: 221.27659574468083, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;e7&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;34&#x22;, &#x22;x&#x22;: 408.51063829787233, &#x22;y&#x22;: 221.27659574468083, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;35&#x22;, &#x22;x&#x22;: 340.4255319148936, &#x22;y&#x22;: 357.4468085106383, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;e8&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;36&#x22;, &#x22;x&#x22;: 374.468085106383, &#x22;y&#x22;: 357.4468085106383, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;e9&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;37&#x22;, &#x22;x&#x22;: 408.51063829787233, &#x22;y&#x22;: 357.4468085106383, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;38&#x22;, &#x22;x&#x22;: 544.6808510638298, &#x22;y&#x22;: 153.1914893617021, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;39&#x22;, &#x22;x&#x22;: 442.55319148936167, &#x22;y&#x22;: 255.31914893617022, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;40&#x22;, &#x22;x&#x22;: 442.55319148936167, &#x22;y&#x22;: 221.27659574468083, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;41&#x22;, &#x22;x&#x22;: 442.55319148936167, &#x22;y&#x22;: 323.40425531914894, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;42&#x22;, &#x22;x&#x22;: 442.55319148936167, &#x22;y&#x22;: 289.36170212765956, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;43&#x22;, &#x22;x&#x22;: 442.55319148936167, &#x22;y&#x22;: 357.4468085106383, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;44&#x22;, &#x22;x&#x22;: 476.59574468085106, &#x22;y&#x22;: 221.27659574468083, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;e10&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;45&#x22;, &#x22;x&#x22;: 544.6808510638298, &#x22;y&#x22;: 255.31914893617022, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;46&#x22;, &#x22;x&#x22;: 476.59574468085106, &#x22;y&#x22;: 289.36170212765956, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;e12&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;47&#x22;, &#x22;x&#x22;: 544.6808510638298, &#x22;y&#x22;: 323.40425531914894, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;48&#x22;, &#x22;x&#x22;: 476.59574468085106, &#x22;y&#x22;: 357.4468085106383, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;e14&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;49&#x22;, &#x22;x&#x22;: 510.63829787234044, &#x22;y&#x22;: 221.27659574468083, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;e11&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;50&#x22;, &#x22;x&#x22;: 544.6808510638298, &#x22;y&#x22;: 221.27659574468083, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;51&#x22;, &#x22;x&#x22;: 510.63829787234044, &#x22;y&#x22;: 289.36170212765956, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;e13&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;52&#x22;, &#x22;x&#x22;: 544.6808510638298, &#x22;y&#x22;: 289.36170212765956, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;53&#x22;, &#x22;x&#x22;: 510.63829787234044, &#x22;y&#x22;: 357.4468085106383, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;e15&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;54&#x22;, &#x22;x&#x22;: 578.7234042553191, &#x22;y&#x22;: 357.4468085106383, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;e28&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;55&#x22;, &#x22;x&#x22;: 578.7234042553191, &#x22;y&#x22;: 153.1914893617021, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;e16&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;56&#x22;, &#x22;x&#x22;: 578.7234042553191, &#x22;y&#x22;: 187.2340425531915, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;e18&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;57&#x22;, &#x22;x&#x22;: 578.7234042553191, &#x22;y&#x22;: 221.27659574468083, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;e20&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;58&#x22;, &#x22;x&#x22;: 578.7234042553191, &#x22;y&#x22;: 255.31914893617022, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;e22&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;59&#x22;, &#x22;x&#x22;: 578.7234042553191, &#x22;y&#x22;: 289.36170212765956, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;e24&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;60&#x22;, &#x22;x&#x22;: 578.7234042553191, &#x22;y&#x22;: 323.40425531914894, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;e26&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;61&#x22;, &#x22;x&#x22;: 612.7659574468084, &#x22;y&#x22;: 153.1914893617021, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;e17&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;62&#x22;, &#x22;x&#x22;: 680.8510638297872, &#x22;y&#x22;: 153.1914893617021, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 1, &#x22;phase&#x22;: &#x22;rec[0]&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;63&#x22;, &#x22;x&#x22;: 612.7659574468084, &#x22;y&#x22;: 187.2340425531915, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;e19&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;64&#x22;, &#x22;x&#x22;: 646.8085106382979, &#x22;y&#x22;: 187.2340425531915, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;65&#x22;, &#x22;x&#x22;: 612.7659574468084, &#x22;y&#x22;: 221.27659574468083, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;e21&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;66&#x22;, &#x22;x&#x22;: 646.8085106382979, &#x22;y&#x22;: 221.27659574468083, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;67&#x22;, &#x22;x&#x22;: 612.7659574468084, &#x22;y&#x22;: 255.31914893617022, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;e23&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;68&#x22;, &#x22;x&#x22;: 646.8085106382979, &#x22;y&#x22;: 255.31914893617022, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;69&#x22;, &#x22;x&#x22;: 612.7659574468084, &#x22;y&#x22;: 289.36170212765956, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;e25&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;70&#x22;, &#x22;x&#x22;: 646.8085106382979, &#x22;y&#x22;: 289.36170212765956, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 7, &#x22;phase&#x22;: &#x22;\u03c0&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;71&#x22;, &#x22;x&#x22;: 612.7659574468084, &#x22;y&#x22;: 323.40425531914894, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;e27&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;72&#x22;, &#x22;x&#x22;: 680.8510638297872, &#x22;y&#x22;: 323.40425531914894, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 1, &#x22;phase&#x22;: &#x22;rec[5]&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;73&#x22;, &#x22;x&#x22;: 612.7659574468084, &#x22;y&#x22;: 357.4468085106383, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 8, &#x22;phase&#x22;: &#x22;e29&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;74&#x22;, &#x22;x&#x22;: 680.8510638297872, &#x22;y&#x22;: 357.4468085106383, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 1, &#x22;phase&#x22;: &#x22;rec[6]&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;75&#x22;, &#x22;x&#x22;: 680.8510638297872, &#x22;y&#x22;: 187.2340425531915, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 1, &#x22;phase&#x22;: &#x22;rec[1]&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;76&#x22;, &#x22;x&#x22;: 680.8510638297872, &#x22;y&#x22;: 221.27659574468083, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 1, &#x22;phase&#x22;: &#x22;rec[2]&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;77&#x22;, &#x22;x&#x22;: 680.8510638297872, &#x22;y&#x22;: 289.36170212765956, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 1, &#x22;phase&#x22;: &#x22;rec[4]&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;78&#x22;, &#x22;x&#x22;: 680.8510638297872, &#x22;y&#x22;: 255.31914893617022, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 1, &#x22;phase&#x22;: &#x22;rec[3]&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;79&#x22;, &#x22;x&#x22;: 714.8936170212766, &#x22;y&#x22;: 153.1914893617021, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 0, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;80&#x22;, &#x22;x&#x22;: 714.8936170212766, &#x22;y&#x22;: 187.2340425531915, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 0, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;81&#x22;, &#x22;x&#x22;: 714.8936170212766, &#x22;y&#x22;: 221.27659574468083, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 0, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;82&#x22;, &#x22;x&#x22;: 714.8936170212766, &#x22;y&#x22;: 255.31914893617022, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 0, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;83&#x22;, &#x22;x&#x22;: 714.8936170212766, &#x22;y&#x22;: 289.36170212765956, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 0, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;84&#x22;, &#x22;x&#x22;: 714.8936170212766, &#x22;y&#x22;: 323.40425531914894, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 0, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;85&#x22;, &#x22;x&#x22;: 714.8936170212766, &#x22;y&#x22;: 357.4468085106383, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 0, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;86&#x22;, &#x22;x&#x22;: 663.8297872340426, &#x22;y&#x22;: 119.14893617021276, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 2, &#x22;phase&#x22;: &#x22;det[0]&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;87&#x22;, &#x22;x&#x22;: 697.8723404255319, &#x22;y&#x22;: 119.14893617021276, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 2, &#x22;phase&#x22;: &#x22;det[1]&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;88&#x22;, &#x22;x&#x22;: 731.9148936170212, &#x22;y&#x22;: 119.14893617021276, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 2, &#x22;phase&#x22;: &#x22;det[2]&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;89&#x22;, &#x22;x&#x22;: 765.9574468085107, &#x22;y&#x22;: 119.14893617021276, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 2, &#x22;phase&#x22;: &#x22;obs[0]&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;90&#x22;, &#x22;x&#x22;: 663.8297872340426, &#x22;y&#x22;: 85.1063829787234, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 0, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;91&#x22;, &#x22;x&#x22;: 697.8723404255319, &#x22;y&#x22;: 85.1063829787234, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 0, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;92&#x22;, &#x22;x&#x22;: 731.9148936170212, &#x22;y&#x22;: 85.1063829787234, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 0, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}, {&#x22;name&#x22;: &#x22;93&#x22;, &#x22;x&#x22;: 765.9574468085107, &#x22;y&#x22;: 68.08510638297872, &#x22;z&#x22;: 0.0, &#x22;t&#x22;: 0, &#x22;phase&#x22;: &#x22;&#x22;, &#x22;ground&#x22;: false, &#x22;vdata&#x22;: []}], &#x22;links&#x22;: [{&#x22;source&#x22;: &#x22;0&#x22;, &#x22;target&#x22;: &#x22;1&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;1&#x22;, &#x22;target&#x22;: &#x22;2&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;2&#x22;, &#x22;target&#x22;: &#x22;30&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;2&#x22;, &#x22;target&#x22;: &#x22;20&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;3&#x22;, &#x22;target&#x22;: &#x22;4&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;4&#x22;, &#x22;target&#x22;: &#x22;15&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;5&#x22;, &#x22;target&#x22;: &#x22;6&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;6&#x22;, &#x22;target&#x22;: &#x22;16&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;7&#x22;, &#x22;target&#x22;: &#x22;8&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;8&#x22;, &#x22;target&#x22;: &#x22;17&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;9&#x22;, &#x22;target&#x22;: &#x22;10&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;10&#x22;, &#x22;target&#x22;: &#x22;18&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;11&#x22;, &#x22;target&#x22;: &#x22;12&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;12&#x22;, &#x22;target&#x22;: &#x22;19&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;13&#x22;, &#x22;target&#x22;: &#x22;14&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;14&#x22;, &#x22;target&#x22;: &#x22;20&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;15&#x22;, &#x22;target&#x22;: &#x22;21&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;16&#x22;, &#x22;target&#x22;: &#x22;23&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;17&#x22;, &#x22;target&#x22;: &#x22;26&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;17&#x22;, &#x22;target&#x22;: &#x22;24&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;18&#x22;, &#x22;target&#x22;: &#x22;27&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;18&#x22;, &#x22;target&#x22;: &#x22;19&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;19&#x22;, &#x22;target&#x22;: &#x22;28&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;20&#x22;, &#x22;target&#x22;: &#x22;29&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;21&#x22;, &#x22;target&#x22;: &#x22;22&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;22&#x22;, &#x22;target&#x22;: &#x22;38&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;22&#x22;, &#x22;target&#x22;: &#x22;27&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;23&#x22;, &#x22;target&#x22;: &#x22;24&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;24&#x22;, &#x22;target&#x22;: &#x22;25&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;25&#x22;, &#x22;target&#x22;: &#x22;31&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;26&#x22;, &#x22;target&#x22;: &#x22;33&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;27&#x22;, &#x22;target&#x22;: &#x22;39&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;28&#x22;, &#x22;target&#x22;: &#x22;42&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;28&#x22;, &#x22;target&#x22;: &#x22;37&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;29&#x22;, &#x22;target&#x22;: &#x22;41&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;29&#x22;, &#x22;target&#x22;: &#x22;34&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;30&#x22;, &#x22;target&#x22;: &#x22;35&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;31&#x22;, &#x22;target&#x22;: &#x22;32&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;32&#x22;, &#x22;target&#x22;: &#x22;56&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;32&#x22;, &#x22;target&#x22;: &#x22;38&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;33&#x22;, &#x22;target&#x22;: &#x22;34&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;34&#x22;, &#x22;target&#x22;: &#x22;40&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;35&#x22;, &#x22;target&#x22;: &#x22;36&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;36&#x22;, &#x22;target&#x22;: &#x22;37&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;37&#x22;, &#x22;target&#x22;: &#x22;43&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;38&#x22;, &#x22;target&#x22;: &#x22;55&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;39&#x22;, &#x22;target&#x22;: &#x22;45&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;40&#x22;, &#x22;target&#x22;: &#x22;44&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;41&#x22;, &#x22;target&#x22;: &#x22;47&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;42&#x22;, &#x22;target&#x22;: &#x22;46&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;43&#x22;, &#x22;target&#x22;: &#x22;48&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;44&#x22;, &#x22;target&#x22;: &#x22;49&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;45&#x22;, &#x22;target&#x22;: &#x22;58&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;45&#x22;, &#x22;target&#x22;: &#x22;50&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;46&#x22;, &#x22;target&#x22;: &#x22;51&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;47&#x22;, &#x22;target&#x22;: &#x22;60&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;47&#x22;, &#x22;target&#x22;: &#x22;52&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;48&#x22;, &#x22;target&#x22;: &#x22;53&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;49&#x22;, &#x22;target&#x22;: &#x22;50&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;50&#x22;, &#x22;target&#x22;: &#x22;57&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;51&#x22;, &#x22;target&#x22;: &#x22;52&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;52&#x22;, &#x22;target&#x22;: &#x22;59&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;53&#x22;, &#x22;target&#x22;: &#x22;54&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;54&#x22;, &#x22;target&#x22;: &#x22;73&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;55&#x22;, &#x22;target&#x22;: &#x22;61&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;56&#x22;, &#x22;target&#x22;: &#x22;63&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;57&#x22;, &#x22;target&#x22;: &#x22;65&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;58&#x22;, &#x22;target&#x22;: &#x22;67&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;59&#x22;, &#x22;target&#x22;: &#x22;69&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;60&#x22;, &#x22;target&#x22;: &#x22;71&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;61&#x22;, &#x22;target&#x22;: &#x22;62&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;62&#x22;, &#x22;target&#x22;: &#x22;79&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;62&#x22;, &#x22;target&#x22;: &#x22;86&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;62&#x22;, &#x22;target&#x22;: &#x22;89&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;63&#x22;, &#x22;target&#x22;: &#x22;64&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;64&#x22;, &#x22;target&#x22;: &#x22;75&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;65&#x22;, &#x22;target&#x22;: &#x22;66&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;66&#x22;, &#x22;target&#x22;: &#x22;76&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;67&#x22;, &#x22;target&#x22;: &#x22;68&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;68&#x22;, &#x22;target&#x22;: &#x22;78&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;69&#x22;, &#x22;target&#x22;: &#x22;70&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;70&#x22;, &#x22;target&#x22;: &#x22;77&#x22;, &#x22;t&#x22;: 5, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;71&#x22;, &#x22;target&#x22;: &#x22;72&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;72&#x22;, &#x22;target&#x22;: &#x22;84&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;72&#x22;, &#x22;target&#x22;: &#x22;87&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;72&#x22;, &#x22;target&#x22;: &#x22;89&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;73&#x22;, &#x22;target&#x22;: &#x22;74&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;74&#x22;, &#x22;target&#x22;: &#x22;85&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;74&#x22;, &#x22;target&#x22;: &#x22;88&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;75&#x22;, &#x22;target&#x22;: &#x22;80&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;75&#x22;, &#x22;target&#x22;: &#x22;86&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;75&#x22;, &#x22;target&#x22;: &#x22;87&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;75&#x22;, &#x22;target&#x22;: &#x22;89&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;76&#x22;, &#x22;target&#x22;: &#x22;81&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;76&#x22;, &#x22;target&#x22;: &#x22;86&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;76&#x22;, &#x22;target&#x22;: &#x22;87&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;76&#x22;, &#x22;target&#x22;: &#x22;88&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;77&#x22;, &#x22;target&#x22;: &#x22;83&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;77&#x22;, &#x22;target&#x22;: &#x22;87&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;77&#x22;, &#x22;target&#x22;: &#x22;88&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;78&#x22;, &#x22;target&#x22;: &#x22;82&#x22;, &#x22;t&#x22;: 4, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;78&#x22;, &#x22;target&#x22;: &#x22;86&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;78&#x22;, &#x22;target&#x22;: &#x22;88&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;86&#x22;, &#x22;target&#x22;: &#x22;90&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;87&#x22;, &#x22;target&#x22;: &#x22;91&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;88&#x22;, &#x22;target&#x22;: &#x22;92&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}, {&#x22;source&#x22;: &#x22;89&#x22;, &#x22;target&#x22;: &#x22;93&#x22;, &#x22;t&#x22;: 1, &#x22;index&#x22;: 0, &#x22;num_parallel&#x22;: 1}], &#x22;pauli_web&#x22;: []}'), 800.0, 391.48936170212767, 34.04255319148936,
6.808510638297872, false, false, '');
</script></body></html>"
  width="100%"
  height="403"
  style={{border: "1px solid #eee", borderRadius: "0.5rem"}}
  title="ZX diagram 2"
  loading="lazy"
/>

Now we compile the sampler for the noisy circuit.

```python theme={null}
det_sampler = c.compile_detector_sampler()
```

Sampling from the noisy circuit, we expect to see some non-zero detector events.

```python theme={null}
det_samples, obs_samples = det_sampler.sample(shots=10_000, separate_observables=True)
print(det_samples[:5], "\nTriggered detection events:", np.count_nonzero(det_samples))
print(obs_samples[:5])
```

```text title="Output" theme={null}
[[False False False]
 [False False False]
 [False False False]
 [False False False]
 [False False False]] 
Triggered detection events: 1478
[[False]
 [False]
 [False]
 [False]
 [False]]
```

We again calculate the probability of measuring a logical $|\bar{1}\rangle$. Due to the noise, it deviates from the ideal value of $\sin(\pi/8)^2 \approx 0.1464$.

```python theme={null}
int(np.count_nonzero(obs_samples)) / len(obs_samples)
```

```text title="Output" theme={null}
0.1686
```

## Error detection

One simple error correction strategy is **post-selection**: we discard any shots where a detector fired (indicating an error occurred). This effectively projects us back to the code space, but reduces the success rate (yield).

```python theme={null}
perfect_stabilizers = np.all(det_samples == 0, axis=1)
post_selected_obs = obs_samples[perfect_stabilizers]
int(np.count_nonzero(post_selected_obs)) / len(post_selected_obs)
```

```text title="Output" theme={null}
0.1451806571335007
```

## Error correction

To actively correct errors, we need a **decoder**. A decoder takes the detector syndrome and predicts whether the observable should be flipped.

In this example, we will use the [tesseract](https://github.com/quantumlib/tesseract-decoder) decoder.

After correction, we see that the the probability of getting a logical $|\bar{1}\rangle$ is close to the ideal value.

```python theme={null}
c.detector_error_model()
```

```text title="Output" theme={null}
stim.DetectorErrorModel('''
    error(0.0132444) D0 D1 D2
    error(0.0184365) D0 D1 L0
    error(0.00666667) D0 D2
    error(0.00666667) D0 L0
    error(0.0132444) D1 D2
    error(0.00666667) D1 L0
    error(0.0197345) D2
''')
```

```python theme={null}
config = tesseract.TesseractConfig(dem=c.detector_error_model())
decoder = config.compile_decoder()


obs_corrected = np.zeros_like(obs_samples)
for i, det_sample in enumerate(det_samples):
    flip_obs = decoder.decode(det_sample)
    obs_corrected[i] = np.logical_xor(obs_samples[i], flip_obs[0])

print("Raw obs.: ", int(np.count_nonzero(obs_samples)) / len(obs_samples))
print("Corrected:", int(np.count_nonzero(obs_corrected)) / len(obs_corrected))
```

```text title="Output" theme={null}
Raw obs.:  0.1686
Corrected: 0.1463
```

## Monte Carlo Simulation with sinter

tsim is compatible with sinter, a tool for performing large Monte Carlo simulations. We can use sinter to sample and decode over a range of physical error rates.

```python theme={null}
tesseract_dec = TesseractSinterDecoder()
no_dec = NoDecoder()

tasks = [
    sinter.Task(
        circuit=make_circuit(noise).cast_to_stim(),
        json_metadata={"p": noise},
    )
    for noise in np.logspace(-3.3, -0.2, 6)
]

collected_stats = sinter.collect(
    num_workers=1,
    tasks=tasks,
    decoders=["tesseract", "no decoding"],
    max_shots=1024 * 64,
    max_errors=1024 * 64,
    custom_decoders={"tesseract": tesseract_dec, "no decoding": NoDecoder()},
    start_batch_size=1024 * 64,
    max_batch_size=1024 * 64,
)
```

sinter provides a number of convenient plotting tools. Here, we use them to plot the observable flip rate as a function of the physical error rate. We observe that the decoded probability approaches the expected value of $\sin(\pi/8)^2$ much faster.

```python theme={null}
fig, ax = plt.subplots(1, 1)
sinter.plot_error_rate(
    ax=ax,
    stats=collected_stats,
    x_func=lambda stats: stats.json_metadata["p"],
    group_func=lambda stats: stats.decoder,
)
ax.loglog()
ax.set_xlabel("Physical Error Rate")
ax.set_ylabel(f"Probability of logical $|\\bar{1}\\rangle$")
ax.axhline(np.sin(np.pi / 8) ** 2, color="k", linestyle="--", lw=0.4)
ax.text(0.1, np.sin(np.pi / 8) ** 2 * 1.01, "$\\sin(\\pi/8)^2$", fontsize=10)
ax.legend();
```

<img src="https://mintcdn.com/tsim/FBxDnuddY8LTse3r/images/tutorials/encoding_demo/cell_41_0.svg?fit=max&auto=format&n=FBxDnuddY8LTse3r&q=85&s=d5e216a3ed239b1c3b7211b11cba91ea" alt="Notebook output figure" width="580" height="414" data-path="images/tutorials/encoding_demo/cell_41_0.svg" />
