Repository: AUTODIAL/AutoEIS (language: python)

Issue:
Parallelized GEP breaks on statically linked Python distributions (e.g., conda)



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml
index beb4bbf7..2fc22a08 100644
--- a/.github/workflows/nightly.yml
+++ b/.github/workflows/nightly.yml
@@ -14,7 +14,7 @@ jobs:
         shell: bash
     strategy:
       matrix:
-        julia-version: ['1.9']
+        julia-version: ['1.10']
         python-version: ['3.9', '3.10', '3.11']
         os: [ubuntu-latest, macos-latest, windows-latest]
 
diff --git a/autoeis/core.py b/autoeis/core.py
index a98a3af0..3a4911cf 100644
--- a/autoeis/core.py
+++ b/autoeis/core.py
@@ -13,6 +13,7 @@
 
 """
 import os
+import sys
 import time
 import warnings
 from typing import Union
@@ -22,10 +23,11 @@
 import numpy as np
 import numpyro
 import pandas as pd
+import psutil
 from impedance.validation import linKK
 from jax import random
 from mpire import WorkerPool
-from numpyro.infer import MCMC, NUTS, Predictive
+from numpyro.infer import MCMC, NUTS
 from scipy.optimize import curve_fit
 from tqdm.auto import tqdm
 
@@ -250,7 +252,7 @@ def generate_equivalent_circuits(
     freq: np.ndarray[float],
     iters: int = 100,
     complexity: int = 12,
-    tol: float = 5e-4,
+    tol: float = 1e-2,
     parallel: bool = True,
     generations: int = 30,
     population_size: int = 100,
@@ -297,7 +299,7 @@ def generate_equivalent_circuits(
         "population_size": population_size,
     }
 
-    ecm_generator = _generate_ecm_parallel if parallel else _generate_ecm_serial
+    ecm_generator = _generate_ecm_parallel_julia if parallel else _generate_ecm_serial
     circuits = ecm_generator(impedance, freq, iters, ec_kwargs, seed)
 
     # Convert Parameters column to dict, e.g., (R1 = 1.0, etc.) -> {"R1": 1.0, etc.}
@@ -310,10 +312,8 @@ def generate_equivalent_circuits(
 
 
 def _generate_ecm_serial(impedance, freq, iters, ec_kwargs, seed):
-    """Generate potential ECMs using EquivalentCircuits.jl in serial."""
+    """Generates candidate circuit models in serial."""
     Main = julia_helpers.init_julia()
-    # Suppress Julia warnings (coming from Optim.jl)
-    Main.redirect_stderr()
     ec = julia_helpers.import_backend(Main)
 
     # Set random seed for reproducibility (Python and Julia)
@@ -337,8 +337,9 @@ def _generate_ecm_serial(impedance, freq, iters, ec_kwargs, seed):
     return df
 
 
-def _generate_ecm_parallel(impedance, freq, iters, ec_kwargs, seed):
-    """Generate potential ECMs using EquivalentCircuits.jl in parallel."""
+# TODO: This function is deprecated, use _generate_ecm_parallel_julia instead
+def _generate_ecm_parallel_mpire(impedance, freq, iters, ec_kwargs, seed):
+    """Generates candidate circuit models in parallel via Python multiprocessing."""
 
     def circuit_evolution(seed: int):
         """Closure to generate a single circuit to be used with multiprocessing."""
@@ -346,11 +347,6 @@ def circuit_evolution(seed: int):
         # Set random seed for reproducibility (Python and Julia)
         np.random.seed(seed)
         Main.eval(f"import Random; Random.seed!({seed})")
-        # Suppress Julia warnings (coming from Optim.jl)
-        Main.redirect_stderr()
-        # Suppress Julia output (coming from EquivalentCircuits.jl) until
-        # MaximeVH/EquivalentCircuits.jl/issues/28 is fixed
-        Main.redirect_stdout()
         ec = julia_helpers.import_backend(Main)
         try:
             circuit = ec.circuit_evolution(impedance, freq, **ec_kwargs)
@@ -394,6 +390,52 @@ def circuit_evolution(seed: int):
     return df
 
 
+def _generate_ecm_parallel_julia(impedance, freq, iters, ec_kwargs, seed):
+    """Generates candidate circuit models in parallel directly from Julia."""
+    Main = julia_helpers.init_julia()
+    # Set random seed for reproducibility (Python and Julia)
+    # FIXME: This doesn't work when multiprocessing, use @everywhere instead
+    np.random.seed(seed)
+    Main.eval(f"import Random; Random.seed!({seed})")
+    Main.eval("import Logging; Logging.disable_logging(Logging.Warn)")
+    ec = julia_helpers.import_backend(Main)
+
+    # HACK: To get a progress bar, chunk the iterations -> call Julia repeatedly
+    nprocs = psutil.cpu_count(logical=False)
+    # NOTE: e.g., iters = 11, nprocs = 4 -> iters_chunked = [4, 4, 3]
+    iters_chunked = [nprocs] * (iters // nprocs)
+    if iters % nprocs:
+        iters_chunked.append(iters % nprocs)
+
+    # Perform parallelized GEP in chunks
+    circuits = []
+
+    with tqdm(total=iters, desc="Circuit Evolution", miniters=1) as pbar:
+        # HACK: Flush once for progress bar to show up
+        sys.stderr.flush()
+        for iters_ in iters_chunked:
+            try:
+                circuits_ = ec.circuit_evolution_batch(impedance, freq, **ec_kwargs, iters=iters_)
+            except Exception as e:
+                log.error(f"Error generating circuits: {e}")
+                circuits_ = []
+            circuits += circuits_
+            pbar.update(iters_)
+            # HACK: Flush every iteration to refresh progress bar
+            sys.stderr.flush()
+   
+    # Format output as list of strings since Julia objects cannot be pickled
+    circuits_py = []
+    for circuit in circuits:
+        if circuit != Main.nothing:
+            circuits_py.append([circuit.circuitstring, Main.string(circuit.Parameters)])
+
+    # Format circuits as a dataframe with columns "circuitstring" and "Parameters"
+    df = pd.DataFrame(circuits_py, columns=["circuitstring", "Parameters"])
+
+    return df
+
+
 def split_components(circuits: pd.DataFrame) -> pd.DataFrame:
     """Adds an individual column for each component in the circuit with its value."""
     # Initialize lists to populate the component columns later
@@ -608,7 +650,7 @@ def perform_full_analysis(
     Z, freq, rmse = preprocess_impedance_data(Z, freq, threshold=0.05)
     
     # Generate a pool of potential ECMs via an evolutionary algorithm
-    kwargs = {"iters": iters, "complexity": 12, "tol": 1e-4, "parallel": parallel}
+    kwargs = {"iters": iters, "complexity": 12, "tol": 1e-2, "parallel": parallel}
     circuits_unfiltered = generate_equivalent_circuits(Z, freq, **kwargs)
 
     # Apply heuristic rules to filter unphysical circuits
diff --git a/autoeis/julia_helpers.py b/autoeis/julia_helpers.py
index 9cfc9386..5fa91950 100644
--- a/autoeis/julia_helpers.py
+++ b/autoeis/julia_helpers.py
@@ -75,7 +75,7 @@ def install(julia_project=None, quiet=False, precompile=None, offline=False):  #
         Main.eval(f"Pkg.precompile({io_arg})")
 
     if not quiet:
-        log.warn(
+        log.warning(
             "It is recommended to restart Python after installing AutoEIS "
             "dependencies, so that the Julia environment is properly initialized."
         )
@@ -118,7 +118,7 @@ def init_julia(julia_project=None, quiet=False, julia_kwargs=None, return_aux=Fa
             # Static python binary, so we turn off pre-compiled modules.
             julia_kwargs = {**julia_kwargs, "compiled_modules": False}
             Julia(**julia_kwargs)
-            log.warn(
+            log.warning(
                 "Your system's Python library is static (e.g., conda), "
                 "so precompilation will be turned off. For a dynamic library, "
                 "try using `pyenv` and installing with `--enable-shared`: "
@@ -144,7 +144,7 @@ def init_julia(julia_project=None, quiet=False, julia_kwargs=None, return_aux=Fa
         # Remove the `compiled_modules` key, since it is not a user-specified kwarg:
         set_diff = {k: v for k, v in set_diff if k != "compiled_modules"}
         if len(set_diff) > 0:
-            log.warn(
+            log.warning(
                 f"Julia has already started. The new Julia options {set_diff} "
                 "will be ignored."
             )
@@ -177,7 +177,9 @@ def import_backend(Main=None):
     if Main is None:
         Main = init_julia()
     EquivalentCircuits = import_package("EquivalentCircuits", Main=Main)
-    _backend_version_assertion(Main)
+    # FIXME: Currently don't know how to assert branch name if installed from GitHub
+    if __equivalent_circuits_jl_version__.startswith("v"):
+        _backend_version_assertion(Main)
     return EquivalentCircuits
 
 
@@ -313,11 +315,12 @@ def _add_ec_to_julia_project(Main, io_arg):
     """Install EquivalentCircuits.jl and dependencies to the Julia project."""
     Main.eval("using Pkg")
     Main.eval(f"Pkg.Registry.update({io_arg})")
-    Main.ec_spec = Main.PackageSpec(
-        name="EquivalentCircuits",
-        # url="https://github.com/MaximeVH/EquivalentCircuits.jl",
-        version="v" + __equivalent_circuits_jl_version__,
-    )
+    kwargs = {"name": "EquivalentCircuits"}
+    if __equivalent_circuits_jl_version__.startswith("v"):
+        kwargs["version"] = __equivalent_circuits_jl_version__
+    else:
+        kwargs["rev"] = __equivalent_circuits_jl_version__
+    Main.ec_spec = Main.PackageSpec(**kwargs)
     Main.eval(f"Pkg.add([ec_spec], {io_arg})")
 
 
@@ -343,14 +346,14 @@ def _backend_version_assertion(Main):
         backend_version = Main.eval("string(pkgversion(EquivalentCircuits))")
         expected_backend_version = __equivalent_circuits_jl_version__
         if backend_version != expected_backend_version:  # pragma: no cover
-            log.warn(
+            log.warning(
                 f"AutoEIS backend (EquivalentCircuits.jl) version {backend_version} "
                 f"does not match expected version {expected_backend_version}. "
                 "Things may break. Please update your AutoEIS installation with "
                 "`import autoeis; autoeis.julia_helpers.install()`."
             )
     except JuliaError:  # pragma: no cover
-        log.warn(
+        log.warning(
             "You seem to have an outdated version of EquivalentCircuits.jl. "
             "Things may break. Please update your AutoEIS installation with "
             "`import autoeis; autoeis.julia_helpers.install()`."
diff --git a/autoeis/version.py b/autoeis/version.py
index 0151d0aa..b23e99e1 100644
--- a/autoeis/version.py
+++ b/autoeis/version.py
@@ -1,2 +1,3 @@
 __version__ = "0.0.19"
-__equivalent_circuits_jl_version__ = "0.3.1"
+# Either use a branch name or a tag name for EquivalentCircuits.jl
+__equivalent_circuits_jl_version__ = "master"  # "0.3.1"
diff --git a/examples/autoeis_demo.ipynb b/examples/autoeis_demo.ipynb
index 55c25574..5bb0637f 100644
--- a/examples/autoeis_demo.ipynb
+++ b/examples/autoeis_demo.ipynb
@@ -176,6 +176,20 @@
    "execution_count": 5,
    "metadata": {},
    "outputs": [
+    {
+     "data": {
+      "application/vnd.jupyter.widget-view+json": {
+       "model_id": "c0946df14c3542b98e109140664761d1",
+       "version_major": 2,
+       "version_minor": 0
+      },
+      "text/plain": [
+       "Circuit Evolution:   0%|          | 0/24 [00:00<?, ?it/s]"
+      ]
+     },
+     "metadata": {},
+     "output_type": "display_data"
+    },
     {
      "data": {
       "text/html": [
@@ -204,159 +218,180 @@
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0</th>\n",
-       "      <td>P1-[P2,L3]-[P4,P5]</td>\n",
-       "      <td>{'P1w': 3.1928577593495745e-06, 'P1n': 0.79394...</td>\n",
+       "      <td>R1-[P2,R3]</td>\n",
+       "      <td>{'R1': 139.14713059888192, 'P2w': 1.9866544193...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
-       "      <td>[R1,P2]-[P3,R4]-R5-P6-R7</td>\n",
-       "      <td>{'R1': 3756228.324732959, 'P2w': 2.03557677798...</td>\n",
+       "      <td>R1-[R2,P3]</td>\n",
+       "      <td>{'R1': 139.1471305850334, 'R2': 4629850.954866...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2</th>\n",
-       "      <td>[P1-P2-[[R3,P4],P5],R6]</td>\n",
-       "      <td>{'P1w': 2.2434807405762006e-05, 'P1n': 0.88840...</td>\n",
+       "      <td>R1-[L2,R3]-[P4,P5]</td>\n",
+       "      <td>{'R1': 142.06139721718435, 'L2': 8.43681910105...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>3</th>\n",
-       "      <td>[L1,R2]-[P3-[L4-R5,P6],R7]</td>\n",
-       "      <td>{'L1': 1.0613558658993882e-19, 'R2': 826995570...</td>\n",
+       "      <td>[P1,R2]-R3</td>\n",
+       "      <td>{'P1w': 1.9866544197335516e-06, 'P1n': 0.93730...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>4</th>\n",
-       "      <td>[[[P1,R2],R3]-L4-R5,P6]-R7</td>\n",
-       "      <td>{'P1w': 2.3011178790923626e-06, 'P1n': 0.40321...</td>\n",
+       "      <td>[R1-P2,P3-R4]</td>\n",
+       "      <td>{'R1': 141.2473462865248, 'P2w': 1.81712843813...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>5</th>\n",
-       "      <td>[[R1-P2,R3-P4],C5-R6]</td>\n",
-       "      <td>{'R1': 676.9091823021058, 'P2w': 5.86557995820...</td>\n",
+       "      <td>[R1-P2,P3-R4]</td>\n",
+       "      <td>{'R1': 2754010.655590384, 'P2w': 2.27529707151...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>6</th>\n",
-       "      <td>P1-P2-[P3,P4]</td>\n",
-       "      <td>{'P1w': 0.006250677506749731, 'P1n': 0.0118602...</td>\n",
+       "      <td>P1-R2-[P3,[P4,R5]]</td>\n",
+       "      <td>{'P1w': 5.28017526126197e-05, 'P1n': 0.8001289...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>7</th>\n",
-       "      <td>[P1,[R2,L3]-P4]</td>\n",
-       "      <td>{'P1w': 2.247010810095234e-06, 'P1n': 0.874773...</td>\n",
+       "      <td>P1-[P2,R3]</td>\n",
+       "      <td>{'P1w': 2.7265188029432905e-06, 'P1n': 0.86814...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>8</th>\n",
-       "      <td>R1-[[R2,P3],P4]</td>\n",
-       "      <td>{'R1': 142.0632231537774, 'R2': 1500000000.024...</td>\n",
+       "      <td>[P1,L2]-[P3-R4,P5]</td>\n",
+       "      <td>{'P1w': 0.0068072596635226305, 'P1n': 0.004033...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>9</th>\n",
-       "      <td>[P1,[R2,P3]-R4]</td>\n",
-       "      <td>{'P1w': 2.230907252126471e-06, 'P1n': 0.876624...</td>\n",
+       "      <td>[[R1,P2],R3]-R4</td>\n",
+       "      <td>{'R1': 4656579.086437493, 'P2w': 1.98665442036...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>10</th>\n",
-       "      <td>[[[R1,P2],C3-L4]-P5,P6]</td>\n",
-       "      <td>{'R1': 3818933.71859363, 'P2w': 2.175028698553...</td>\n",
+       "      <td>[P1-R2,R3]</td>\n",
+       "      <td>{'P1w': 1.9865350114849734e-06, 'P1n': 0.93730...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>11</th>\n",
-       "      <td>[[P1,L2-[P3,R4]]-R5-P6,P7]</td>\n",
-       "      <td>{'P1w': 5207.151722389234, 'P1n': 0.9999999999...</td>\n",
+       "      <td>R1-[P2,R3]</td>\n",
+       "      <td>{'R1': 139.14713052587953, 'P2w': 1.9866544198...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>12</th>\n",
-       "      <td>[C1-P2-R3,P4-R5]</td>\n",
-       "      <td>{'C1': 0.009999999857491889, 'P2w': 1.81745422...</td>\n",
+       "      <td>[P1-[L2,R3],R4]</td>\n",
+       "      <td>{'P1w': 2.3029244842871657e-06, 'P1n': 0.86968...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>13</th>\n",
-       "      <td>P1-[P2-R3-R4-L5,P6]</td>\n",
-       "      <td>{'P1w': 2.8074252438992e-06, 'P1n': 0.84883423...</td>\n",
+       "      <td>[[P1,P2-R3],R4]</td>\n",
+       "      <td>{'P1w': 2.302924497337585e-06, 'P1n': 0.869686...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>14</th>\n",
-       "      <td>L1-R2-[P3,P4]</td>\n",
-       "      <td>{'L1': 9.052611565739006e-21, 'R2': 142.061397...</td>\n",
+       "      <td>R1-[R2,P3]-P4</td>\n",
+       "      <td>{'R1': 139.68410281993843, 'R2': 3756228.57499...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>15</th>\n",
-       "      <td>[[R1,P2],P3]-R4</td>\n",
-       "      <td>{'R1': 999999999.9999872, 'P2w': 4.06284395506...</td>\n",
+       "      <td>[R1,[P2,C3-R4]-[R5,[R6,L7]]]</td>\n",
+       "      <td>{'R1': 8584535.611040385, 'P2w': 2.23090725482...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>16</th>\n",
-       "      <td>[R1-P2,P3-R4]-P5-R6</td>\n",
-       "      <td>{'R1': 3820950.8486733097, 'P2w': 198638277.40...</td>\n",
+       "      <td>[R1-P2,R3-P4]-[P5,L6]</td>\n",
+       "      <td>{'R1': 2724875.0402365704, 'P2w': 2.2168999612...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>17</th>\n",
-       "      <td>[P1,[P2,R3]]-P4</td>\n",
-       "      <td>{'P1w': 0.0021158643015816445, 'P1n': 7.770279...</td>\n",
+       "      <td>R1-[P2,R3]</td>\n",
+       "      <td>{'R1': 139.14713045352516, 'P2w': 1.9866544183...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>18</th>\n",
-       "      <td>[P1-[L2,R3],R4]-[P5,R6]</td>\n",
-       "      <td>{'P1w': 0.007186636321461309, 'P1n': 1.7216333...</td>\n",
+       "      <td>[R1,L2]-[R3-L4,P5]</td>\n",
+       "      <td>{'R1': 991910816.6759088, 'L2': 1.490342058091...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>19</th>\n",
-       "      <td>[[P1,R2]-P3-[P4,L5],R6]</td>\n",
-       "      <td>{'P1w': 2.009961353950956e-06, 'P1n': 0.925569...</td>\n",
+       "      <td>[L1,R2]-[P3,R4]</td>\n",
+       "      <td>{'L1': 8.156807374110227e-19, 'R2': 412855315....</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>20</th>\n",
-       "      <td>[P1,[P2,R3-R4]]-R5</td>\n",
-       "      <td>{'P1w': 1.7375194775324558e-06, 'P1n': 0.96242...</td>\n",
+       "      <td>[P1-R2,R3]</td>\n",
+       "      <td>{'P1w': 1.9865350096583837e-06, 'P1n': 0.93730...</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>21</th>\n",
+       "      <td>[P1-R2,R3]</td>\n",
+       "      <td>{'P1w': 3.230466244494574e-08, 'P1n': 0.973660...</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>22</th>\n",
+       "      <td>[R1,P2]-R3</td>\n",
+       "      <td>{'R1': 4629850.958279881, 'P2w': 1.98665441804...</td>\n",
+       "    </tr>\n",
+       "    <tr>\n",
+       "      <th>23</th>\n",
+       "      <td>[R1,P2]-R3</td>\n",
+       "      <td>{'R1': 4629850.949071481, 'P2w': 1.98665441956...</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "</div>"
       ],
       "text/plain": [
-       "                 circuitstring  \\\n",
-       "0           P1-[P2,L3]-[P4,P5]   \n",
-       "1     [R1,P2]-[P3,R4]-R5-P6-R7   \n",
-       "2      [P1-P2-[[R3,P4],P5],R6]   \n",
-       "3   [L1,R2]-[P3-[L4-R5,P6],R7]   \n",
-       "4   [[[P1,R2],R3]-L4-R5,P6]-R7   \n",
-       "5        [[R1-P2,R3-P4],C5-R6]   \n",
-       "6                P1-P2-[P3,P4]   \n",
-       "7              [P1,[R2,L3]-P4]   \n",
-       "8              R1-[[R2,P3],P4]   \n",
-       "9              [P1,[R2,P3]-R4]   \n",
-       "10     [[[R1,P2],C3-L4]-P5,P6]   \n",
-       "11  [[P1,L2-[P3,R4]]-R5-P6,P7]   \n",
-       "12            [C1-P2-R3,P4-R5]   \n",
-       "13         P1-[P2-R3-R4-L5,P6]   \n",
-       "14               L1-R2-[P3,P4]   \n",
-       "15             [[R1,P2],P3]-R4   \n",
-       "16         [R1-P2,P3-R4]-P5-R6   \n",
-       "17             [P1,[P2,R3]]-P4   \n",
-       "18     [P1-[L2,R3],R4]-[P5,R6]   \n",
-       "19     [[P1,R2]-P3-[P4,L5],R6]   \n",
-       "20          [P1,[P2,R3-R4]]-R5   \n",
+       "                   circuitstring  \\\n",
+       "0                     R1-[P2,R3]   \n",
+       "1                     R1-[R2,P3]   \n",
+       "2             R1-[L2,R3]-[P4,P5]   \n",
+       "3                     [P1,R2]-R3   \n",
+       "4                  [R1-P2,P3-R4]   \n",
+       "5                  [R1-P2,P3-R4]   \n",
+       "6             P1-R2-[P3,[P4,R5]]   \n",
+       "7                     P1-[P2,R3]   \n",
+       "8             [P1,L2]-[P3-R4,P5]   \n",
+       "9                [[R1,P2],R3]-R4   \n",
+       "10                    [P1-R2,R3]   \n",
+       "11                    R1-[P2,R3]   \n",
+       "12               [P1-[L2,R3],R4]   \n",
+       "13               [[P1,P2-R3],R4]   \n",
+       "14                 R1-[R2,P3]-P4   \n",
+       "15  [R1,[P2,C3-R4]-[R5,[R6,L7]]]   \n",
+       "16         [R1-P2,R3-P4]-[P5,L6]   \n",
+       "17                    R1-[P2,R3]   \n",
+       "18            [R1,L2]-[R3-L4,P5]   \n",
+       "19               [L1,R2]-[P3,R4]   \n",
+       "20                    [P1-R2,R3]   \n",
+       "21                    [P1-R2,R3]   \n",
+       "22                    [R1,P2]-R3   \n",
+       "23                    [R1,P2]-R3   \n",
        "\n",
        "                                           Parameters  \n",
-       "0   {'P1w': 3.1928577593495745e-06, 'P1n': 0.79394...  \n",
-       "1   {'R1': 3756228.324732959, 'P2w': 2.03557677798...  \n",
-       "2   {'P1w': 2.2434807405762006e-05, 'P1n': 0.88840...  \n",
-       "3   {'L1': 1.0613558658993882e-19, 'R2': 826995570...  \n",
-       "4   {'P1w': 2.3011178790923626e-06, 'P1n': 0.40321...  \n",
-       "5   {'R1': 676.9091823021058, 'P2w': 5.86557995820...  \n",
-       "6   {'P1w': 0.006250677506749731, 'P1n': 0.0118602...  \n",
-       "7   {'P1w': 2.247010810095234e-06, 'P1n': 0.874773...  \n",
-       "8   {'R1': 142.0632231537774, 'R2': 1500000000.024...  \n",
-       "9   {'P1w': 2.230907252126471e-06, 'P1n': 0.876624...  \n",
-       "10  {'R1': 3818933.71859363, 'P2w': 2.175028698553...  \n",
-       "11  {'P1w': 5207.151722389234, 'P1n': 0.9999999999...  \n",
-       "12  {'C1': 0.009999999857491889, 'P2w': 1.81745422...  \n",
-       "13  {'P1w': 2.8074252438992e-06, 'P1n': 0.84883423...  \n",
-       "14  {'L1': 9.052611565739006e-21, 'R2': 142.061397...  \n",
-       "15  {'R1': 999999999.9999872, 'P2w': 4.06284395506...  \n",
-       "16  {'R1': 3820950.8486733097, 'P2w': 198638277.40...  \n",
-       "17  {'P1w': 0.0021158643015816445, 'P1n': 7.770279...  \n",
-       "18  {'P1w': 0.007186636321461309, 'P1n': 1.7216333...  \n",
-       "19  {'P1w': 2.009961353950956e-06, 'P1n': 0.925569...  \n",
-       "20  {'P1w': 1.7375194775324558e-06, 'P1n': 0.96242...  "
+       "0   {'R1': 139.14713059888192, 'P2w': 1.9866544193...  \n",
+       "1   {'R1': 139.1471305850334, 'R2': 4629850.954866...  \n",
+       "2   {'R1': 142.06139721718435, 'L2': 8.43681910105...  \n",
+       "3   {'P1w': 1.9866544197335516e-06, 'P1n': 0.93730...  \n",
+       "4   {'R1': 141.2473462865248, 'P2w': 1.81712843813...  \n",
+       "5   {'R1': 2754010.655590384, 'P2w': 2.27529707151...  \n",
+       "6   {'P1w': 5.28017526126197e-05, 'P1n': 0.8001289...  \n",
+       "7   {'P1w': 2.7265188029432905e-06, 'P1n': 0.86814...  \n",
+       "8   {'P1w': 0.0068072596635226305, 'P1n': 0.004033...  \n",
+       "9   {'R1': 4656579.086437493, 'P2w': 1.98665442036...  \n",
+       "10  {'P1w': 1.9865350114849734e-06, 'P1n': 0.93730...  \n",
+       "11  {'R1': 139.14713052587953, 'P2w': 1.9866544198...  \n",
+       "12  {'P1w': 2.3029244842871657e-06, 'P1n': 0.86968...  \n",
+       "13  {'P1w': 2.302924497337585e-06, 'P1n': 0.869686...  \n",
+       "14  {'R1': 139.68410281993843, 'R2': 3756228.57499...  \n",
+       "15  {'R1': 8584535.611040385, 'P2w': 2.23090725482...  \n",
+       "16  {'R1': 2724875.0402365704, 'P2w': 2.2168999612...  \n",
+       "17  {'R1': 139.14713045352516, 'P2w': 1.9866544183...  \n",
+       "18  {'R1': 991910816.6759088, 'L2': 1.490342058091...  \n",
+       "19  {'L1': 8.156807374110227e-19, 'R2': 412855315....  \n",
+       "20  {'P1w': 1.9865350096583837e-06, 'P1n': 0.93730...  \n",
+       "21  {'P1w': 3.230466244494574e-08, 'P1n': 0.973660...  \n",
+       "22  {'R1': 4629850.958279881, 'P2w': 1.98665441804...  \n",
+       "23  {'R1': 4629850.949071481, 'P2w': 1.98665441956...  "
       ]
      },
      "execution_count": 5,
@@ -370,7 +405,7 @@
     "    \"complexity\": 12,\n",
     "    \"population_size\": 100,\n",
     "    \"generations\": 30,\n",
-    "    \"tol\": 5e-4,\n",
+    "    \"tol\": 1e-2,\n",
     "    \"parallel\": True\n",
     "}\n",
     "circuits_unfiltered = ae.core.generate_equivalent_circuits(Z, freq, **kwargs)\n",
@@ -428,86 +463,67 @@
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0</th>\n",
-       "      <td>[R1,P2]-[P3,R4]-R5-P6-R7</td>\n",
-       "      <td>{'R1': 3756228.324732959, 'P2w': 2.03557677798...</td>\n",
-       "      <td>[R1, R4, R5, R7]</td>\n",
+       "      <td>R1-[P2,R3]</td>\n",
+       "      <td>{'R1': 139.14713059888192, 'P2w': 1.9866544193...</td>\n",
+       "      <td>[R1, R3]</td>\n",
        "      <td>[]</td>\n",
        "      <td>[]</td>\n",
-       "      <td>[P2w, P2n, P3w, P3n, P6w, P6n]</td>\n",
+       "      <td>[P2w, P2n]</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
-       "      <td>[[[P1,R2],R3]-L4-R5,P6]-R7</td>\n",
-       "      <td>{'P1w': 2.3011178790923626e-06, 'P1n': 0.40321...</td>\n",
-       "      <td>[R2, R3, R5, R7]</td>\n",
+       "      <td>R1-[L2,R3]-[P4,P5]</td>\n",
+       "      <td>{'R1': 142.06139721718435, 'L2': 8.43681910105...</td>\n",
+       "      <td>[R1, R3]</td>\n",
        "      <td>[]</td>\n",
-       "      <td>[L4]</td>\n",
-       "      <td>[P1w, P1n, P6w, P6n]</td>\n",
+       "      <td>[L2]</td>\n",
+       "      <td>[P4w, P4n, P5w, P5n]</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2</th>\n",
-       "      <td>R1-[[R2,P3],P4]</td>\n",
-       "      <td>{'R1': 142.0632231537774, 'R2': 1500000000.024...</td>\n",
-       "      <td>[R1, R2]</td>\n",
+       "      <td>P1-R2-[P3,[P4,R5]]</td>\n",
+       "      <td>{'P1w': 5.28017526126197e-05, 'P1n': 0.8001289...</td>\n",
+       "      <td>[R2, R5]</td>\n",
        "      <td>[]</td>\n",
        "      <td>[]</td>\n",
-       "      <td>[P3w, P3n, P4w, P4n]</td>\n",
+       "      <td>[P1w, P1n, P3w, P3n, P4w, P4n]</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>3</th>\n",
-       "      <td>L1-R2-[P3,P4]</td>\n",
-       "      <td>{'L1': 9.052611565739006e-21, 'R2': 142.061397...</td>\n",
-       "      <td>[R2]</td>\n",
-       "      <td>[]</td>\n",
-       "      <td>[L1]</td>\n",
-       "      <td>[P3w, P3n, P4w, P4n]</td>\n",
-       "    </tr>\n",
-       "    <tr>\n",
-       "      <th>4</th>\n",
-       "      <td>[R1-P2,P3-R4]-P5-R6</td>\n",
-       "      <td>{'R1': 3820950.8486733097, 'P2w': 198638277.40...</td>\n",
-       "      <td>[R1, R4, R6]</td>\n",
+       "      <td>[[R1,P2],R3]-R4</td>\n",
+       "      <td>{'R1': 4656579.086437493, 'P2w': 1.98665442036...</td>\n",
+       "      <td>[R1, R3, R4]</td>\n",
        "      <td>[]</td>\n",
        "      <td>[]</td>\n",
-       "      <td>[P2w, P2n, P3w, P3n, P5w, P5n]</td>\n",
+       "      <td>[P2w, P2n]</td>\n",
        "    </tr>\n",
        "    <tr>\n",
-       "      <th>5</th>\n",
-       "      <td>[P1,[P2,R3-R4]]-R5</td>\n",
-       "      <td>{'P1w': 1.7375194775324558e-06, 'P1n': 0.96242...</td>\n",
-       "      <td>[R3, R4, R5]</td>\n",
+       "      <th>4</th>\n",
+       "      <td>R1-[R2,P3]-P4</td>\n",
+       "      <td>{'R1': 139.68410281993843, 'R2': 3756228.57499...</td>\n",
+       "      <td>[R1, R2]</td>\n",
        "      <td>[]</td>\n",
        "      <td>[]</td>\n",
-       "      <td>[P1w, P1n, P2w, P2n]</td>\n",
+       "      <td>[P3w, P3n, P4w, P4n]</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "</div>"
       ],
       "text/plain": [
-       "                circuitstring  \\\n",
-       "0    [R1,P2]-[P3,R4]-R5-P6-R7   \n",
-       "1  [[[P1,R2],R3]-L4-R5,P6]-R7   \n",
-       "2             R1-[[R2,P3],P4]   \n",
-       "3               L1-R2-[P3,P4]   \n",
-       "4         [R1-P2,P3-R4]-P5-R6   \n",
-       "5          [P1,[P2,R3-R4]]-R5   \n",
+       "        circuitstring                                         Parameters  \\\n",
+       "0          R1-[P2,R3]  {'R1': 139.14713059888192, 'P2w': 1.9866544193...   \n",
+       "1  R1-[L2,R3]-[P4,P5]  {'R1': 142.06139721718435, 'L2': 8.43681910105...   \n",
+       "2  P1-R2-[P3,[P4,R5]]  {'P1w': 5.28017526126197e-05, 'P1n': 0.8001289...   \n",
+       "3     [[R1,P2],R3]-R4  {'R1': 4656579.086437493, 'P2w': 1.98665442036...   \n",
+       "4       R1-[R2,P3]-P4  {'R1': 139.68410281993843, 'R2': 3756228.57499...   \n",
        "\n",
-       "                                          Parameters         Resistors  \\\n",
-       "0  {'R1': 3756228.324732959, 'P2w': 2.03557677798...  [R1, R4, R5, R7]   \n",
-       "1  {'P1w': 2.3011178790923626e-06, 'P1n': 0.40321...  [R2, R3, R5, R7]   \n",
-       "2  {'R1': 142.0632231537774, 'R2': 1500000000.024...          [R1, R2]   \n",
-       "3  {'L1': 9.052611565739006e-21, 'R2': 142.061397...              [R2]   \n",
-       "4  {'R1': 3820950.8486733097, 'P2w': 198638277.40...      [R1, R4, R6]   \n",
-       "5  {'P1w': 1.7375194775324558e-06, 'P1n': 0.96242...      [R3, R4, R5]   \n",
-       "\n",
-       "  Capacitors Inductors                            CPEs  \n",
-       "0         []        []  [P2w, P2n, P3w, P3n, P6w, P6n]  \n",
-       "1         []      [L4]            [P1w, P1n, P6w, P6n]  \n",
-       "2         []        []            [P3w, P3n, P4w, P4n]  \n",
-       "3         []      [L1]            [P3w, P3n, P4w, P4n]  \n",
-       "4         []        []  [P2w, P2n, P3w, P3n, P5w, P5n]  \n",
-       "5         []        []            [P1w, P1n, P2w, P2n]  "
+       "      Resistors Capacitors Inductors                            CPEs  \n",
+       "0      [R1, R3]         []        []                      [P2w, P2n]  \n",
+       "1      [R1, R3]         []      [L2]            [P4w, P4n, P5w, P5n]  \n",
+       "2      [R2, R5]         []        []  [P1w, P1n, P3w, P3n, P4w, P4n]  \n",
+       "3  [R1, R3, R4]         []        []                      [P2w, P2n]  \n",
+       "4      [R1, R2]         []        []            [P3w, P3n, P4w, P4n]  "
       ]
      },
      "execution_count": 6,
@@ -536,34 +552,48 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 7,
+   "execution_count": 22,
    "metadata": {},
    "outputs": [
     {
      "data": {
       "application/vnd.jupyter.widget-view+json": {
-       "model_id": "1b0a5fba17f8484f9848e745a1437733",
+       "model_id": "5202ad54c7c24bd2bc2ffe7092586fd4",
        "version_major": 2,
        "version_minor": 0
       },
       "text/plain": [
-       "Bayesian Inference:   0%|          | 0/6 [00:00<?, ?it/s]"
+       "Bayesian Inference:   0%|          | 0/5 [00:00<?, ?it/s]"
       ]
      },
      "metadata": {},
      "output_type": "display_data"
+    },
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Inference failed for circuit: R1-[L2,R3]-[P4,P5]\n"
+     ]
     }
    ],
    "source": [
+    "# Make a copy of the dataframe to avoid modifying the original\n",
+    "circuits_copy = circuits.copy()\n",
     "mcmc_list = []\n",
     "\n",
-    "for row in tqdm(circuits.itertuples(), total=len(circuits), desc=\"Bayesian Inference\"):\n",
-    "    circuit = row.circuitstring\n",
-    "    p0_dict = row.Parameters\n",
-    "    # FIXME: Doesn't always converge, breaks the loop\n",
-    "    # p0_fit = ae.utils.fit_circuit_parameters(circuit, Z, freq, p0=p0_dict)\n",
-    "    kwargs_mcmc = {\"num_warmup\": 2500, \"num_samples\": 1000, \"progress_bar\": False}\n",
-    "    mcmc = ae.core.perform_bayesian_inference(circuit, Z, freq, p0_dict, **kwargs_mcmc)\n",
+    "for row in tqdm(circuits_copy.itertuples(), total=len(circuits_copy), desc=\"Bayesian Inference\"):\n",
+    "    try:\n",
+    "        circuit = row.circuitstring\n",
+    "        p0_dict = row.Parameters\n",
+    "        # FIXME: Doesn't always converge, breaks the loop\n",
+    "        # p0_fit = ae.utils.fit_circuit_parameters(circuit, Z, freq, p0=p0_dict)\n",
+    "        kwargs_mcmc = {\"num_warmup\": 2500, \"num_samples\": 1000, \"progress_bar\": False}\n",
+    "        mcmc = ae.core.perform_bayesian_inference(circuit, Z, freq, p0_dict, **kwargs_mcmc)\n",
+    "    except RuntimeError:\n",
+    "        print(f\"Inference failed for circuit: {circuit}\")\n",
+    "        circuits_copy.drop(row.Index, inplace=True)\n",
+    "        continue\n",
     "    mcmc_list.append(mcmc)"
    ]
   },
@@ -580,128 +610,36 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 8,
+   "execution_count": 23,
    "metadata": {},
    "outputs": [
     {
      "data": {
       "text/html": [
-       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-style: italic\">            [R1,P2]-[P3,R4]-R5-P6-R7, 0/1000 divergences             </span>\n",
-       "┏━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┓\n",
-       "┃<span style=\"font-weight: bold\">  Parameter </span>┃<span style=\"font-weight: bold\">     Mean </span>┃<span style=\"font-weight: bold\">      Std </span>┃<span style=\"font-weight: bold\">   Median </span>┃<span style=\"font-weight: bold\">     5.0% </span>┃<span style=\"font-weight: bold\">    95.0% </span>┃\n",
-       "┡━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━┩\n",
-       "│        P2n │ 8.11e-01 │ 1.19e-07 │ 8.11e-01 │ 8.11e-01 │ 8.11e-01 │\n",
-       "│        P2w │ 1.80e-06 │ 1.14e-13 │ 1.80e-06 │ 1.80e-06 │ 1.80e-06 │\n",
-       "│        P3n │ 3.59e-01 │ 2.98e-08 │ 3.59e-01 │ 3.59e-01 │ 3.59e-01 │\n",
-       "│        P3w │ 6.75e+08 │ 6.40e+01 │ 6.75e+08 │ 6.75e+08 │ 6.75e+08 │\n",
-       "│        P6n │ 7.12e-01 │ 5.96e-08 │ 7.12e-01 │ 7.12e-01 │ 7.12e-01 │\n",
-       "│        P6w │ 1.71e-05 │ 0.00e+00 │ 1.71e-05 │ 1.71e-05 │ 1.71e-05 │\n",
-       "│         R1 │ 4.14e+06 │ 2.50e-01 │ 4.14e+06 │ 4.14e+06 │ 4.14e+06 │\n",
-       "│         R4 │ 7.21e+08 │ 6.40e+01 │ 7.21e+08 │ 7.21e+08 │ 7.21e+08 │\n",
-       "│         R5 │ 2.15e+01 │ 0.00e+00 │ 2.15e+01 │ 2.15e+01 │ 2.15e+01 │\n",
-       "│         R7 │ 8.87e+01 │ 0.00e+00 │ 8.87e+01 │ 8.87e+01 │ 8.87e+01 │\n",
-       "│ sigma_imag │ 7.36e+00 │ 4.77e-07 │ 7.36e+00 │ 7.36e+00 │ 7.36e+00 │\n",
-       "│ sigma_real │ 1.03e+01 │ 9.54e-07 │ 1.03e+01 │ 1.03e+01 │ 1.03e+01 │\n",
-       "└────────────┴──────────┴──────────┴──────────┴──────────┴──────────┘\n",
-       "</pre>\n"
-      ],
-      "text/plain": [
-       "\u001b[3m            [R1,P2]-[P3,R4]-R5-P6-R7, 0/1000 divergences             \u001b[0m\n",
-       "┏━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┓\n",
-       "┃\u001b[1m \u001b[0m\u001b[1m Parameter\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m    Mean\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m     Std\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m  Median\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m    5.0%\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m   95.0%\u001b[0m\u001b[1m \u001b[0m┃\n",
-       "┡━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━┩\n",
-       "│        P2n │ 8.11e-01 │ 1.19e-07 │ 8.11e-01 │ 8.11e-01 │ 8.11e-01 │\n",
-       "│        P2w │ 1.80e-06 │ 1.14e-13 │ 1.80e-06 │ 1.80e-06 │ 1.80e-06 │\n",
-       "│        P3n │ 3.59e-01 │ 2.98e-08 │ 3.59e-01 │ 3.59e-01 │ 3.59e-01 │\n",
-       "│        P3w │ 6.75e+08 │ 6.40e+01 │ 6.75e+08 │ 6.75e+08 │ 6.75e+08 │\n",
-       "│        P6n │ 7.12e-01 │ 5.96e-08 │ 7.12e-01 │ 7.12e-01 │ 7.12e-01 │\n",
-       "│        P6w │ 1.71e-05 │ 0.00e+00 │ 1.71e-05 │ 1.71e-05 │ 1.71e-05 │\n",
-       "│         R1 │ 4.14e+06 │ 2.50e-01 │ 4.14e+06 │ 4.14e+06 │ 4.14e+06 │\n",
-       "│         R4 │ 7.21e+08 │ 6.40e+01 │ 7.21e+08 │ 7.21e+08 │ 7.21e+08 │\n",
-       "│         R5 │ 2.15e+01 │ 0.00e+00 │ 2.15e+01 │ 2.15e+01 │ 2.15e+01 │\n",
-       "│         R7 │ 8.87e+01 │ 0.00e+00 │ 8.87e+01 │ 8.87e+01 │ 8.87e+01 │\n",
-       "│ sigma_imag │ 7.36e+00 │ 4.77e-07 │ 7.36e+00 │ 7.36e+00 │ 7.36e+00 │\n",
-       "│ sigma_real │ 1.03e+01 │ 9.54e-07 │ 1.03e+01 │ 1.03e+01 │ 1.03e+01 │\n",
-       "└────────────┴──────────┴──────────┴──────────┴──────────┴──────────┘\n"
-      ]
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    },
-    {
-     "data": {
-      "text/html": [
-       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-style: italic\">           [[[P1,R2],R3]-L4-R5,P6]-R7, 0/1000 divergences            </span>\n",
-       "┏━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┓\n",
-       "┃<span style=\"font-weight: bold\">  Parameter </span>┃<span style=\"font-weight: bold\">     Mean </span>┃<span style=\"font-weight: bold\">      Std </span>┃<span style=\"font-weight: bold\">   Median </span>┃<span style=\"font-weight: bold\">     5.0% </span>┃<span style=\"font-weight: bold\">    95.0% </span>┃\n",
-       "┡━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━┩\n",
-       "│         L4 │ 3.63e+00 │ 2.38e-07 │ 3.63e+00 │ 3.63e+00 │ 3.63e+00 │\n",
-       "│        P1n │ 5.23e-01 │ 5.96e-08 │ 5.23e-01 │ 5.23e-01 │ 5.23e-01 │\n",
-       "│        P1w │ 5.20e-06 │ 4.55e-13 │ 5.20e-06 │ 5.20e-06 │ 5.20e-06 │\n",
-       "│        P6n │ 8.86e-01 │ 5.96e-08 │ 8.86e-01 │ 8.86e-01 │ 8.86e-01 │\n",
-       "│        P6w │ 1.72e-06 │ 0.00e+00 │ 1.72e-06 │ 1.72e-06 │ 1.72e-06 │\n",
-       "│         R2 │ 1.10e+09 │ 1.28e+02 │ 1.10e+09 │ 1.10e+09 │ 1.10e+09 │\n",
-       "│         R3 │ 1.49e+09 │ 1.28e+02 │ 1.49e+09 │ 1.49e+09 │ 1.49e+09 │\n",
-       "│         R5 │ 3.70e+06 │ 2.50e-01 │ 3.70e+06 │ 3.70e+06 │ 3.70e+06 │\n",
-       "│         R7 │ 1.42e+02 │ 1.53e-05 │ 1.42e+02 │ 1.42e+02 │ 1.42e+02 │\n",
-       "│ sigma_imag │ 6.17e+00 │ 0.00e+00 │ 6.17e+00 │ 6.17e+00 │ 6.17e+00 │\n",
-       "│ sigma_real │ 8.94e+00 │ 0.00e+00 │ 8.94e+00 │ 8.94e+00 │ 8.94e+00 │\n",
-       "└────────────┴──────────┴──────────┴──────────┴──────────┴──────────┘\n",
-       "</pre>\n"
-      ],
-      "text/plain": [
-       "\u001b[3m           [[[P1,R2],R3]-L4-R5,P6]-R7, 0/1000 divergences            \u001b[0m\n",
-       "┏━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┓\n",
-       "┃\u001b[1m \u001b[0m\u001b[1m Parameter\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m    Mean\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m     Std\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m  Median\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m    5.0%\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m   95.0%\u001b[0m\u001b[1m \u001b[0m┃\n",
-       "┡━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━┩\n",
-       "│         L4 │ 3.63e+00 │ 2.38e-07 │ 3.63e+00 │ 3.63e+00 │ 3.63e+00 │\n",
-       "│        P1n │ 5.23e-01 │ 5.96e-08 │ 5.23e-01 │ 5.23e-01 │ 5.23e-01 │\n",
-       "│        P1w │ 5.20e-06 │ 4.55e-13 │ 5.20e-06 │ 5.20e-06 │ 5.20e-06 │\n",
-       "│        P6n │ 8.86e-01 │ 5.96e-08 │ 8.86e-01 │ 8.86e-01 │ 8.86e-01 │\n",
-       "│        P6w │ 1.72e-06 │ 0.00e+00 │ 1.72e-06 │ 1.72e-06 │ 1.72e-06 │\n",
-       "│         R2 │ 1.10e+09 │ 1.28e+02 │ 1.10e+09 │ 1.10e+09 │ 1.10e+09 │\n",
-       "│         R3 │ 1.49e+09 │ 1.28e+02 │ 1.49e+09 │ 1.49e+09 │ 1.49e+09 │\n",
-       "│         R5 │ 3.70e+06 │ 2.50e-01 │ 3.70e+06 │ 3.70e+06 │ 3.70e+06 │\n",
-       "│         R7 │ 1.42e+02 │ 1.53e-05 │ 1.42e+02 │ 1.42e+02 │ 1.42e+02 │\n",
-       "│ sigma_imag │ 6.17e+00 │ 0.00e+00 │ 6.17e+00 │ 6.17e+00 │ 6.17e+00 │\n",
-       "│ sigma_real │ 8.94e+00 │ 0.00e+00 │ 8.94e+00 │ 8.94e+00 │ 8.94e+00 │\n",
-       "└────────────┴──────────┴──────────┴──────────┴──────────┴──────────┘\n"
-      ]
-     },
-     "metadata": {},
-     "output_type": "display_data"
-    },
-    {
-     "data": {
-      "text/html": [
-       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-style: italic\">                 R1-[[R2,P3],P4], 0/1000 divergences                 </span>\n",
+       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-style: italic\">                   R1-[P2,R3], 0/1000 divergences                    </span>\n",
        "┏━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┓\n",
        "┃<span style=\"font-weight: bold\">  Parameter </span>┃<span style=\"font-weight: bold\">     Mean </span>┃<span style=\"font-weight: bold\">      Std </span>┃<span style=\"font-weight: bold\">   Median </span>┃<span style=\"font-weight: bold\">     5.0% </span>┃<span style=\"font-weight: bold\">    95.0% </span>┃\n",
        "┡━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━┩\n",
-       "│        P3n │ 1.00e+00 │ 2.52e-05 │ 1.00e+00 │ 1.00e+00 │ 1.00e+00 │\n",
-       "│        P3w │ 1.55e-06 │ 2.96e-09 │ 1.55e-06 │ 1.54e-06 │ 1.55e-06 │\n",
-       "│        P4n │ 2.08e-01 │ 3.25e-04 │ 2.08e-01 │ 2.07e-01 │ 2.08e-01 │\n",
-       "│        P4w │ 4.98e-07 │ 6.75e-10 │ 4.98e-07 │ 4.96e-07 │ 4.99e-07 │\n",
-       "│<span style=\"background-color: #808000\">         R1 </span>│<span style=\"background-color: #808000\"> 4.58e+01 </span>│<span style=\"background-color: #808000\"> 5.77e+01 </span>│<span style=\"background-color: #808000\"> 2.38e+01 </span>│<span style=\"background-color: #808000\"> 1.37e+00 </span>│<span style=\"background-color: #808000\"> 1.69e+02 </span>│\n",
-       "│<span style=\"background-color: #808000\">         R2 </span>│<span style=\"background-color: #808000\"> 1.99e+11 </span>│<span style=\"background-color: #808000\"> 3.80e+11 </span>│<span style=\"background-color: #808000\"> 9.00e+10 </span>│<span style=\"background-color: #808000\"> 2.29e+10 </span>│<span style=\"background-color: #808000\"> 7.15e+11 </span>│\n",
-       "│ sigma_imag │ 5.06e+03 │ 4.43e+01 │ 5.06e+03 │ 4.99e+03 │ 5.14e+03 │\n",
-       "│ sigma_real │ 4.71e+03 │ 4.47e+01 │ 4.71e+03 │ 4.64e+03 │ 4.79e+03 │\n",
+       "│        P2n │ 6.27e-01 │ 1.37e-03 │ 6.27e-01 │ 6.25e-01 │ 6.29e-01 │\n",
+       "│        P2w │ 1.44e-06 │ 4.56e-09 │ 1.44e-06 │ 1.44e-06 │ 1.45e-06 │\n",
+       "│<span style=\"background-color: #808000\">         R1 </span>│<span style=\"background-color: #808000\"> 2.29e+01 </span>│<span style=\"background-color: #808000\"> 2.81e+01 </span>│<span style=\"background-color: #808000\"> 1.30e+01 </span>│<span style=\"background-color: #808000\"> 1.04e+00 </span>│<span style=\"background-color: #808000\"> 7.94e+01 </span>│\n",
+       "│         R3 │ 7.39e+06 │ 2.57e+04 │ 7.39e+06 │ 7.35e+06 │ 7.44e+06 │\n",
+       "│ sigma_imag │ 1.11e+04 │ 6.74e+01 │ 1.11e+04 │ 1.10e+04 │ 1.12e+04 │\n",
+       "│ sigma_real │ 1.11e+04 │ 7.14e+01 │ 1.11e+04 │ 1.10e+04 │ 1.12e+04 │\n",
        "└────────────┴──────────┴──────────┴──────────┴──────────┴──────────┘\n",
        "</pre>\n"
       ],
       "text/plain": [
-       "\u001b[3m                 R1-[[R2,P3],P4], 0/1000 divergences                 \u001b[0m\n",
+       "\u001b[3m                   R1-[P2,R3], 0/1000 divergences                    \u001b[0m\n",
        "┏━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┓\n",
        "┃\u001b[1m \u001b[0m\u001b[1m Parameter\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m    Mean\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m     Std\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m  Median\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m    5.0%\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m   95.0%\u001b[0m\u001b[1m \u001b[0m┃\n",
        "┡━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━┩\n",
-       "│        P3n │ 1.00e+00 │ 2.52e-05 │ 1.00e+00 │ 1.00e+00 │ 1.00e+00 │\n",
-       "│        P3w │ 1.55e-06 │ 2.96e-09 │ 1.55e-06 │ 1.54e-06 │ 1.55e-06 │\n",
-       "│        P4n │ 2.08e-01 │ 3.25e-04 │ 2.08e-01 │ 2.07e-01 │ 2.08e-01 │\n",
-       "│        P4w │ 4.98e-07 │ 6.75e-10 │ 4.98e-07 │ 4.96e-07 │ 4.99e-07 │\n",
-       "│\u001b[43m \u001b[0m\u001b[43m        R1\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m4.58e+01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m5.77e+01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m2.38e+01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m1.37e+00\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m1.69e+02\u001b[0m\u001b[43m \u001b[0m│\n",
-       "│\u001b[43m \u001b[0m\u001b[43m        R2\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m1.99e+11\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m3.80e+11\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m9.00e+10\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m2.29e+10\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m7.15e+11\u001b[0m\u001b[43m \u001b[0m│\n",
-       "│ sigma_imag │ 5.06e+03 │ 4.43e+01 │ 5.06e+03 │ 4.99e+03 │ 5.14e+03 │\n",
-       "│ sigma_real │ 4.71e+03 │ 4.47e+01 │ 4.71e+03 │ 4.64e+03 │ 4.79e+03 │\n",
+       "│        P2n │ 6.27e-01 │ 1.37e-03 │ 6.27e-01 │ 6.25e-01 │ 6.29e-01 │\n",
+       "│        P2w │ 1.44e-06 │ 4.56e-09 │ 1.44e-06 │ 1.44e-06 │ 1.45e-06 │\n",
+       "│\u001b[43m \u001b[0m\u001b[43m        R1\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m2.29e+01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m2.81e+01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m1.30e+01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m1.04e+00\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m7.94e+01\u001b[0m\u001b[43m \u001b[0m│\n",
+       "│         R3 │ 7.39e+06 │ 2.57e+04 │ 7.39e+06 │ 7.35e+06 │ 7.44e+06 │\n",
+       "│ sigma_imag │ 1.11e+04 │ 6.74e+01 │ 1.11e+04 │ 1.10e+04 │ 1.12e+04 │\n",
+       "│ sigma_real │ 1.11e+04 │ 7.14e+01 │ 1.11e+04 │ 1.10e+04 │ 1.12e+04 │\n",
        "└────────────┴──────────┴──────────┴──────────┴──────────┴──────────┘\n"
       ]
      },
@@ -711,34 +649,38 @@
     {
      "data": {
       "text/html": [
-       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-style: italic\">                  L1-R2-[P3,P4], 0/1000 divergences                  </span>\n",
+       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-style: italic\">               P1-R2-[P3,[P4,R5]], 0/1000 divergences                </span>\n",
        "┏━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┓\n",
        "┃<span style=\"font-weight: bold\">  Parameter </span>┃<span style=\"font-weight: bold\">     Mean </span>┃<span style=\"font-weight: bold\">      Std </span>┃<span style=\"font-weight: bold\">   Median </span>┃<span style=\"font-weight: bold\">     5.0% </span>┃<span style=\"font-weight: bold\">    95.0% </span>┃\n",
        "┡━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━┩\n",
-       "│<span style=\"background-color: #808000\">         L1 </span>│<span style=\"background-color: #808000\"> 8.83e-20 </span>│<span style=\"background-color: #808000\"> 5.99e-19 </span>│<span style=\"background-color: #808000\"> 8.59e-21 </span>│<span style=\"background-color: #808000\"> 2.64e-22 </span>│<span style=\"background-color: #808000\"> 2.62e-19 </span>│\n",
-       "│        P3n │ 2.08e-01 │ 3.46e-04 │ 2.08e-01 │ 2.07e-01 │ 2.08e-01 │\n",
-       "│        P3w │ 4.98e-07 │ 7.38e-10 │ 4.98e-07 │ 4.96e-07 │ 4.99e-07 │\n",
-       "│        P4n │ 1.00e+00 │ 2.51e-05 │ 1.00e+00 │ 1.00e+00 │ 1.00e+00 │\n",
-       "│        P4w │ 1.55e-06 │ 3.10e-09 │ 1.55e-06 │ 1.54e-06 │ 1.55e-06 │\n",
-       "│<span style=\"background-color: #808000\">         R2 </span>│<span style=\"background-color: #808000\"> 4.20e+01 </span>│<span style=\"background-color: #808000\"> 5.51e+01 </span>│<span style=\"background-color: #808000\"> 2.23e+01 </span>│<span style=\"background-color: #808000\"> 1.21e+00 </span>│<span style=\"background-color: #808000\"> 1.51e+02 </span>│\n",
-       "│ sigma_imag │ 5.07e+03 │ 4.56e+01 │ 5.07e+03 │ 4.99e+03 │ 5.14e+03 │\n",
-       "│ sigma_real │ 4.71e+03 │ 4.37e+01 │ 4.71e+03 │ 4.64e+03 │ 4.78e+03 │\n",
+       "│        P1n │ 5.87e-01 │ 2.01e-03 │ 5.87e-01 │ 5.84e-01 │ 5.90e-01 │\n",
+       "│        P1w │ 1.23e-05 │ 2.24e-07 │ 1.23e-05 │ 1.19e-05 │ 1.27e-05 │\n",
+       "│        P3n │ 1.25e-01 │ 6.75e-04 │ 1.25e-01 │ 1.24e-01 │ 1.26e-01 │\n",
+       "│        P3w │ 4.37e-07 │ 4.64e-10 │ 4.37e-07 │ 4.36e-07 │ 4.38e-07 │\n",
+       "│        P4n │ 1.00e+00 │ 4.52e-05 │ 1.00e+00 │ 1.00e+00 │ 1.00e+00 │\n",
+       "│        P4w │ 2.05e-06 │ 6.77e-09 │ 2.05e-06 │ 2.04e-06 │ 2.06e-06 │\n",
+       "│<span style=\"background-color: #808000\">         R2 </span>│<span style=\"background-color: #808000\"> 2.33e+01 </span>│<span style=\"background-color: #808000\"> 2.83e+01 </span>│<span style=\"background-color: #808000\"> 1.30e+01 </span>│<span style=\"background-color: #808000\"> 9.67e-01 </span>│<span style=\"background-color: #808000\"> 8.84e+01 </span>│\n",
+       "│<span style=\"background-color: #808000\">         R5 </span>│<span style=\"background-color: #808000\"> 4.63e+10 </span>│<span style=\"background-color: #808000\"> 1.40e+11 </span>│<span style=\"background-color: #808000\"> 1.04e+10 </span>│<span style=\"background-color: #808000\"> 1.80e+09 </span>│<span style=\"background-color: #808000\"> 1.68e+11 </span>│\n",
+       "│ sigma_imag │ 2.01e+03 │ 3.72e+01 │ 2.01e+03 │ 1.95e+03 │ 2.07e+03 │\n",
+       "│ sigma_real │ 2.31e+03 │ 3.83e+01 │ 2.31e+03 │ 2.24e+03 │ 2.37e+03 │\n",
        "└────────────┴──────────┴──────────┴──────────┴──────────┴──────────┘\n",
        "</pre>\n"
       ],
       "text/plain": [
-       "\u001b[3m                  L1-R2-[P3,P4], 0/1000 divergences                  \u001b[0m\n",
+       "\u001b[3m               P1-R2-[P3,[P4,R5]], 0/1000 divergences                \u001b[0m\n",
        "┏━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┓\n",
        "┃\u001b[1m \u001b[0m\u001b[1m Parameter\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m    Mean\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m     Std\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m  Median\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m    5.0%\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m   95.0%\u001b[0m\u001b[1m \u001b[0m┃\n",
        "┡━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━┩\n",
-       "│\u001b[43m \u001b[0m\u001b[43m        L1\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m8.83e-20\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m5.99e-19\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m8.59e-21\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m2.64e-22\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m2.62e-19\u001b[0m\u001b[43m \u001b[0m│\n",
-       "│        P3n │ 2.08e-01 │ 3.46e-04 │ 2.08e-01 │ 2.07e-01 │ 2.08e-01 │\n",
-       "│        P3w │ 4.98e-07 │ 7.38e-10 │ 4.98e-07 │ 4.96e-07 │ 4.99e-07 │\n",
-       "│        P4n │ 1.00e+00 │ 2.51e-05 │ 1.00e+00 │ 1.00e+00 │ 1.00e+00 │\n",
-       "│        P4w │ 1.55e-06 │ 3.10e-09 │ 1.55e-06 │ 1.54e-06 │ 1.55e-06 │\n",
-       "│\u001b[43m \u001b[0m\u001b[43m        R2\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m4.20e+01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m5.51e+01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m2.23e+01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m1.21e+00\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m1.51e+02\u001b[0m\u001b[43m \u001b[0m│\n",
-       "│ sigma_imag │ 5.07e+03 │ 4.56e+01 │ 5.07e+03 │ 4.99e+03 │ 5.14e+03 │\n",
-       "│ sigma_real │ 4.71e+03 │ 4.37e+01 │ 4.71e+03 │ 4.64e+03 │ 4.78e+03 │\n",
+       "│        P1n │ 5.87e-01 │ 2.01e-03 │ 5.87e-01 │ 5.84e-01 │ 5.90e-01 │\n",
+       "│        P1w │ 1.23e-05 │ 2.24e-07 │ 1.23e-05 │ 1.19e-05 │ 1.27e-05 │\n",
+       "│        P3n │ 1.25e-01 │ 6.75e-04 │ 1.25e-01 │ 1.24e-01 │ 1.26e-01 │\n",
+       "│        P3w │ 4.37e-07 │ 4.64e-10 │ 4.37e-07 │ 4.36e-07 │ 4.38e-07 │\n",
+       "│        P4n │ 1.00e+00 │ 4.52e-05 │ 1.00e+00 │ 1.00e+00 │ 1.00e+00 │\n",
+       "│        P4w │ 2.05e-06 │ 6.77e-09 │ 2.05e-06 │ 2.04e-06 │ 2.06e-06 │\n",
+       "│\u001b[43m \u001b[0m\u001b[43m        R2\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m2.33e+01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m2.83e+01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m1.30e+01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m9.67e-01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m8.84e+01\u001b[0m\u001b[43m \u001b[0m│\n",
+       "│\u001b[43m \u001b[0m\u001b[43m        R5\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m4.63e+10\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m1.40e+11\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m1.04e+10\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m1.80e+09\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m1.68e+11\u001b[0m\u001b[43m \u001b[0m│\n",
+       "│ sigma_imag │ 2.01e+03 │ 3.72e+01 │ 2.01e+03 │ 1.95e+03 │ 2.07e+03 │\n",
+       "│ sigma_real │ 2.31e+03 │ 3.83e+01 │ 2.31e+03 │ 2.24e+03 │ 2.37e+03 │\n",
        "└────────────┴──────────┴──────────┴──────────┴──────────┴──────────┘\n"
       ]
      },
@@ -748,40 +690,32 @@
     {
      "data": {
       "text/html": [
-       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-style: italic\">               [R1-P2,P3-R4]-P5-R6, 0/1000 divergences               </span>\n",
+       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-style: italic\">                [[R1,P2],R3]-R4, 32/1000 divergences                 </span>\n",
        "┏━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┓\n",
        "┃<span style=\"font-weight: bold\">  Parameter </span>┃<span style=\"font-weight: bold\">     Mean </span>┃<span style=\"font-weight: bold\">      Std </span>┃<span style=\"font-weight: bold\">   Median </span>┃<span style=\"font-weight: bold\">     5.0% </span>┃<span style=\"font-weight: bold\">    95.0% </span>┃\n",
        "┡━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━┩\n",
-       "│        P2n │ 4.92e-01 │ 2.88e-01 │ 4.83e-01 │ 4.70e-02 │ 9.45e-01 │\n",
-       "│<span style=\"background-color: #808000\">        P2w </span>│<span style=\"background-color: #808000\"> 2.01e+09 </span>│<span style=\"background-color: #808000\"> 9.75e+09 </span>│<span style=\"background-color: #808000\"> 2.25e+08 </span>│<span style=\"background-color: #808000\"> 4.98e+06 </span>│<span style=\"background-color: #808000\"> 7.26e+09 </span>│\n",
-       "│        P3n │ 8.94e-01 │ 1.43e-03 │ 8.94e-01 │ 8.92e-01 │ 8.97e-01 │\n",
-       "│        P3w │ 2.41e-06 │ 1.27e-08 │ 2.41e-06 │ 2.39e-06 │ 2.43e-06 │\n",
-       "│        P5n │ 5.55e-01 │ 1.78e-03 │ 5.55e-01 │ 5.52e-01 │ 5.58e-01 │\n",
-       "│        P5w │ 5.93e-06 │ 7.27e-08 │ 5.93e-06 │ 5.81e-06 │ 6.05e-06 │\n",
-       "│         R1 │ 3.21e+06 │ 1.24e+04 │ 3.21e+06 │ 3.19e+06 │ 3.23e+06 │\n",
-       "│<span style=\"background-color: #808000\">         R4 </span>│<span style=\"background-color: #808000\"> 1.07e+01 </span>│<span style=\"background-color: #808000\"> 1.64e+01 </span>│<span style=\"background-color: #808000\"> 4.85e+00 </span>│<span style=\"background-color: #808000\"> 2.07e-01 </span>│<span style=\"background-color: #808000\"> 4.14e+01 </span>│\n",
-       "│<span style=\"background-color: #808000\">         R6 </span>│<span style=\"background-color: #808000\"> 1.55e+01 </span>│<span style=\"background-color: #808000\"> 1.92e+01 </span>│<span style=\"background-color: #808000\"> 8.51e+00 </span>│<span style=\"background-color: #808000\"> 5.82e-01 </span>│<span style=\"background-color: #808000\"> 5.25e+01 </span>│\n",
-       "│ sigma_imag │ 3.50e+03 │ 3.73e+01 │ 3.50e+03 │ 3.44e+03 │ 3.56e+03 │\n",
-       "│ sigma_real │ 5.27e+03 │ 4.63e+01 │ 5.27e+03 │ 5.19e+03 │ 5.35e+03 │\n",
+       "│        P2n │ 6.27e-01 │ 1.46e-03 │ 6.27e-01 │ 6.25e-01 │ 6.30e-01 │\n",
+       "│        P2w │ 1.44e-06 │ 4.81e-09 │ 1.44e-06 │ 1.44e-06 │ 1.45e-06 │\n",
+       "│         R1 │ 7.42e+06 │ 4.09e+04 │ 7.42e+06 │ 7.36e+06 │ 7.50e+06 │\n",
+       "│<span style=\"background-color: #808000\">         R3 </span>│<span style=\"background-color: #808000\"> 1.59e+10 </span>│<span style=\"background-color: #808000\"> 1.05e+11 </span>│<span style=\"background-color: #808000\"> 2.61e+09 </span>│<span style=\"background-color: #808000\"> 6.11e+08 </span>│<span style=\"background-color: #808000\"> 5.24e+10 </span>│\n",
+       "│<span style=\"background-color: #808000\">         R4 </span>│<span style=\"background-color: #808000\"> 2.08e+01 </span>│<span style=\"background-color: #808000\"> 2.63e+01 </span>│<span style=\"background-color: #808000\"> 1.11e+01 </span>│<span style=\"background-color: #808000\"> 7.44e-01 </span>│<span style=\"background-color: #808000\"> 7.50e+01 </span>│\n",
+       "│ sigma_imag │ 1.11e+04 │ 7.70e+01 │ 1.11e+04 │ 1.10e+04 │ 1.13e+04 │\n",
+       "│ sigma_real │ 1.11e+04 │ 7.89e+01 │ 1.11e+04 │ 1.10e+04 │ 1.13e+04 │\n",
        "└────────────┴──────────┴──────────┴──────────┴──────────┴──────────┘\n",
        "</pre>\n"
       ],
       "text/plain": [
-       "\u001b[3m               [R1-P2,P3-R4]-P5-R6, 0/1000 divergences               \u001b[0m\n",
+       "\u001b[3m                [[R1,P2],R3]-R4, 32/1000 divergences                 \u001b[0m\n",
        "┏━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┓\n",
        "┃\u001b[1m \u001b[0m\u001b[1m Parameter\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m    Mean\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m     Std\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m  Median\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m    5.0%\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m   95.0%\u001b[0m\u001b[1m \u001b[0m┃\n",
        "┡━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━┩\n",
-       "│        P2n │ 4.92e-01 │ 2.88e-01 │ 4.83e-01 │ 4.70e-02 │ 9.45e-01 │\n",
-       "│\u001b[43m \u001b[0m\u001b[43m       P2w\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m2.01e+09\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m9.75e+09\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m2.25e+08\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m4.98e+06\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m7.26e+09\u001b[0m\u001b[43m \u001b[0m│\n",
-       "│        P3n │ 8.94e-01 │ 1.43e-03 │ 8.94e-01 │ 8.92e-01 │ 8.97e-01 │\n",
-       "│        P3w │ 2.41e-06 │ 1.27e-08 │ 2.41e-06 │ 2.39e-06 │ 2.43e-06 │\n",
-       "│        P5n │ 5.55e-01 │ 1.78e-03 │ 5.55e-01 │ 5.52e-01 │ 5.58e-01 │\n",
-       "│        P5w │ 5.93e-06 │ 7.27e-08 │ 5.93e-06 │ 5.81e-06 │ 6.05e-06 │\n",
-       "│         R1 │ 3.21e+06 │ 1.24e+04 │ 3.21e+06 │ 3.19e+06 │ 3.23e+06 │\n",
-       "│\u001b[43m \u001b[0m\u001b[43m        R4\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m1.07e+01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m1.64e+01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m4.85e+00\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m2.07e-01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m4.14e+01\u001b[0m\u001b[43m \u001b[0m│\n",
-       "│\u001b[43m \u001b[0m\u001b[43m        R6\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m1.55e+01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m1.92e+01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m8.51e+00\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m5.82e-01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m5.25e+01\u001b[0m\u001b[43m \u001b[0m│\n",
-       "│ sigma_imag │ 3.50e+03 │ 3.73e+01 │ 3.50e+03 │ 3.44e+03 │ 3.56e+03 │\n",
-       "│ sigma_real │ 5.27e+03 │ 4.63e+01 │ 5.27e+03 │ 5.19e+03 │ 5.35e+03 │\n",
+       "│        P2n │ 6.27e-01 │ 1.46e-03 │ 6.27e-01 │ 6.25e-01 │ 6.30e-01 │\n",
+       "│        P2w │ 1.44e-06 │ 4.81e-09 │ 1.44e-06 │ 1.44e-06 │ 1.45e-06 │\n",
+       "│         R1 │ 7.42e+06 │ 4.09e+04 │ 7.42e+06 │ 7.36e+06 │ 7.50e+06 │\n",
+       "│\u001b[43m \u001b[0m\u001b[43m        R3\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m1.59e+10\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m1.05e+11\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m2.61e+09\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m6.11e+08\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m5.24e+10\u001b[0m\u001b[43m \u001b[0m│\n",
+       "│\u001b[43m \u001b[0m\u001b[43m        R4\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m2.08e+01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m2.63e+01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m1.11e+01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m7.44e-01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m7.50e+01\u001b[0m\u001b[43m \u001b[0m│\n",
+       "│ sigma_imag │ 1.11e+04 │ 7.70e+01 │ 1.11e+04 │ 1.10e+04 │ 1.13e+04 │\n",
+       "│ sigma_real │ 1.11e+04 │ 7.89e+01 │ 1.11e+04 │ 1.10e+04 │ 1.13e+04 │\n",
        "└────────────┴──────────┴──────────┴──────────┴──────────┴──────────┘\n"
       ]
      },
@@ -791,36 +725,34 @@
     {
      "data": {
       "text/html": [
-       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-style: italic\">               [P1,[P2,R3-R4]]-R5, 0/1000 divergences                </span>\n",
+       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"font-style: italic\">                 R1-[R2,P3]-P4, 67/1000 divergences                  </span>\n",
        "┏━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┓\n",
        "┃<span style=\"font-weight: bold\">  Parameter </span>┃<span style=\"font-weight: bold\">     Mean </span>┃<span style=\"font-weight: bold\">      Std </span>┃<span style=\"font-weight: bold\">   Median </span>┃<span style=\"font-weight: bold\">     5.0% </span>┃<span style=\"font-weight: bold\">    95.0% </span>┃\n",
        "┡━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━┩\n",
-       "│        P1n │ 1.00e+00 │ 2.22e-05 │ 1.00e+00 │ 1.00e+00 │ 1.00e+00 │\n",
-       "│        P1w │ 1.55e-06 │ 2.81e-09 │ 1.55e-06 │ 1.54e-06 │ 1.55e-06 │\n",
-       "│        P2n │ 2.08e-01 │ 3.03e-04 │ 2.08e-01 │ 2.07e-01 │ 2.08e-01 │\n",
-       "│        P2w │ 4.98e-07 │ 6.42e-10 │ 4.98e-07 │ 4.97e-07 │ 4.99e-07 │\n",
-       "│<span style=\"background-color: #808000\">         R3 </span>│<span style=\"background-color: #808000\"> 1.19e+11 </span>│<span style=\"background-color: #808000\"> 3.81e+11 </span>│<span style=\"background-color: #808000\"> 1.90e+10 </span>│<span style=\"background-color: #808000\"> 5.83e+07 </span>│<span style=\"background-color: #808000\"> 4.69e+11 </span>│\n",
-       "│<span style=\"background-color: #808000\">         R4 </span>│<span style=\"background-color: #808000\"> 1.32e+11 </span>│<span style=\"background-color: #808000\"> 5.43e+11 </span>│<span style=\"background-color: #808000\"> 2.41e+10 </span>│<span style=\"background-color: #808000\"> 4.46e+07 </span>│<span style=\"background-color: #808000\"> 4.72e+11 </span>│\n",
-       "│<span style=\"background-color: #808000\">         R5 </span>│<span style=\"background-color: #808000\"> 4.19e+01 </span>│<span style=\"background-color: #808000\"> 5.65e+01 </span>│<span style=\"background-color: #808000\"> 2.04e+01 </span>│<span style=\"background-color: #808000\"> 1.42e+00 </span>│<span style=\"background-color: #808000\"> 1.52e+02 </span>│\n",
-       "│ sigma_imag │ 5.06e+03 │ 4.39e+01 │ 5.06e+03 │ 4.99e+03 │ 5.14e+03 │\n",
-       "│ sigma_real │ 4.71e+03 │ 4.36e+01 │ 4.71e+03 │ 4.64e+03 │ 4.78e+03 │\n",
+       "│        P3n │ 8.34e-01 │ 5.96e-08 │ 8.34e-01 │ 8.34e-01 │ 8.34e-01 │\n",
+       "│        P3w │ 1.95e-06 │ 0.00e+00 │ 1.95e-06 │ 1.95e-06 │ 1.95e-06 │\n",
+       "│        P4n │ 6.49e-01 │ 0.00e+00 │ 6.49e-01 │ 6.49e-01 │ 6.49e-01 │\n",
+       "│        P4w │ 1.13e-05 │ 0.00e+00 │ 1.13e-05 │ 1.13e-05 │ 1.13e-05 │\n",
+       "│         R1 │ 3.03e+02 │ 3.05e-05 │ 3.03e+02 │ 3.03e+02 │ 3.03e+02 │\n",
+       "│         R2 │ 3.82e+06 │ 2.50e-01 │ 3.82e+06 │ 3.82e+06 │ 3.82e+06 │\n",
+       "│ sigma_imag │ 5.65e+00 │ 0.00e+00 │ 5.65e+00 │ 5.65e+00 │ 5.65e+00 │\n",
+       "│ sigma_real │ 7.92e+00 │ 0.00e+00 │ 7.92e+00 │ 7.92e+00 │ 7.92e+00 │\n",
        "└────────────┴──────────┴──────────┴──────────┴──────────┴──────────┘\n",
        "</pre>\n"
       ],
       "text/plain": [
-       "\u001b[3m               [P1,[P2,R3-R4]]-R5, 0/1000 divergences                \u001b[0m\n",
+       "\u001b[3m                 R1-[R2,P3]-P4, 67/1000 divergences                  \u001b[0m\n",
        "┏━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┓\n",
        "┃\u001b[1m \u001b[0m\u001b[1m Parameter\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m    Mean\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m     Std\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m  Median\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m    5.0%\u001b[0m\u001b[1m \u001b[0m┃\u001b[1m \u001b[0m\u001b[1m   95.0%\u001b[0m\u001b[1m \u001b[0m┃\n",
        "┡━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━┩\n",
-       "│        P1n │ 1.00e+00 │ 2.22e-05 │ 1.00e+00 │ 1.00e+00 │ 1.00e+00 │\n",
-       "│        P1w │ 1.55e-06 │ 2.81e-09 │ 1.55e-06 │ 1.54e-06 │ 1.55e-06 │\n",
-       "│        P2n │ 2.08e-01 │ 3.03e-04 │ 2.08e-01 │ 2.07e-01 │ 2.08e-01 │\n",
-       "│        P2w │ 4.98e-07 │ 6.42e-10 │ 4.98e-07 │ 4.97e-07 │ 4.99e-07 │\n",
-       "│\u001b[43m \u001b[0m\u001b[43m        R3\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m1.19e+11\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m3.81e+11\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m1.90e+10\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m5.83e+07\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m4.69e+11\u001b[0m\u001b[43m \u001b[0m│\n",
-       "│\u001b[43m \u001b[0m\u001b[43m        R4\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m1.32e+11\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m5.43e+11\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m2.41e+10\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m4.46e+07\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m4.72e+11\u001b[0m\u001b[43m \u001b[0m│\n",
-       "│\u001b[43m \u001b[0m\u001b[43m        R5\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m4.19e+01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m5.65e+01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m2.04e+01\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m1.42e+00\u001b[0m\u001b[43m \u001b[0m│\u001b[43m \u001b[0m\u001b[43m1.52e+02\u001b[0m\u001b[43m \u001b[0m│\n",
-       "│ sigma_imag │ 5.06e+03 │ 4.39e+01 │ 5.06e+03 │ 4.99e+03 │ 5.14e+03 │\n",
-       "│ sigma_real │ 4.71e+03 │ 4.36e+01 │ 4.71e+03 │ 4.64e+03 │ 4.78e+03 │\n",
+       "│        P3n │ 8.34e-01 │ 5.96e-08 │ 8.34e-01 │ 8.34e-01 │ 8.34e-01 │\n",
+       "│        P3w │ 1.95e-06 │ 0.00e+00 │ 1.95e-06 │ 1.95e-06 │ 1.95e-06 │\n",
+       "│        P4n │ 6.49e-01 │ 0.00e+00 │ 6.49e-01 │ 6.49e-01 │ 6.49e-01 │\n",
+       "│        P4w │ 1.13e-05 │ 0.00e+00 │ 1.13e-05 │ 1.13e-05 │ 1.13e-05 │\n",
+       "│         R1 │ 3.03e+02 │ 3.05e-05 │ 3.03e+02 │ 3.03e+02 │ 3.03e+02 │\n",
+       "│         R2 │ 3.82e+06 │ 2.50e-01 │ 3.82e+06 │ 3.82e+06 │ 3.82e+06 │\n",
+       "│ sigma_imag │ 5.65e+00 │ 0.00e+00 │ 5.65e+00 │ 5.65e+00 │ 5.65e+00 │\n",
+       "│ sigma_real │ 7.92e+00 │ 0.00e+00 │ 7.92e+00 │ 7.92e+00 │ 7.92e+00 │\n",
        "└────────────┴──────────┴──────────┴──────────┴──────────┴──────────┘\n"
       ]
      },
@@ -829,7 +761,7 @@
     }
    ],
    "source": [
-    "for mcmc, circuit in zip(mcmc_list, circuits.circuitstring):\n",
+    "for mcmc, circuit in zip(mcmc_list, circuits_copy.circuitstring):\n",
     "    ae.visualization.print_summary_statistics(mcmc, circuit)"
    ]
   },
@@ -848,7 +780,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 9,
+   "execution_count": 24,
    "metadata": {
     "tags": []
    },
@@ -903,7 +835,7 @@
     "    display(dropdown, output)\n",
     "\n",
     "# Cache rendered plots to avoid re-rendering\n",
-    "circuits_str = circuits[\"circuitstring\"].tolist()\n",
+    "circuits_str = circuits_copy[\"circuitstring\"].tolist()\n",
     "trace_plots = [plot_trace_all(mcmc, cstr) for mcmc, cstr in zip(mcmc_list, circuits_str)]\n",
     "\n",
     "if interactive:\n",
@@ -925,7 +857,7 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 10,
+   "execution_count": 26,
    "metadata": {},
    "outputs": [],
    "source": [
@@ -963,7 +895,7 @@
     "    display(dropdown, output)\n",
     "\n",
     "# Cache rendered plots to avoid re-rendering\n",
-    "circuits_str = circuits[\"circuitstring\"].tolist()\n",
+    "circuits_str = circuits_copy[\"circuitstring\"].tolist()\n",
     "nyquist_plots = [plot_nyquist(mcmc, circuit) for mcmc, circuit in zip(mcmc_list, circuits_str)]\n",
     "\n",
     "if interactive:\n",
diff --git a/pyproject.toml b/pyproject.toml
index 2cd0d3a9..99658fb8 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -43,6 +43,7 @@ dependencies = [
     "numpy",
     "numpyro",
     "pandas",
+    "psutil",
     "pyparsing",
     "rich",
     "scikit-learn",


Test patch:
diff --git a/tests/test_core.py b/tests/test_core.py
index 1bb20645..5c5d1245 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -1,6 +1,7 @@
 import numpy as np
+import pandas as pd
 
-from autoeis import core, utils
+from autoeis import core, io, utils
 
 
 def test_compute_ohmic_resistance():
@@ -25,3 +26,33 @@ def test_compute_ohmic_resistance_missing_high_freq():
     # When high frequency measurements are missing, Re(Z) @ max(freq) is good approximation
     Zreal_at_high_freq = Z.real[np.argmax(freq)]
     np.testing.assert_allclose(R, Zreal_at_high_freq)
+
+
+def test_gep_serial():
+    Z, freq = io.load_test_dataset()
+    Z, freq, rmse = core.preprocess_impedance_data(Z, freq, threshold=5e-2)
+    kwargs = {
+        "iters": 2,
+        "complexity": 12,
+        "population_size": 10,
+        "generations": 5,
+        "tol": 1e-2,
+        "parallel": False,
+    }
+    circuits = core.generate_equivalent_circuits(Z, freq, **kwargs)
+    assert isinstance(circuits, pd.DataFrame)
+
+
+def test_gep_parallel():
+    Z, freq = io.load_test_dataset()
+    Z, freq, rmse = core.preprocess_impedance_data(Z, freq, threshold=5e-2)
+    kwargs = {
+        "iters": 2,
+        "complexity": 12,
+        "population_size": 10,
+        "generations": 5,
+        "tol": 1e-2,
+        "parallel": True,
+    }
+    circuits = core.generate_equivalent_circuits(Z, freq, **kwargs)
+    assert isinstance(circuits, pd.DataFrame)