nDot.io physics
05-ilang-free-fall / 11-bound-pair
11bound pairverified

Determines the bound level of two bodies of different types with a binding, its curvature against the inertias and the cost, and the clock rates of the parts, with no field.

Code of version 2

check_bound_pair.py41 KB · raw
"""Check for 05-ilang-free-fall/11-bound-pair, derivation v2 (role: check).

Part 1 is the check of v1, unchanged: numerical diagonalization of the fibre contract H(P)
of (11.1) on the finite range r = -L..L (open ends), for diagonal on-site bindings, and
comparison with the derivation:
  - exact relations (11.5)-(11.9) of item 2 (all parameter sets),
  - the bound-level equation (11.10) of item 3(a) (all sets),
  - the closed forms (11.12), (11.14), (11.16) of items 3 and 4 (sets in the regime R),
  - the scaling of the deviations with epsilon (scan).
Two solvers are used for the same matrix: a dense one (all eigenvectors, once per
set and P) and a banded shift-and-invert one (for the finite differences and the
doubled range); their bound levels are compared.
In the outputs of Part 1, "Gamma" is the expectation value of the symmetry Xi of Step 6.

Part 2 checks what is new in v2:
  - I3: the reading statistics of the clock of a part, (11.19), with the rate at the mean level,
        the rate to first order (11.25) and its closed form in the regime R (11.26);
  - I4: the order eps^6 of the contribution of w22 to the bound level;
  - I5: the bound eigenvector at j(P) = 0;
  - I2: twofold bound levels: (11.23), (11.24) and the identities for every eigenvector;
  - I1: the operator C_bod of (11.21) on a small system given in the places.
Outputs: output/check_bound_pair.json, output/check_bound_pair.txt
"""
import json
from pathlib import Path

import numpy as np
from scipy.linalg import solve_banded
from scipy.optimize import minimize_scalar

OUT = Path(__file__).parent / "output"
OUT.mkdir(parents=True, exist_ok=True)

s0 = np.eye(2)
sx = np.array([[0.0, 1.0], [1.0, 0.0]])
sz = np.diag([1.0, -1.0])
SX1, SX2 = np.kron(sx, s0), np.kron(s0, sx)
SZ1, SZ2 = np.kron(sz, s0), np.kron(s0, sz)


def fibre_ops(P, p, L, eta):
    """Fibre operators on r=-L..L; index 4*(r+L)+2*(s1-1)+(s2-1)."""
    n = 2 * L + 1
    S = np.eye(n, k=-1)          # (S psi)(r) = psi(r-1)
    Sd = S.T
    e1, e2 = np.exp(1j * eta * P), np.exp(1j * (1 - eta) * P)
    A1 = 0.5j * p["tau1"] * np.kron(e1 * Sd - np.conj(e1) * S, SX1)
    A2 = 0.5j * p["tau2"] * np.kron(e2 * S - np.conj(e2) * Sd, SX2)
    V1 = -0.5 * p["tau1"] * np.kron(e1 * Sd + np.conj(e1) * S, SX1)
    V2 = -0.5 * p["tau2"] * np.kron(e2 * S + np.conj(e2) * Sd, SX2)
    Z1, Z2 = np.kron(np.eye(n), SZ1), np.kron(np.eye(n), SZ2)
    U = np.zeros((4 * n, 4 * n))
    U[4 * L:4 * L + 4, 4 * L:4 * L + 4] = np.diag(p["w"])   # w11, w12, w21, w22
    return A1, A2, V1, V2, Z1, Z2, U


def bands(P, p, nq=4001):
    """The four two-body bands (11.2) at the total label P: (lower edge, upper edge)."""
    q = np.linspace(-np.pi, np.pi, nq)
    om1 = np.sqrt(p["M1"] ** 2 + p["tau1"] ** 2 * np.sin(0.5 * P + q) ** 2)
    om2 = np.sqrt(p["M2"] ** 2 + p["tau2"] ** 2 * np.sin(0.5 * P - q) ** 2)
    return {f"{a:+d}{b:+d}": (float((a * om1 + b * om2).min()), float((a * om1 + b * om2).max()))
            for a in (1, -1) for b in (1, -1)}


def edge(P, p):
    """Edge of the (++) band next to the level: lower edge for w11<0, upper edge for w11>0."""
    return bands(P, p)["+1+1"][0 if p["w"][0] < 0 else 1]


def solve_full(P, p, L, eta=0.5):
    """Dense diagonalization; bound level = eigenvector of largest weight at (r=0, s=11)."""
    A1, A2, V1, V2, Z1, Z2, U = fibre_ops(P, p, L, eta)
    H = A1 + A2 + p["M1"] * Z1 + p["M2"] * Z2 + U
    E, X = np.linalg.eigh(H)
    b = int(np.argmax(np.abs(X[4 * L, :]) ** 2))
    psi = X[:, b]
    ex = lambda O: float(np.real(np.vdot(psi, O @ psi)))
    amp = X.conj().T @ ((eta * V1 + (1 - eta) * V2) @ psi)
    mask = np.ones(len(E), bool)
    mask[b] = False
    resolvent_sum = float(np.sum(np.abs(amp[mask]) ** 2 / (E[mask] - E[b])))
    d2H = -(eta ** 2) * ex(A1) - (1 - eta) ** 2 * ex(A2)
    r = np.repeat(np.arange(-L, L + 1), 4)
    Gam = ((-1.0) ** np.abs(r)) * np.tile(np.diag(SZ1 @ SZ2), 2 * L + 1)   # symmetry Xi of Step 6
    return dict(E=float(E[b]), s3_1=ex(Z1), s3_2=ex(Z2), A1=ex(A1), A2=ex(A2), U=ex(U),
                V1=ex(V1), V2=ex(V2), Epp_formula=d2H - 2 * resolvent_sum,
                weight0=float(np.abs(psi[4 * L]) ** 2),
                tail=float(np.sum(np.abs(psi[np.abs(r) > L // 2]) ** 2)),
                Gamma=float(np.real(np.sum(Gam * np.abs(psi) ** 2))))


def solve(P, p, L, ref, eta=0.5, theta=1.0):
    """Banded solver: the eigenvalue of H(P) nearest to ref, by inverse iteration from the
    vector (r=0, s=11), four steps at the shift ref and then Rayleigh-quotient steps."""
    n = 4 * (2 * L + 1)
    low = np.zeros((8, n), complex)              # lower band storage: low[k, j] = H[j+k, j]
    low[0, :] = np.tile(np.diag(p["M1"] * SZ1 + p["M2"] * SZ2), 2 * L + 1)
    low[0, 4 * L:4 * L + 4] += theta * np.array(p["w"])
    e1, e2 = np.exp(1j * eta * P), np.exp(1j * (1 - eta) * P)
    B = -0.5j * p["tau1"] * np.conj(e1) * SX1 + 0.5j * p["tau2"] * e2 * SX2   # block (r+1, r): coefficient of S
    for s_row in range(4):
        for s_col in range(4):
            low[4 + s_row - s_col, s_col:n - 4:4] = B[s_row, s_col]
    full = np.zeros((15, n), complex)            # storage of solve_banded: full[7+i-j, j] = H[i, j]
    for k in range(8):
        full[7 + k, :n - k] = low[k, :n - k]
        if k:
            full[7 - k, k:] = np.conj(low[k, :n - k])

    def matvec(v):
        out = low[0] * v
        for k in range(1, 8):
            out[k:] += low[k, :n - k] * v[:n - k]
            out[:n - k] += np.conj(low[k, :n - k]) * v[k:]
        return out

    v = np.zeros(n, complex)
    v[4 * L] = 1.0
    shift, E = ref, ref
    for it in range(12):
        m = full.copy()
        m[7] -= shift
        try:
            v = solve_banded((7, 7), m, v)
        except np.linalg.LinAlgError:
            break
        v /= np.linalg.norm(v)
        Hv = matvec(v)
        E = float(np.real(np.vdot(v, Hv)))
        if np.linalg.norm(Hv - E * v) < 1e-13:
            break
        if it >= 3:
            shift = E
    assert abs(v[4 * L]) ** 2 > 0.05, "banded solver left the bound level"
    return E


def d1(f, x, h):
    return (-f(x + 2 * h) + 8 * f(x + h) - 8 * f(x - h) + f(x - 2 * h)) / (12 * h)


def d2(f, x, h):
    return (-f(x + 2 * h) + 16 * f(x + h) - 30 * f(x) + 16 * f(x - h) - f(x - 2 * h)) / (12 * h * h)


def green(E, P, p, nq=4096, eta=0.5):
    """Coefficients of (11.10): G_{s1 s2}(E,P) and g_x(E,P), as sums over q."""
    q = -np.pi + 2 * np.pi * np.arange(nq) / nq
    p1, p2 = eta * P + q, (1 - eta) * P - q
    om1 = np.sqrt(p["M1"] ** 2 + p["tau1"] ** 2 * np.sin(p1) ** 2)
    om2 = np.sqrt(p["M2"] ** 2 + p["tau2"] ** 2 * np.sin(p2) ** 2)
    G, gx = {}, 0.0
    for sg1 in (1, -1):
        for sg2 in (1, -1):
            den = 4 * (sg1 * om1 + sg2 * om2 - E)
            gx += np.mean(sg1 * sg2 * p["tau1"] * p["tau2"] * np.sin(p1) * np.sin(p2) / (om1 * om2 * den))
            for t1 in (1, 2):
                for t2 in (1, 2):
                    c1, c2 = (1 if t1 == 1 else -1), (1 if t2 == 1 else -1)
                    G[(t1, t2)] = G.get((t1, t2), 0.0) + np.mean(
                        (1 + c1 * sg1 * p["M1"] / om1) * (1 + c2 * sg2 * p["M2"] / om2) / den)
    return G, gx


def green_direct(E, P, p, nq=4096, eta=0.5):
    """<r=0|(H0(P)-E)^(-1)|r=0> as a 4x4 matrix, by inverting h_P(q)-E on the q grid."""
    q = -np.pi + 2 * np.pi * np.arange(nq) / nq
    p1, p2 = eta * P + q, (1 - eta) * P - q
    h = (-p["tau1"] * np.sin(p1))[:, None, None] * SX1 + (-p["tau2"] * np.sin(p2))[:, None, None] * SX2 \
        + p["M1"] * SZ1 + p["M2"] * SZ2 - E * np.eye(4)
    return np.linalg.inv(h).mean(axis=0)


def F_plus(E, P, p):
    """The factor F_+ of (11.10) (sector Xi=+1)."""
    G, gx = green(E, P, p)
    w11, _, _, w22 = p["w"]
    return (1 + w11 * G[(1, 1)]) * (1 + w22 * G[(2, 2)]) - w11 * w22 * gx ** 2


def root_F_plus(Eb, P, p, gap):
    lo, hi = Eb - 0.3 * gap, Eb + 0.3 * gap
    flo, fhi = F_plus(lo, P, p), F_plus(hi, P, p)
    if flo * fhi > 0:
        return None
    for _ in range(100):
        mid = 0.5 * (lo + hi)
        fm = F_plus(mid, P, p)
        if flo * fm <= 0:
            hi, fhi = mid, fm
        else:
            lo, flo = mid, fm
    return 0.5 * (lo + hi)


def closed(P, p):
    """Closed forms of item 3 (leading order in R); expectation values at P=0."""
    M1, M2, t1, t2 = p["M1"], p["M2"], p["tau1"], p["tau2"]
    w = p["w"][0]
    sg = np.sign(w)
    a1, a2 = t1 ** 2 / (4 * M1), t2 ** 2 / (4 * M2)
    a = a1 + a2
    j = np.sqrt(a1 ** 2 + a2 ** 2 + 2 * a1 * a2 * np.cos(2 * P))
    root0 = np.sqrt(w * w + a * a)
    c = 1 + sg * a / root0
    return dict(E=M1 + M2 + a + sg * np.sqrt(w * w + j * j),
                Ep=-sg * 2 * a1 * a2 * np.sin(2 * P) / np.sqrt(w * w + j * j),
                Epp0=-sg * 4 * a1 * a2 / root0, Ebind=a + sg * root0,
                s3_1=1 - a1 / M1 * c, s3_2=1 - a2 / M2 * c, A1=2 * a1 * c, A2=2 * a2 * c,
                U=sg * w * w / root0, a=a, u=abs(w) / a)


def with_(p, **kw):
    q = dict(p)
    q.update(kw)
    return q


SETS = {
    "A_equal_R":      dict(M1=1.0, M2=1.0, tau1=0.10, tau2=0.10, w=[-0.0040, 0.0030, -0.0020, 0.0060]),
    "B_unequal_R":    dict(M1=1.0, M2=1.7, tau1=0.20, tau2=0.12, w=[-0.0100, 0.0050, -0.0040, 0.0080]),
    "C_above_band_R": dict(M1=1.0, M2=0.8, tau1=0.10, tau2=0.15, w=[0.0200, -0.0050, 0.0030, -0.0100]),
    "D_wide_R":       dict(M1=1.3, M2=1.0, tau1=0.15, tau2=0.20, w=[-0.0040, 0.0020, 0.0010, 0.0030]),
    "E_order_one":    dict(M1=1.0, M2=1.3, tau1=1.00, tau2=0.80, w=[-0.6000, 0.2000, -0.1500, 0.3000]),
}
REGIME_R = {"A_equal_R", "B_unequal_R", "C_above_band_R", "D_wide_R"}
P_VALUES = [-0.30, -0.15, 0.0, 0.15, 0.30]
L = 120
HP, HX = 0.01, 1e-3

results, lines = {}, []


def say(s):
    lines.append(s)
    print(s, flush=True)


say(f"range of r: -L..L with L={L} (open ends); convergence: comparison with L={2 * L} and weight at |r|>L/2")
say(f"finite differences: 5-point, step {HP} in P, relative step {HX} in M_i, tau_i, theta; convention eta=1/2")

for name, p in SETS.items():
    say(f"\n=== set {name}: {p}  max tau_i/M_i = {max(p['tau1'] / p['M1'], p['tau2'] / p['M2']):.3f}")
    res = dict(params=p, P={})
    keys = ("dM", "dtau", "dtheta", "euler", "V1", "V2", "V12", "Epp", "eq310", "green", "conv", "tail", "eta",
            "solvers", "closed_E", "closed_Ep")
    worst = dict.fromkeys(keys, 0.0)
    for P in P_VALUES:
        o = solve_full(P, p, L)
        bd = bands(P, p)
        gap = min(abs(o["E"] - e) for lohi in bd.values() for e in lohi)
        inside = any(lo <= o["E"] <= hi for lo, hi in bd.values())
        e0 = edge(P, p)

        def fE(PP=P, pp=p, **kw):
            """Banded bound level at changed P or data; the reference follows the band edge."""
            return solve(PP, pp, L, o["E"] + edge(PP, pp) - e0, **kw)

        solvers = abs(fE() - o["E"])
        conv = abs(solve(P, p, 2 * L, o["E"]) - o["E"])
        eta_dep = max(abs(fE(eta=e) - o["E"]) for e in (0.0, 1.0, 0.3))
        # item 2(a): derivatives of E_b against expectation values
        dM1 = d1(lambda x: fE(pp=with_(p, M1=x)), p["M1"], HX * p["M1"])
        dM2 = d1(lambda x: fE(pp=with_(p, M2=x)), p["M2"], HX * p["M2"])
        dt1 = p["tau1"] * d1(lambda x: fE(pp=with_(p, tau1=x)), p["tau1"], HX * p["tau1"])
        dt2 = p["tau2"] * d1(lambda x: fE(pp=with_(p, tau2=x)), p["tau2"], HX * p["tau2"])
        dth = d1(lambda x: fE(theta=x), 1.0, HX)
        euler = p["M1"] * o["s3_1"] + p["M2"] * o["s3_2"] + o["A1"] + o["A2"] + o["U"] - o["E"]
        # items 2(b), 2(c)
        Ep = d1(lambda x: fE(PP=x), P, HP)
        Epp = d2(lambda x: fE(PP=x), P, HP)
        # item 3(a): coefficients against a direct inversion, root against E_b
        G, gx = green(o["E"], P, p)
        Gd = green_direct(o["E"], P, p)
        gerr = max(abs(G[(1, 1)] - Gd[0, 0]), abs(G[(1, 2)] - Gd[1, 1]), abs(G[(2, 1)] - Gd[2, 2]),
                   abs(G[(2, 2)] - Gd[3, 3]), abs(gx - Gd[0, 3]), abs(gx - Gd[1, 2]),
                   abs(Gd[0, 1]), abs(Gd[0, 2]), abs(Gd[1, 3]), abs(Gd[2, 3])) / np.abs(Gd).max()
        root = root_F_plus(o["E"], P, p, gap)
        c = closed(P, p)
        res["P"][f"{P:+.2f}"] = dict(
            E=o["E"], isolation=gap, inside_band=inside, weight0=o["weight0"], Gamma=o["Gamma"],
            tail=o["tail"], conv_2L=conv, eta_dependence=eta_dep, dense_minus_banded=solvers,
            dM1=[dM1, o["s3_1"]], dM2=[dM2, o["s3_2"]], dtau1=[dt1, o["A1"]], dtau2=[dt2, o["A2"]],
            dtheta=[dth, o["U"]], euler_residual=euler, Ep=[Ep, o["V1"], o["V2"]], Epp=[Epp, o["Epp_formula"]],
            green_rel_error=float(gerr), eq_3a_root=root,
            eq_3a_root_minus_E=(None if root is None else root - o["E"]),
            closed_E=float(c["E"]), closed_Ep=float(c["Ep"]))
        for k, v in (("dM", max(abs(dM1 - o["s3_1"]), abs(dM2 - o["s3_2"]))),
                     ("dtau", max(abs(dt1 - o["A1"]), abs(dt2 - o["A2"]))), ("dtheta", abs(dth - o["U"])),
                     ("euler", abs(euler)), ("V1", abs(Ep - o["V1"])), ("V2", abs(Ep - o["V2"])),
                     ("V12", abs(o["V1"] - o["V2"])), ("Epp", abs(Epp - o["Epp_formula"])),
                     ("eq310", np.inf if root is None else abs(root - o["E"])), ("green", float(gerr)),
                     ("conv", conv), ("tail", o["tail"]), ("eta", eta_dep), ("solvers", solvers),
                     ("closed_E", abs(c["E"] - o["E"])), ("closed_Ep", abs(c["Ep"] - Ep))):
            worst[k] = max(worst[k], float(v))
        say(f"P={P:+.2f}  E_b={o['E']:.12f}  isolation={gap:.3e}  in a band: {inside}  weight(r=0,11)={o['weight0']:.4f}"
            f"  Gamma={o['Gamma']:+.6f}  E_b'={Ep:+.6e}  <V1>={o['V1']:+.6e}  <V2>={o['V2']:+.6e}"
            f"  E_b''={Epp:+.6e}  (11.9)={o['Epp_formula']:+.6e}")
    res["max_abs_deviation"] = worst
    say("max |deviation| over the P values:")
    say(f"  2(a): dE/dM_i - <sigma3_i> {worst['dM']:.2e}; tau_i dE/dtau_i - <A_i> {worst['dtau']:.2e};"
        f" dE/dtheta - <U> {worst['dtheta']:.2e}; Euler residual {worst['euler']:.2e}")
    say(f"  2(b): E_b' - <V1> {worst['V1']:.2e}; E_b' - <V2> {worst['V2']:.2e}; <V1> - <V2> {worst['V12']:.2e}")
    say(f"  2(c): E_b'' (finite difference) - formula (11.9) {worst['Epp']:.2e}")
    say(f"  3(a): coefficients of (11.10) against direct inversion (relative) {worst['green']:.2e};"
        f" root of (11.10) - E_b {worst['eq310']:.2e}")
    say(f"  numerics: |E_b(L) - E_b(2L)| {worst['conv']:.2e}; weight at |r|>L/2 {worst['tail']:.2e};"
        f" dependence on eta {worst['eta']:.2e}; dense - banded {worst['solvers']:.2e}")
    # closed forms at P = 0
    o0 = solve_full(0.0, p, L)
    c0 = closed(0.0, p)
    Epp0 = o0["Epp_formula"]
    eps2 = max(p["tau1"] / p["M1"], p["tau2"] / p["M2"]) ** 2
    cmp0 = {k: [o0[k], float(c0[k])] for k in ("s3_1", "s3_2", "A1", "A2", "U")}
    cmp0["Ebind"] = [o0["E"] - p["M1"] - p["M2"], float(c0["Ebind"])]
    cmp0["Epp0"] = [Epp0, float(c0["Epp0"])]
    m1, m2 = p["M1"] / p["tau1"] ** 2, p["M2"] / p["tau2"] ** 2
    mb = 1.0 / Epp0
    item4 = dict(mb_over_m1_plus_m2=[mb / (m1 + m2), float(-np.sign(p["w"][0]) * np.sqrt(1 + c0["u"] ** 2))],
                 mb_minus_m1_m2=[mb - m1 - m2, -4 * m1 * m2 * (o0["E"] - p["M1"] - p["M2"])])
    res["closed_forms_P0"] = dict(u=float(c0["u"]), a=float(c0["a"]), eps2=eps2, compare=cmp0, item4=item4,
                                  max_dE_over_P=worst["closed_E"], max_dEp_over_P=worst["closed_Ep"],
                                  rel_dev_Epp0=float(abs(Epp0 - c0["Epp0"]) / abs(c0["Epp0"])))
    tag = "regime R" if name in REGIME_R else "control, outside R"
    say(f"closed forms (items 3, 4), {tag}: |w11|/a = {c0['u']:.3f}, (max tau/M)^2 = {eps2:.3e}")
    say(f"  max_P |E_b - (11.12)| = {worst['closed_E']:.3e}  = {worst['closed_E'] / (eps2 ** 2):.3f} * (tau/M)^4;"
        f"  max_P |E_b' - d(11.12)/dP| = {worst['closed_Ep']:.3e}")
    say(f"  E_b''(0): numeric {Epp0:+.8e}  closed {c0['Epp0']:+.8e}  rel.dev {abs(Epp0 - c0['Epp0']) / abs(c0['Epp0']):.3e}"
        f"  = {abs(Epp0 - c0['Epp0']) / abs(c0['Epp0']) / eps2:.3f} * (tau/M)^2")
    for k, (num, cl) in cmp0.items():
        say(f"  {k:6s} numeric {num:+.10e}  closed {cl:+.10e}  diff {num - cl:+.2e}")
    say(f"  m_b/(m_1+m_2): numeric {item4['mb_over_m1_plus_m2'][0]:+.6f}  (11.16) {item4['mb_over_m1_plus_m2'][1]:+.6f};"
        f"  m_b-(m_1+m_2): numeric {item4['mb_minus_m1_m2'][0]:+.6e}  -4 m_1 m_2 E_bind {item4['mb_minus_m1_m2'][1]:+.6e}")
    results[name] = res

# epsilon scan: tau_i = eps*tauhat_i, w = eps^2*what, for the data of set B (eps = 1)
say("\n=== epsilon scan on set B_unequal_R (tau -> eps*tau, w -> eps^2*w)")
base = SETS["B_unequal_R"]
scan, prev = [], None
for eps in (1.0, 0.5, 0.25, 0.125):
    p = with_(base, tau1=eps * base["tau1"], tau2=eps * base["tau2"], w=[eps * eps * x for x in base["w"]])
    o0, c0 = solve_full(0.0, p, L), closed(0.0, p)
    row = dict(eps=eps, dE_P0=o0["E"] - c0["E"], dE_P03=solve_full(0.3, p, L)["E"] - closed(0.3, p)["E"],
               rel_dEpp0=(o0["Epp_formula"] - c0["Epp0"]) / c0["Epp0"], d_s3_1=o0["s3_1"] - c0["s3_1"],
               d_s3_2=o0["s3_2"] - c0["s3_2"])
    row = {k: float(v) for k, v in row.items()}
    if prev:
        row["ratio_to_previous"] = {k: prev[k] / row[k] for k in row if k != "eps"}
    scan.append(row)
    prev = {k: v for k, v in row.items() if k != "ratio_to_previous"}
    say(f"eps={eps:6.3f}  E_b-(11.12): P=0 {row['dE_P0']:+.4e}, P=0.3 {row['dE_P03']:+.4e};  rel.dev E_b''(0) {row['rel_dEpp0']:+.4e};"
        f"  <sigma3_i>-(11.14): {row['d_s3_1']:+.4e}, {row['d_s3_2']:+.4e}")
    if "ratio_to_previous" in row:
        say("          ratios to the previous eps: " + ", ".join(f"{k} {v:.2f}" for k, v in row["ratio_to_previous"].items()))
say("expected for halving eps: 16 for E_b and <sigma3_i> (next order eps^4), 4 for the relative deviation of E_b''(0)")
results["epsilon_scan_set_B"] = scan
results["settings"] = dict(L=L, L_check=2 * L, P_values=P_VALUES, eta=0.5, h_P=HP, h_rel_parameters=HX)

# ---------------------------------------------------------------------------
# Part 2: checks of what is new in derivation v2
# ---------------------------------------------------------------------------
new = {}


def dense(P, p, L, eta=0.5, W0=None, theta=1.0):
    """Dense H(P) with all eigenvectors and its parts. W0: a general on-site binding
    (4x4, order 11, 12, 21, 22) used instead of the diagonal p['w']."""
    A1, A2, V1, V2, Z1, Z2, U = fibre_ops(P, p, L, eta)
    if W0 is not None:
        U = np.zeros_like(A1)
        U[4 * L:4 * L + 4, 4 * L:4 * L + 4] = W0
    H = A1 + A2 + p["M1"] * Z1 + p["M2"] * Z2 + theta * U
    E, X = np.linalg.eigh(H)
    return E, X, dict(A1=A1, A2=A2, V1=V1, V2=V2, Z1=Z1, Z2=Z2, U=U)


def P_ring(a, vartheta, N):
    """P_N(a; vartheta) of (5.1) of 04-ilang-time/05-moving-clock."""
    k = np.arange(N)
    return float(abs(np.mean(np.exp(2j * np.pi * k * (a - vartheta) / N))) ** 2)


def closed_d2M(p, part):
    """Second derivative of the closed form (11.12) at P=0 with respect to M_part (used in (11.26))."""
    M1, M2, t1, t2 = p["M1"], p["M2"], p["tau1"], p["tau2"]
    w = p["w"][0]
    sg = np.sign(w)
    a1, a2 = t1 ** 2 / (4 * M1), t2 ** 2 / (4 * M2)
    a, ai, Mi = a1 + a2, (a1 if part == 1 else a2), (M1 if part == 1 else M2)
    u = abs(w) / a
    lam = 1 + sg / np.sqrt(1 + u * u)
    return float(ai / Mi ** 2 * (2 * lam + sg * ai / a * u * u / (1 + u * u) ** 1.5))


def clock_check(p, part, N, D, ticks):
    """Item 5(a), (11.19) and (11.25): exact reading statistics of the clock label of one part
    for a pair in the bound level at P=0 (sharp total label, no records), against
    P_N(a; Gamma*lambda/lambda_0) with three choices of Gamma."""
    key = f"M{part}"
    m = p[key]
    lam0 = 2 * np.pi * (N - 1) / (N * D)          # tick parameter with the level spread d_{N-1} = D
    d = D * np.arange(N) / (N - 1)
    dbar = 0.5 * D
    lev = [dense(0.0, with_(p, **{key: m + dk}), L)[:2] for dk in d]
    E0, X0, ops = dense(0.0, p, L)
    b = int(np.argmax(np.abs(X0[4 * L, :]) ** 2))
    psi0 = X0[:, b]
    Z = ops[f"Z{part}"]
    g0 = np.inf                                     # isolation of the bound level over the levels of the clock
    for E, X in lev:
        bk = int(np.argmax(np.abs(X[4 * L, :]) ** 2))
        g0 = min(g0, float(np.min(np.abs(np.delete(E, bk) - E[bk]))))
    G0 = float(np.real(np.vdot(psi0, Z @ psi0)))                     # <sigma3_i>_0 at M_i = m_i (rate of v1)
    amp = X0.conj().T @ (Z @ psi0)
    mask = np.ones(len(E0), bool)
    mask[b] = False
    d2E = float(-2 * np.sum(np.abs(amp[mask]) ** 2 / (E0[mask] - E0[b])))   # d^2 E_b / d M_i^2 at m_i
    Gmean = solve_full(0.0, with_(p, **{key: m + dbar}), L)[f"s3_{part}"]   # <sigma3_i>_0 at the mean level
    Gfirst = G0 + dbar * d2E                                                # (11.25)
    coef = [X.conj().T @ psi0 for E, X in lev]      # start: eigenvector of the level 0 on every level
    q = np.zeros((len(ticks), N))
    for it, t in enumerate(ticks):
        vec = np.array([X @ (np.exp(-1j * E * t * lam0) * c) for (E, X), c in zip(lev, coef)])
        for a in range(N):
            q[it, a] = np.linalg.norm(np.exp(2j * np.pi * np.arange(N) * a / N) @ vec / N) ** 2

    def table(G):
        return np.array([[P_ring(a, G * t, N) for a in range(N)] for t in ticks])

    def dev(G, tmax=None):
        sel = np.ones(len(ticks), bool) if tmax is None else (np.asarray(ticks) <= tmax + 1e-12)
        return float(np.max(np.abs(q - table(G))[sel]))

    fit = minimize_scalar(lambda G: float(np.sum((q - table(G)) ** 2)), bounds=(Gmean - 0.05, Gmean + 0.05),
                          method="bounded", options=dict(xatol=1e-13))
    cm = closed(0.0, with_(p, **{key: m + dbar}))
    c0 = closed(0.0, p)
    return dict(part=part, N=N, D=D, lambda0=lam0, g0=g0, D_over_g0=D / g0, D_over_M=D / m, sum_q_minus_1=float(
        np.max(np.abs(q.sum(axis=1) - 1))), Gamma_level0=G0, Gamma_mean_level=Gmean, Gamma_first_order=Gfirst,
        Gamma_fit=float(fit.x), d2E_dM2=d2E, d2E_dM2_closed=closed_d2M(p, part),
        Gamma_closed_11_20_at_mean=float(cm[f"s3_{part}"]),
        Gamma_closed_11_26=float(c0[f"s3_{part}"] + dbar * closed_d2M(p, part)),
        dev_mean_level=dev(Gmean), dev_level0=dev(G0), dev_first_order=dev(Gfirst),
        dev_mean_level_first_revolution=dev(Gmean, N), dev_level0_first_revolution=dev(G0, N))


say("\n=== new in v2, I3: reading statistics of the clock of a part, (11.19), (11.25), (11.26)")
say("start: bound eigenvector of the level 0 on every level, clock label in |0>, total label P=0 sharp, no records;")
say("readings at lambda = t*lambda_0, t = 0.25, 0.5, ..., 2N; deviation = max over a and t of |q - P_N(a; Gamma*t)|")
clock_runs = []
for name, part, N, D in (("E_order_one", 1, 4, 0.06), ("B_unequal_R", 1, 4, 0.10), ("B_unequal_R", 2, 5, 0.10)):
    prev = None
    for DD in (D, D / 2, D / 4):
        ticks = list(np.arange(1, 8 * N + 1) * 0.25)
        r = clock_check(SETS[name], part, N, DD, ticks)
        r["set"] = name
        if prev:
            r["ratio_to_previous"] = dict(dev_mean_level=prev["dev_mean_level"] / r["dev_mean_level"],
                                          dev_level0=prev["dev_level0"] / r["dev_level0"],
                                          dev_first_order=prev["dev_first_order"] / r["dev_first_order"])
        clock_runs.append(r)
        prev = r
        say(f"set {name}, clock of part {part}, N={N}, spread D={DD:.4f} (D/g0={r['D_over_g0']:.3f}, D/m={r['D_over_M']:.4f},"
            f" lambda_0={r['lambda0']:.2f})")
        say(f"  Gamma: level 0 (v1) {r['Gamma_level0']:.10f}; mean level (11.19) {r['Gamma_mean_level']:.10f};"
            f" first order (11.25) {r['Gamma_first_order']:.10f}; least-squares fit {r['Gamma_fit']:.10f}")
        say(f"  d2E_b/dM^2 at m: spectral sum {r['d2E_dM2']:+.8e}; closed form of (11.26) {r['d2E_dM2_closed']:+.8e};"
            f"  closed (11.20) at the mean level {r['Gamma_closed_11_20_at_mean']:.10f}; closed (11.26) {r['Gamma_closed_11_26']:.10f}")
        say(f"  deviation of the statistics: Gamma at the mean level {r['dev_mean_level']:.3e} (t<=N: {r['dev_mean_level_first_revolution']:.3e});"
            f" first order {r['dev_first_order']:.3e}; Gamma of the level 0 {r['dev_level0']:.3e} (t<=N: {r['dev_level0_first_revolution']:.3e})")
        if prev and "ratio_to_previous" in r:
            say("  ratios to the previous spread: " + ", ".join(f"{k} {v:.2f}" for k, v in r["ratio_to_previous"].items()))
say("expected for halving the spread at fixed lambda/lambda_0: 4 with Gamma at the mean level, 2 with Gamma of the level 0")
new["I3_clock"] = clock_runs

say("\n=== new in v2, I4: order of the contribution of w22 (set B, tau -> eps*tau, w -> eps^2*w)")
rows, prev = [], None
for eps in (2.0, 1.0, 0.5, 0.25):
    p = with_(base, tau1=eps * base["tau1"], tau2=eps * base["tau2"], w=[eps * eps * x for x in base["w"]])
    pz = with_(p, w=p["w"][:3] + [0.0])
    Ea, Xa, _ = dense(0.0, p, L)
    Ez, Xz, _ = dense(0.0, pz, L)
    ba, bz = int(np.argmax(np.abs(Xa[4 * L, :]) ** 2)), int(np.argmax(np.abs(Xz[4 * L, :]) ** 2))
    dE = float(Ea[ba] - Ez[bz])
    wt = 0.5 * float(np.abs(Xa[4 * L + 3, ba]) ** 2 + np.abs(Xz[4 * L + 3, bz]) ** 2)   # |<22|psi(0)>|^2
    row = dict(eps=eps, w22=p["w"][3], dE=dE, w22_times_weight=p["w"][3] * wt, weight_22_at_0=wt)
    if prev:
        row["ratio_to_previous"] = dict(dE=prev["dE"] / dE, weight_22_at_0=prev["weight_22_at_0"] / wt)
    rows.append(row)
    prev = row
    say(f"eps={eps:6.3f}  E_b(w22) - E_b(w22=0) = {dE:+.6e};  w22*|<22|psi(0)>|^2 = {row['w22_times_weight']:+.6e};"
        f"  |<22|psi(0)>|^2 = {wt:.6e}" + ("" if "ratio_to_previous" not in row else
        f";  ratios to the previous eps: dE {row['ratio_to_previous']['dE']:.2f}, weight {row['ratio_to_previous']['weight_22_at_0']:.2f}"))
say("expected for halving eps: 64 for the contribution of w22 to E_b (order eps^6), 16 for the weight (order eps^4)")
new["I4_w22"] = rows

say("\n=== new in v2, I5: equal data (a_1 = a_2) at P = pi/2, where j(P) = 0 (set A, tau -> eps*tau, w -> eps^2*w)")
rows, prev = [], None
baseA = SETS["A_equal_R"]
for eps in (1.0, 0.5, 0.25):
    p = with_(baseA, tau1=eps * baseA["tau1"], tau2=eps * baseA["tau2"], w=[eps * eps * x for x in baseA["w"]])
    E, X, _ = dense(0.5 * np.pi, p, L)
    b = int(np.argmax(np.abs(X[4 * L, :]) ** 2))
    a = p["tau1"] ** 2 / (4 * p["M1"]) + p["tau2"] ** 2 / (4 * p["M2"])
    row = dict(eps=eps, E=float(E[b]), closed_E=p["M1"] + p["M2"] + a + p["w"][0],
               dE=float(E[b] - (p["M1"] + p["M2"] + a + p["w"][0])),
               one_minus_weight_r0_11=float(1 - np.abs(X[4 * L, b]) ** 2),
               weight_r_not_0_in_11=float(np.sum(np.abs(X[0::4, b]) ** 2) - np.abs(X[4 * L, b]) ** 2))
    if prev:
        row["ratio_to_previous"] = dict(dE=prev["dE"] / row["dE"],
                                        one_minus_weight=prev["one_minus_weight_r0_11"] / row["one_minus_weight_r0_11"])
    rows.append(row)
    prev = row
    say(f"eps={eps:6.3f}  E_b = {row['E']:.12f}  M_1+M_2+a+w11 = {row['closed_E']:.12f}  difference {row['dE']:+.3e};"
        f"  1 - weight(r=0,11) = {row['one_minus_weight_r0_11']:.3e};  weight of 11 at r != 0: {row['weight_r_not_0_in_11']:.3e}"
        + ("" if "ratio_to_previous" not in row else f";  ratios: dE {row['ratio_to_previous']['dE']:.2f},"
           f" 1-weight {row['ratio_to_previous']['one_minus_weight']:.2f}"))
say("expected: psi_P = delta_{r,0}|11> up to O(eps) (1 - weight of order eps^2), E_b = M_1+M_2+a+w11 up to O(eps^4)")
new["I5_j_zero"] = rows


def degenerate_check(p, P0, E0):
    """I2: a twofold bound level. On-site binding W0 = -G(E0,P0)^(-1) on span(|11>,|22>) (G of Step 6),
    diagonal on |12>,|21>; then 1 + G W0 vanishes on that span and E0 is a twofold level of H(P0)."""
    Gd = green_direct(E0, P0, p)
    blk = np.ix_([0, 3], [0, 3])
    W0 = np.diag([0.0, 0.15, -0.10, 0.0]).astype(complex)
    W0[blk] = -np.linalg.inv(Gd[blk])
    W0 = 0.5 * (W0 + W0.conj().T)
    par0 = dict(P=P0, M1=p["M1"], M2=p["M2"], tau1=p["tau1"], tau2=p["tau2"], theta=1.0)
    eta = 0.5

    def at(**kw):
        v = dict(par0)
        v.update(kw)
        pp = with_(p, M1=v["M1"], M2=v["M2"], tau1=v["tau1"], tau2=v["tau2"])
        E, X, ops = dense(v["P"], pp, L, eta=eta, W0=W0, theta=v["theta"])
        return E, X, ops, np.argsort(np.abs(E - E0))

    E, X, ops, idx = at()
    pair = idx[:2]
    Eb = float(E[pair].mean())
    Phi = X[:, pair]                                # orthonormal basis of the level, as returned by the solver
    rest = np.ones(len(E), bool)
    rest[pair] = False
    Veta = eta * ops["V1"] + (1 - eta) * ops["V2"]
    dH = dict(M1=ops["Z1"], M2=ops["Z2"], tau1=ops["A1"] / p["tau1"], tau2=ops["A2"] / p["tau2"], theta=ops["U"], P=Veta)
    amp = X[:, rest].conj().T @ (Veta @ Phi)
    h2P = Phi.conj().T @ ((-(eta ** 2) * ops["A1"] - (1 - eta) ** 2 * ops["A2"]) @ Phi) \
        - 2 * amp.conj().T @ (amp / (E[rest] - Eb)[:, None])      # second-order matrix of (11.24)
    steps = dict(P=HP, M1=HX * p["M1"], M2=HX * p["M2"], tau1=HX * p["tau1"], tau2=HX * p["tau2"], theta=HX)
    r_lab = np.repeat(np.arange(-L, L + 1), 4)
    out = dict(P0=P0, E0=E0, W0_block_11_22=np.real(W0[blk]).tolist(), level=Eb, splitting=float(abs(E[pair[0]] - E[pair[1]])),
               isolation=float(abs(E[idx[2]] - Eb)), tail=float(np.sum(np.abs(Phi[np.abs(r_lab) > L // 2]) ** 2)), xi={})
    bases = {}
    for xi, O in dH.items():
        h = Phi.conj().T @ (O @ Phi)
        e, c = np.linalg.eigh(h)
        second_order = bool(xi == "P" and abs(e[1] - e[0]) < 1e-8)
        if second_order:                             # equal first derivatives: branch vectors from the second order
            c = c @ np.linalg.eigh(c.conj().T @ h2P @ c)[1]
        B = Phi @ c                                  # branch vectors of the parameter xi
        bases[xi] = c
        vals, quality = {}, 1.0
        for s in (-2, -1, 1, 2):
            E_, X_, _, idx_ = at(**{xi: par0[xi] + s * steps[xi]})
            pr = idx_[:2]
            ov = np.abs(B.conj().T @ X_[:, pr]) ** 2          # [branch, eigenvector]
            j0 = int(np.argmax(ov[0]))
            vals[(0, s)], vals[(1, s)] = float(E_[pr[j0]]), float(E_[pr[1 - j0]])
            quality = min(quality, float(ov[0, j0]), float(ov[1, 1 - j0]))
        hh = steps[xi]
        res = dict(branch_overlap_min=quality, second_order_branches=second_order,
                   matrix_eigenvalues=[float(np.real(np.vdot(c[:, n], h @ c[:, n]))) for n in (0, 1)],
                   slopes_finite_difference=[(-vals[(n, 2)] + 8 * vals[(n, 1)] - 8 * vals[(n, -1)] + vals[(n, -2)]) / (12 * hh)
                                             for n in (0, 1)])
        res["max_abs_deviation"] = float(max(abs(a - b) for a, b in zip(res["matrix_eigenvalues"], res["slopes_finite_difference"])))
        if xi == "P":
            res["second_derivative_11_24"] = [float(np.real(np.vdot(c[:, n], h2P @ c[:, n]))) for n in (0, 1)]
            res["second_derivative_finite_difference"] = [
                (-vals[(n, 2)] + 16 * vals[(n, 1)] - 30 * Eb + 16 * vals[(n, -1)] - vals[(n, -2)]) / (12 * hh * hh) for n in (0, 1)]
            res["max_abs_deviation_second"] = float(max(abs(a - b) for a, b in zip(
                res["second_derivative_11_24"], res["second_derivative_finite_difference"])))
            # the term that (11.9) with Q_P = 1 - |psi><psi| would contain for the other vector of the level
            res["term_of_11_9_from_the_level"] = dict(numerator=float(abs(np.vdot(Phi[:, 1], Veta @ Phi[:, 0])) ** 2),
                                                      denominator=float(E[pair[1]] - E[pair[0]]))
        out["xi"][xi] = res
    # identities for every eigenvector of the level
    rng = np.random.default_rng(11)
    worst = dict(euler=0.0, V12=0.0, mean_rule=0.0)
    for _ in range(5):
        cc = rng.normal(size=2) + 1j * rng.normal(size=2)
        cc /= np.linalg.norm(cc)
        psi = Phi @ cc
        ex = lambda O: float(np.real(np.vdot(psi, O @ psi)))
        worst["euler"] = max(worst["euler"], abs(p["M1"] * ex(ops["Z1"]) + p["M2"] * ex(ops["Z2"]) + ex(ops["A1"])
                                                 + ex(ops["A2"]) + ex(ops["U"]) - Eb))
        worst["V12"] = max(worst["V12"], abs(ex(ops["V1"]) - ex(ops["V2"])))
        for xi in ("M1", "theta"):
            wts = np.abs(bases[xi].conj().T @ cc) ** 2
            worst["mean_rule"] = max(worst["mean_rule"], abs(ex(dH[xi]) - float(wts @ np.array(out["xi"][xi]["slopes_finite_difference"]))))
    out["every_eigenvector"] = dict(worst, norm_Pi_V1_minus_V2_Pi=float(np.linalg.norm(Phi.conj().T @ ((ops["V1"] - ops["V2"]) @ Phi))))
    # the branch vectors of different parameters
    out["overlap_of_branch_0_of_M1_with_branch_0_of"] = {xi: float(abs(np.vdot(bases["M1"][:, 0], bases[xi][:, 0])) ** 2)
                                                         for xi in dH if xi != "M1"}
    hU = Phi.conj().T @ (ops["U"] @ Phi)
    out["U_in_the_branch_vectors_of_M1"] = [float(np.real(np.vdot(bases["M1"][:, n], hU @ bases["M1"][:, n]))) for n in (0, 1)]
    return out


say("\n=== new in v2, I2: twofold bound levels (on-site binding W0 = -G(E0,P0)^(-1) on span(|11>,|22>))")
pX = dict(M1=1.0, M2=0.7, tau1=0.5, tau2=0.35, w=[0.0, 0.0, 0.0, 0.0])
deg = {}
for label, P0 in (("X_P0_0.3", 0.3), ("X_P0_0", 0.0)):
    o = degenerate_check(pX, P0, 1.0)
    deg[label] = o
    bd = {k: (round(v[0], 4), round(v[1], 4)) for k, v in bands(P0, pX).items()}
    say(f"set {label}: M = {pX['M1']}, {pX['M2']}; tau = {pX['tau1']}, {pX['tau2']}; P0 = {P0};"
        f" W0 on (11,22) = {np.round(o['W0_block_11_22'], 6).tolist()}; bands {bd}")
    say(f"  level {o['level']:.12f}, splitting of the two eigenvalues {o['splitting']:.2e}, distance to the next eigenvalue {o['isolation']:.4f},"
        f" weight at |r|>L/2 {o['tail']:.1e}")
    for xi, r in o["xi"].items():
        say(f"  {xi:5s}: eigenvalues of Pi dH Pi {r['matrix_eigenvalues'][0]:+.9f}, {r['matrix_eigenvalues'][1]:+.9f};"
            f" slopes of the branches (finite differences) {r['slopes_finite_difference'][0]:+.9f}, {r['slopes_finite_difference'][1]:+.9f};"
            f" max dev {r['max_abs_deviation']:.1e}; overlap with the branch vectors >= {r['branch_overlap_min']:.6f}"
            + ("; branch vectors from the second order" if r["second_order_branches"] else ""))
        if xi == "P":
            say(f"         E'' of the branches: (11.24) {r['second_derivative_11_24'][0]:+.8f}, {r['second_derivative_11_24'][1]:+.8f};"
                f" finite differences {r['second_derivative_finite_difference'][0]:+.8f}, {r['second_derivative_finite_difference'][1]:+.8f};"
                f" max dev {r['max_abs_deviation_second']:.1e}")
            t = r["term_of_11_9_from_the_level"]
            say(f"         (11.9) with Q_P = 1 - |psi><psi|, term of the other vector of the level in the basis of the solver:"
                f" |<psi'|V_eta|psi>|^2 = {t['numerator']:.3e} over E' - E = {t['denominator']:.3e}")
    ev = o["every_eigenvector"]
    say(f"  every eigenvector (5 random vectors of the level): residual of (11.6) {ev['euler']:.1e}; <V1> - <V2> {ev['V12']:.1e};"
        f" ||Pi (V1 - V2) Pi|| {ev['norm_Pi_V1_minus_V2_Pi']:.1e}; <dH> - weighted mean of the branch slopes (M1, theta) {ev['mean_rule']:.1e}")
    say("  |<branch 0 of M1 | branch 0 of xi>|^2: " + ", ".join(f"{k} {v:.4f}" for k, v in o["overlap_of_branch_0_of_M1_with_branch_0_of"].items()))
    say(f"  <U> in the two branch vectors of M1: {o['U_in_the_branch_vectors_of_M1'][0]:+.6f}, {o['U_in_the_branch_vectors_of_M1'][1]:+.6f}"
        f"  against the slopes of the branches of theta: {o['xi']['theta']['slopes_finite_difference'][0]:+.6f}, {o['xi']['theta']['slopes_finite_difference'][1]:+.6f}")
new["I2_degenerate"] = deg


def listing_check():
    """I1: C_bod = <chi|C|chi> of (11.21) on a small system given in the places (two bodies with a branch
    label on an open chain of 4 positions, a medium with 3 places)."""
    rng = np.random.default_rng(5)
    n, dc = 4, 3
    hop = np.eye(n, k=-1)

    def body(tau, M):
        return 0.5 * tau * (np.kron(hop, -1j * sx) + np.kron(hop.T, 1j * sx)) + M * np.kron(np.eye(n), sz)

    I8, Ic = np.eye(2 * n), np.eye(dc)
    xh = np.kron(np.diag(np.arange(n, dtype=float)), np.eye(2))
    C1, C2 = np.kron(body(0.6, 1.0), I8), np.kron(I8, body(0.45, 0.7))
    x12 = np.kron(xh, I8) + np.kron(I8, xh)
    U = np.zeros((64, 64))
    wv = np.array([[-0.5, 0.2], [-0.15, 0.3]])
    for x in range(n):
        for s1 in range(2):
            for s2 in range(2):
                i = (2 * x + s1) * 8 + 2 * x + s2
                U[i, i] = wv[s1, s2]
    Cpair = C1 + C2 + U
    Xr = rng.normal(size=(dc, dc)) + 1j * rng.normal(size=(dc, dc))
    Xr = 0.5 * (Xr + Xr.conj().T)
    chi = rng.normal(size=dc) + 1j * rng.normal(size=dc)
    chi /= np.linalg.norm(chi)
    mean = float(np.real(np.vdot(chi, Xr @ chi)))
    Xc = Xr - mean * Ic                               # <chi|Xc|chi> = 0
    phi = rng.normal(size=64) + 1j * rng.normal(size=64)
    phi /= np.linalg.norm(phi)
    alpha = np.kron(0.3 * np.kron(np.eye(n), sz) + 0.2 * np.eye(8), I8)             # h*sigma3 of b_1 and a constant
    beta = np.kron(I8, 0.25 * 0.5 * 0.45 * (np.kron(hop, -1j * sx) + np.kron(hop.T, 1j * sx)) - 0.1 * np.eye(8))

    def bod(C):
        return np.einsum("a,iajb,b->ij", chi.conj(), C.reshape(64, dc, 64, dc), chi)

    def evolve(G, v, lam):
        E, Y = np.linalg.eigh(G)
        return Y @ (np.exp(-1j * E * lam) * (Y.conj().T @ v))

    out, lam = dict(scan=[]), 3.0
    for kappa in (0.04, 0.02, 0.01):
        row = dict(kappa=kappa)
        for tag, Xm in (("centred", Xc), ("not_centred", Xr)):
            C = np.kron(Cpair, Ic) + kappa * np.kron(x12, Xm)                       # listing of the question
            CB = np.kron(Cpair - alpha - beta, Ic) + (kappa * np.kron(x12, Xm) + np.kron(alpha + beta, Ic))   # another listing
            Cbod = bod(C)
            Psi = evolve(C, np.kron(phi, chi), lam).reshape(64, dc)
            view = Psi @ Psi.conj().T
            proj = lambda v: np.outer(v, v.conj())
            row[tag] = dict(
                total_contract_listing_B_minus_A=float(np.linalg.norm(CB - C)),
                Cbod_listing_B_minus_A=float(np.linalg.norm(bod(CB) - Cbod)),
                Cbod_minus_listed_Cpair_A=float(np.linalg.norm(Cbod - Cpair)),
                Cbod_minus_listed_Cpair_A_minus_gradient=float(np.linalg.norm(
                    Cbod - Cpair - kappa * (mean if tag == "not_centred" else 0.0) * x12)),
                Cbod_minus_listed_Cpair_B=float(np.linalg.norm(Cbod - (Cpair - alpha - beta))),
                view_minus_evolution_by_Cbod=float(np.linalg.norm(view - proj(evolve(Cbod, phi, lam)))),
                view_minus_evolution_by_listed_Cpair_A=float(np.linalg.norm(view - proj(evolve(Cpair, phi, lam)))),
                view_minus_evolution_by_listed_Cpair_B=float(np.linalg.norm(view - proj(evolve(Cpair - alpha - beta, phi, lam)))))
        out["scan"].append(row)
    out["mean_of_X_not_centred"] = mean
    return out


say("\n=== new in v2, I1: the operator C_bod = <chi|C|chi> of (11.21), small system in the places (dimension 64 x 3)")
lc = listing_check()
say(f"listing A: the terms of the question; listing B: h*sigma3 of b_1, a constant and a part of the motion term of b_2 listed"
    f" in the record terms; <chi|X|chi> = {lc['mean_of_X_not_centred']:+.4f} for the medium that is not centred; lambda = 3")
for row in lc["scan"]:
    for tag in ("centred", "not_centred"):
        r = row[tag]
        say(f"kappa={row['kappa']:.3f} {tag:11s}: ||C_B - C_A|| {r['total_contract_listing_B_minus_A']:.1e};"
            f" ||C_bod(B) - C_bod(A)|| {r['Cbod_listing_B_minus_A']:.1e}; ||C_bod - C_pair(A)|| {r['Cbod_minus_listed_Cpair_A']:.3e}"
            f" (minus the gradient: {r['Cbod_minus_listed_Cpair_A_minus_gradient']:.1e}); ||C_bod - C_pair(B)|| {r['Cbod_minus_listed_Cpair_B']:.3f};"
            f" view against evolution by C_bod {r['view_minus_evolution_by_Cbod']:.3e}, by C_pair(A) {r['view_minus_evolution_by_listed_Cpair_A']:.3e},"
            f" by C_pair(B) {r['view_minus_evolution_by_listed_Cpair_B']:.3f}")
say("expected for halving kappa: the view against the evolution by C_bod falls by 4 (second order);"
    " by the listed C_pair(A) with a medium that is not centred it falls by 2")
new["I1_listing"] = lc
results["new_in_v2"] = new

(OUT / "check_bound_pair.json").write_text(json.dumps(results, indent=1), encoding="utf-8")
(OUT / "check_bound_pair.txt").write_text("\n".join(lines) + "\n", encoding="utf-8")
output/check_bound_pair.json60 KB · raw
{
 "A_equal_R": {
  "params": {
   "M1": 1.0,
   "M2": 1.0,
   "tau1": 0.1,
   "tau2": 0.1,
   "w": [
    -0.004,
    0.003,
    -0.002,
    0.006
   ]
  },
  "P": {
   "-0.30": {
    "E": 1.9987717488829717,
    "isolation": 0.0014515562051098385,
    "inside_band": false,
    "weight0": 0.6407883806399609,
    "Gamma": 0.999999999999998,
    "tail": 5.284034866971501e-21,
    "conv_2L": 1.7763568394002505e-15,
    "eta_dependence": 1.3322676295501878e-15,
    "dense_minus_banded": 1.7763568394002505e-15,
    "dM1": [
     0.9993304952485663,
     0.9993304952496843
    ],
    "dM2": [
     0.9993304952487698,
     0.9993304952496843
    ],
    "dtau1": [
     0.00133695523152344,
     0.0013369552328886952
    ],
    "dtau2": [
     0.0013369552324301222,
     0.0013369552328886957
    ],
    "dtheta": [
     -0.002563152083005319,
     -0.0025631520821777784
    ],
    "euler_residual": -3.552713678800501e-15,
    "Ep": [
     -0.0011330902868311732,
     -0.0011330902852397778,
     -0.0011330902852397784
    ],
    "Epp": [
     0.003517649173797229,
     0.003517649188281665
    ],
    "green_rel_error": 1.477928061095734e-15,
    "eq_3a_root": 1.9987717488829722,
    "eq_3a_root_minus_E": 4.440892098500626e-16,
    "closed_E": 1.9987696954178489,
    "closed_Ep": -0.0011328548748095464
   },
   "-0.15": {
    "E": 1.998642641791647,
    "isolation": 0.001413502030640723,
    "inside_band": false,
    "weight0": 0.6277890046358329,
    "Gamma": 0.9999999999999988,
    "tail": 2.0431024738666595e-20,
    "conv_2L": 1.1102230246251565e-15,
    "eta_dependence": 8.881784197001252e-16,
    "dense_minus_banded": 4.440892098500626e-16,
    "dM1": [
     0.9994210796151296,
     0.9994210796154035
    ],
    "dM2": [
     0.9994210796141489,
     0.9994210796154035
    ],
    "dtau1": [
     0.0011558185154155372,
     0.0011558185156420253
    ],
    "dtau2": [
     0.0011558185155265595,
     0.0011558185156420257
    ],
    "dtheta": [
     -0.002511154470604312,
     -0.0025111544704462543
    ],
    "euler_residual": -2.4424906541753444e-15,
    "Ep": [
     -0.0005810445112145828,
     -0.0005810445103634665,
     -0.0005810445103634664
    ],
    "Epp": [
     0.003809572070948934,
     0.003809572065239796
    ],
    "green_rel_error": 5.00221778057326e-15,
    "eq_3a_root": 1.9986426417916472,
    "eq_3a_root_minus_E": 2.220446049250313e-16,
    "closed_E": 1.9986406206187968,
    "closed_Ep": -0.0005808746989030781
   },
   "+0.00": {
    "E": 1.9985988835265178,
    "isolation": 0.001401116473482178,
    "inside_band": false,
    "weight0": 0.6235021151130774,
    "Gamma": 1.0000000000000004,
    "tail": 3.165361573386918e-20,
    "conv_2L": 1.9984014443252818e-15,
    "eta_dependence": 2.4424906541753444e-15,
    "dense_minus_banded": 2.4424906541753444e-15,
    "dM1": [
     0.9994515458613776,
     0.9994515458612895
    ],
    "dM2": [
     0.9994515458604895,
     0.9994515458612895
    ],
    "dtau1": [
     0.0010948993396930893,
     0.0010948993396561516
    ],
    "dtau2": [
     0.0010948993404887493,
     0.0010948993396561516
    ],
    "dtheta": [
     -0.0024940068755567126,
     -0.0024940068753713397
    ],
    "euler_residual": 1.9984014443252818e-15,
    "Ep": [
     1.8503717077085944e-15,
     7.893878378888825e-21,
     -2.053590192312075e-20
    ],
    "Epp": [
     0.003905596114480344,
     0.003905596125007126
    ],
    "green_rel_error": 6.252772106673449e-15,
    "eq_3a_root": 1.9985988835265194,
    "eq_3a_root_minus_E": 1.5543122344752192e-15,
    "closed_E": 1.998596875762567,
    "closed_Ep": 0.0
   },
   "+0.15": {
    "E": 1.9986426417916483,
    "isolation": 0.0014135020306393908,
    "inside_band": false,
    "weight0": 0.6277890046357715,
    "Gamma": 0.9999999999999984,
    "tail": 2.043102670676963e-20,
    "conv_2L": 8.881784197001252e-16,
    "eta_dependence": 1.3322676295501878e-15,
    "dense_minus_banded": 2.220446049250313e-16,
    "dM1": [
     0.9994210796155922,
     0.9994210796154032
    ],
    "dM2": [
     0.9994210796144635,
     0.9994210796154032
    ],
    "dtau1": [
     0.001155818514656885,
     0.0011558185156417791
    ],
    "dtau2": [
     0.001155818515360026,
     0.0011558185156417796
    ],
    "dtheta": [
     -0.0025111544695496,
     -0.002511154470446009
    ],
    "euler_residual": -4.218847493575595e-15,
    "Ep": [
     0.0005810445112719442,
     0.0005810445103635037,
     0.0005810445103635038
    ],
    "Epp": [
     0.003809572049299585,
     0.0038095720652400445
    ],
    "green_rel_error": 1.1937110612725393e-14,
    "eq_3a_root": 1.9986426417916472,
    "eq_3a_root_minus_E": -1.1102230246251565e-15,
    "closed_E": 1.9986406206187968,
    "closed_Ep": 0.0005808746989030781
   },
   "+0.30": {
    "E": 1.9987717488829717,
    "isolation": 0.0014515562051098385,
    "inside_band": false,
    "weight0": 0.6407883806399609,
    "Gamma": 0.999999999999998,
    "tail": 5.284034866971501e-21,
    "conv_2L": 1.7763568394002505e-15,
    "eta_dependence": 1.3322676295501878e-15,
    "dense_minus_banded": 1.7763568394002505e-15,
    "dM1": [
     0.9993304952485663,
     0.9993304952496843
    ],
    "dM2": [
     0.9993304952487698,
     0.9993304952496843
    ],
    "dtau1": [
     0.00133695523152344,
     0.0013369552328886952
    ],
    "dtau2": [
     0.0013369552324301222,
     0.0013369552328886957
    ],
    "dtheta": [
     -0.002563152083005319,
     -0.0025631520821777784
    ],
    "euler_residual": -3.552713678800501e-15,
    "Ep": [
     0.0011330902868274726,
     0.0011330902852397778,
     0.0011330902852397784
    ],
    "Epp": [
     0.003517649173427155,
     0.003517649188281665
    ],
    "green_rel_error": 1.477928061095734e-15,
    "eq_3a_root": 1.9987717488829722,
    "eq_3a_root_minus_E": 4.440892098500626e-16,
    "closed_E": 1.9987696954178489,
    "closed_Ep": 0.0011328548748095464
   }
  },
  "max_abs_deviation": {
   "dM": 1.2545520178264269e-12,
   "dtau": 1.3652551311693628e-12,
   "dtheta": 8.964088152318972e-13,
   "euler": 4.218847493575595e-15,
   "V1": 1.5913954182211754e-12,
   "V2": 1.5913947676998719e-12,
   "V12": 6.505213034913027e-19,
   "Epp": 1.5940459455882072e-11,
   "eq310": 1.5543122344752192e-15,
   "green": 1.1937110612725393e-14,
   "conv": 1.9984014443252818e-15,
   "tail": 3.165361573386918e-20,
   "eta": 2.4424906541753444e-15,
   "solvers": 2.4424906541753444e-15,
   "closed_E": 2.0534651228309997e-06,
   "closed_Ep": 2.3541202162679145e-07
  },
  "closed_forms_P0": {
   "u": 0.7999999999999998,
   "a": 0.005000000000000001,
   "eps2": 0.010000000000000002,
   "compare": {
    "s3_1": [
     0.9994515458612895,
     0.9994521720236076
    ],
    "s3_2": [
     0.9994515458612895,
     0.9994521720236076
    ],
    "A1": [
     0.0010948993396561516,
     0.0010956559527848483
    ],
    "A2": [
     0.0010948993396561516,
     0.0010956559527848483
    ],
    "U": [
     -0.0024940068753713397,
     -0.002498780190217697
    ],
    "Ebind": [
     -0.001401116473482178,
     -0.001403124237432848
    ],
    "Epp0": [
     0.003905596125007126,
     0.0039043440472151534
    ]
   },
   "item4": {
    "mb_over_m1_plus_m2": [
     1.2802142976293736,
     1.2806248474865696
    ],
    "mb_minus_m1_m2": [
     56.042859525874704,
     56.044658939287096
    ]
   },
   "max_dE_over_P": 2.0534651228309997e-06,
   "max_dEp_over_P": 2.3541202162679145e-07,
   "rel_dev_Epp0": 0.0003206883862772754
  }
 },
 "B_unequal_R": {
  "params": {
   "M1": 1.0,
   "M2": 1.7,
   "tau1": 0.2,
   "tau2": 0.12,
   "w": [
    -0.01,
    0.005,
    -0.004,
    0.008
   ]
  },
  "P": {
   "-0.30": {
    "E": 2.696652071451656,
    "isolation": 0.0036570933737110067,
    "inside_band": false,
    "weight0": 0.6441146800209665,
    "Gamma": 1.0000000000000004,
    "tail": 3.542800658530355e-21,
    "conv_2L": 4.440892098500626e-16,
    "eta_dependence": 1.7763568394002505e-15,
    "dense_minus_banded": 4.440892098500626e-16,
    "dM1": [
     0.9975918168031079,
     0.9975918168041218
    ],
    "dM2": [
     0.9995873147538702,
     0.9995873147536779
    ],
    "dtau1": [
     0.004803847817314022,
     0.00480384781574927
    ],
    "dtau2": [
     0.0013991144944084746,
     0.0013991144950698544
    ],
    "dtheta": [
     -0.0064411427438404445,
     -0.006441142744538554
    ],
    "euler_residual": -1.3322676295501878e-15,
    "Ep": [
     -0.0015461338158921183,
     -0.0015461338167275206,
     -0.001546133816727594
    ],
    "Epp": [
     0.004673250563932049,
     0.004673250556180512
    ],
    "green_rel_error": 4.277464579962843e-14,
    "eq_3a_root": 2.6966520714516546,
    "eq_3a_root_minus_E": -1.3322676295501878e-15,
    "closed_E": 2.6966438039739637,
    "closed_Ep": -0.001545464131327247
   },
   "-0.15": {
    "E": 2.696475088076594,
    "isolation": 0.0036032185712131515,
    "inside_band": false,
    "weight0": 0.6368363628390621,
    "Gamma": 1.0000000000000004,
    "tail": 7.638554699665447e-21,
    "conv_2L": 3.1086244689504383e-15,
    "eta_dependence": 6.217248937900877e-15,
    "dense_minus_banded": 2.6645352591003757e-15,
    "dM1": [
     0.9976817346970904,
     0.9976817346985778
    ],
    "dM2": [
     0.9996814413248957,
     0.9996814413234609
    ],
    "dtau1": [
     0.004623913755182525,
     0.004623913756321769
    ],
    "dtau2": [
     0.0010793486492725415,
     0.0010793486503045025
    ],
    "dtheta": [
     -0.0063683592788447525,
     -0.006368359278489002
    ],
    "euler_residual": 4.440892098500626e-15,
    "Ep": [
     -0.0008001290118316481,
     -0.0008001290122026834,
     -0.0008001290122026873
    ],
    "Epp": [
     0.005213784762444126,
     0.0052137847511406704
    ],
    "green_rel_error": 4.220620971804914e-14,
    "eq_3a_root": 2.696475088076597,
    "eq_3a_root_minus_E": 3.1086244689504383e-15,
    "closed_E": 2.6964669046101912,
    "closed_Ep": -0.0007997160499104646
   },
   "+0.00": {
    "E": 2.696414739676969,
    "isolation": 0.003585260323031303,
    "inside_band": false,
    "weight0": 0.6343920873760741,
    "Gamma": 1.0000000000000007,
    "tail": 9.860552537011425e-21,
    "conv_2L": 2.6645352591003757e-15,
    "eta_dependence": 3.552713678800501e-15,
    "dense_minus_banded": 3.552713678800501e-15,
    "dM1": [
     0.9977123894775822,
     0.9977123894767301
    ],
    "dM2": [
     0.9997133235958366,
     0.9997133235960436
    ],
    "dtau1": [
     0.004562573288698542,
     0.0045625732893821835
    ],
    "dtau2": [
     0.0009710432199439011,
     0.0009710432203219463
    ],
    "dtheta": [
     -0.006343916422883271,
     -0.006343916422741831
    ],
    "euler_residual": -2.6645352591003757e-15,
    "Ep": [
     1.1102230246251565e-14,
     -1.752348181816857e-19,
     3.6871916661879243e-20
    ],
    "Epp": [
     0.005394417406471656,
     0.005394417424747923
    ],
    "green_rel_error": 4.0500907564219975e-14,
    "eq_3a_root": 2.696414739676964,
    "eq_3a_root_minus_E": -4.884981308350689e-15,
    "closed_E": 2.6964065882071035,
    "closed_Ep": 0.0
   },
   "+0.15": {
    "E": 2.696475088076594,
    "isolation": 0.0036032185712131515,
    "inside_band": false,
    "weight0": 0.6368363628390621,
    "Gamma": 1.0000000000000004,
    "tail": 7.638554699665447e-21,
    "conv_2L": 3.1086244689504383e-15,
    "eta_dependence": 6.217248937900877e-15,
    "dense_minus_banded": 2.6645352591003757e-15,
    "dM1": [
     0.9976817346970904,
     0.9976817346985778
    ],
    "dM2": [
     0.9996814413248957,
     0.9996814413234609
    ],
    "dtau1": [
     0.004623913755182525,
     0.004623913756321769
    ],
    "dtau2": [
     0.0010793486492725415,
     0.0010793486503045025
    ],
    "dtheta": [
     -0.0063683592788447525,
     -0.006368359278489002
    ],
    "euler_residual": 4.440892098500626e-15,
    "Ep": [
     0.0008001290118538525,
     0.0008001290122026834,
     0.0008001290122026873
    ],
    "Epp": [
     0.005213784763184274,
     0.0052137847511406704
    ],
    "green_rel_error": 3.950614916369572e-14,
    "eq_3a_root": 2.696475088076597,
    "eq_3a_root_minus_E": 3.1086244689504383e-15,
    "closed_E": 2.6964669046101912,
    "closed_Ep": 0.0007997160499104646
   },
   "+0.30": {
    "E": 2.696652071451656,
    "isolation": 0.0036570933737110067,
    "inside_band": false,
    "weight0": 0.6441146800209665,
    "Gamma": 1.0000000000000004,
    "tail": 3.542800658530355e-21,
    "conv_2L": 4.440892098500626e-16,
    "eta_dependence": 1.7763568394002505e-15,
    "dense_minus_banded": 4.440892098500626e-16,
    "dM1": [
     0.9975918168031079,
     0.9975918168041218
    ],
    "dM2": [
     0.9995873147538702,
     0.9995873147536779
    ],
    "dtau1": [
     0.004803847817314022,
     0.00480384781574927
    ],
    "dtau2": [
     0.0013991144944084746,
     0.0013991144950698544
    ],
    "dtheta": [
     -0.0064411427438404445,
     -0.006441142744538554
    ],
    "euler_residual": -1.3322676295501878e-15,
    "Ep": [
     0.0015461338158773152,
     0.0015461338167275206,
     0.001546133816727594
    ],
    "Epp": [
     0.004673250560231305,
     0.004673250556180512
    ],
    "green_rel_error": 4.2348320426210185e-14,
    "eq_3a_root": 2.6966520714516546,
    "eq_3a_root_minus_E": -1.3322676295501878e-15,
    "closed_E": 2.6966438039739637,
    "closed_Ep": 0.001545464131327247
   }
  },
  "max_abs_deviation": {
   "dM": 1.4873657860903222e-12,
   "dtau": 1.5647518003536476e-12,
   "dtheta": 6.981091052460364e-13,
   "euler": 4.440892098500626e-15,
   "V1": 8.502053228109929e-13,
   "V2": 8.502788317182874e-13,
   "V12": 7.35089072945172e-17,
   "Epp": 1.8276266784689188e-11,
   "eq310": 4.884981308350689e-15,
   "green": 4.277464579962843e-14,
   "conv": 3.1086244689504383e-15,
   "tail": 9.860552537011425e-21,
   "eta": 6.217248937900877e-15,
   "solvers": 3.552713678800501e-15,
   "closed_E": 8.267477692225356e-06,
   "closed_Ep": 6.69684564871386e-07
  },
  "closed_forms_P0": {
   "u": 0.8252427184466018,
   "a": 0.012117647058823532,
   "eps2": 0.04000000000000001,
   "compare": {
    "s3_1": [
     0.9977123894767301,
     0.997712813740429
    ],
    "s3_2": [
     0.9997133235960436,
     0.9997150909849669
    ],
    "A1": [
     0.0045625732893821835,
     0.004574372519142084
    ],
    "A2": [
     0.0009710432203219463,
     0.0009686906511124409
    ],
    "U": [
     -0.006343916422741831,
     -0.0063649433780238966
    ],
    "Ebind": [
     -0.003585260323031081,
     -0.003593411792896635
    ],
    "Epp0": [
     0.005394417424747923,
     0.005391481449620242
    ]
   },
   "item4": {
    "mb_over_m1_plus_m2": [
     1.295838032493856,
     1.2965436916468096
    ],
    "mb_minus_m1_m2": [
     42.321274092871064,
     42.32598992467248
    ]
   },
   "max_dE_over_P": 8.267477692225356e-06,
   "max_dEp_over_P": 6.69684564871386e-07,
   "rel_dev_Epp0": 0.0005445581432701723
  }
 },
 "C_above_band_R": {
  "params": {
   "M1": 1.0,
   "M2": 0.8,
   "tau1": 0.1,
   "tau2": 0.15,
   "w": [
    0.02,
    -0.005,
    0.003,
    -0.01
   ]
  },
  "P": {
   "-0.30": {
    "E": 1.8313465315612105,
    "isolation": 0.012743087345902016,
    "inside_band": false,
    "weight0": 0.9036658105468726,
    "Gamma": 1.000000000000001,
    "tail": 5.5580167244561765e-28,
    "conv_2L": 2.220446049250313e-16,
    "eta_dependence": 1.3322676295501878e-15,
    "dense_minus_banded": 2.220446049250313e-16,
    "dM1": [
     0.9966369378430021,
     0.996636937842992
    ],
    "dM2": [
     0.9881027121923698,
     0.9881027121927409
    ],
    "dtau1": [
     0.006793044051933705,
     0.006793044052046955
    ],
    "dtau2": [
     0.019361128223926993,
     0.019361128223725578
    ],
    "dtheta": [
     0.018073251688214647,
     0.01807325168825412
    ],
    "euler_residual": 8.881784197001252e-16,
    "Ep": [
     0.0008867732218753588,
     0.0008867732246106974,
     0.00088677322461067
    ],
    "Epp": [
     -0.0026292340571387744,
     -0.002629234044505366
    ],
    "green_rel_error": 4.9737813445611155e-15,
    "eq_3a_root": 1.8313465315612096,
    "eq_3a_root_minus_E": -8.881784197001252e-16,
    "closed_E": 1.8315472483142752,
    "closed_Ep": 0.0009016494129372725
   },
   "-0.15": {
    "E": 1.8314483719913548,
    "isolation": 0.012601844860038236,
    "inside_band": false,
    "weight0": 0.8994257891125012,
    "Gamma": 0.9999999999999997,
    "tail": 2.381395421773662e-28,
    "conv_2L": 0.0,
    "eta_dependence": 8.881784197001252e-16,
    "dense_minus_banded": 4.440892098500626e-16,
    "dM1": [
     0.9965405216444585,
     0.9965405216446359
    ],
    "dM2": [
     0.9879941423733782,
     0.9879941423726564
    ],
    "dtau1": [
     0.0069871784095232314,
     0.006987178410096289
    ],
    "dtau2": [
     0.01953691097944521,
     0.019536910979863466
    ],
    "dtheta": [
     0.017988447059746893,
     0.01798844705863354
    ],
    "euler_residual": -4.440892098500626e-16,
    "Ep": [
     0.00046191115759726864,
     0.000461911158908447,
     0.00046191115890853256
    ],
    "Epp": [
     -0.002996418482966353,
     -0.002996418484758176
    ],
    "green_rel_error": 5.684320109558415e-16,
    "eq_3a_root": 1.831448371991355,
    "eq_3a_root_minus_E": 2.220446049250313e-16,
    "closed_E": 1.8316508007415573,
    "closed_Ep": 0.0004696922820371139
   },
   "+0.00": {
    "E": 1.8314832491433681,
    "isolation": 0.012554657226293786,
    "inside_band": false,
    "weight0": 0.8979827973644506,
    "Gamma": 0.9999999999999993,
    "tail": 1.265245303041117e-28,
    "conv_2L": 0.0,
    "eta_dependence": 0.0,
    "dense_minus_banded": 0.0,
    "dM1": [
     0.9965076038347213,
     0.9965076038341719
    ],
    "dM2": [
     0.9879570643803874,
     0.9879570643793468
    ],
    "dtau1": [
     0.007053461200556832,
     0.0070534612009323285
    ],
    "dtau2": [
     0.01959694681237985,
     0.01959694681368228
    ],
    "dtheta": [
     0.01795958579122366,
     0.0179595857911024
    ],
    "euler_residual": -1.7763568394002505e-15,
    "Ep": [
     1.8503717077085944e-15,
     -1.6041830992033249e-19,
     5.73573563285171e-19
    ],
    "Epp": [
     -0.0031210110453446425,
     -0.003121011047160065
    ],
    "green_rel_error": 1.5631878954715505e-15,
    "eq_3a_root": 1.8314832491433677,
    "eq_3a_root_minus_E": -4.440892098500626e-16,
    "closed_E": 1.8316862658330455,
    "closed_Ep": -0.0
   },
   "+0.15": {
    "E": 1.8314483719913548,
    "isolation": 0.012601844860038236,
    "inside_band": false,
    "weight0": 0.8994257891125012,
    "Gamma": 0.9999999999999997,
    "tail": 2.381395421773662e-28,
    "conv_2L": 0.0,
    "eta_dependence": 8.881784197001252e-16,
    "dense_minus_banded": 4.440892098500626e-16,
    "dM1": [
     0.9965405216444585,
     0.9965405216446359
    ],
    "dM2": [
     0.9879941423733782,
     0.9879941423726564
    ],
    "dtau1": [
     0.0069871784095232314,
     0.006987178410096289
    ],
    "dtau2": [
     0.01953691097944521,
     0.019536910979863466
    ],
    "dtheta": [
     0.017988447059746893,
     0.01798844705863354
    ],
    "euler_residual": -4.440892098500626e-16,
    "Ep": [
     -0.0004619111575861664,
     -0.000461911158908447,
     -0.00046191115890853256
    ],
    "Epp": [
     -0.0029964184811159815,
     -0.002996418484758176
    ],
    "green_rel_error": 2.2737280438233693e-15,
    "eq_3a_root": 1.831448371991355,
    "eq_3a_root_minus_E": 2.220446049250313e-16,
    "closed_E": 1.8316508007415573,
    "closed_Ep": -0.0004696922820371139
   },
   "+0.30": {
    "E": 1.8313465315612105,
    "isolation": 0.012743087345902016,
    "inside_band": false,
    "weight0": 0.9036658105468726,
    "Gamma": 1.000000000000001,
    "tail": 5.5580167244561765e-28,
    "conv_2L": 2.220446049250313e-16,
    "eta_dependence": 1.3322676295501878e-15,
    "dense_minus_banded": 2.220446049250313e-16,
    "dM1": [
     0.9966369378430021,
     0.996636937842992
    ],
    "dM2": [
     0.9881027121923698,
     0.9881027121927409
    ],
    "dtau1": [
     0.006793044051933705,
     0.006793044052046955
    ],
    "dtau2": [
     0.019361128223926993,
     0.019361128223725578
    ],
    "dtheta": [
     0.018073251688214647,
     0.01807325168825412
    ],
    "euler_residual": 8.881784197001252e-16,
    "Ep": [
     -0.0008867732218772092,
     -0.0008867732246106974,
     -0.00088677322461067
    ],
    "Epp": [
     -0.002629234056953737,
     -0.002629234044505366
    ],
    "green_rel_error": 2.8421607683206314e-15,
    "eq_3a_root": 1.8313465315612096,
    "eq_3a_root_minus_E": -8.881784197001252e-16,
    "closed_E": 1.8315472483142752,
    "closed_Ep": -0.0009016494129372725
   }
  },
  "max_abs_deviation": {
   "dM": 1.0406120409811592e-12,
   "dtau": 1.3024269163164348e-12,
   "dtheta": 1.1133524657758187e-12,
   "euler": 1.7763568394002505e-15,
   "V1": 2.7353386482936726e-12,
   "V2": 2.7353112179787087e-12,
   "V12": 8.55435514091063e-17,
   "Epp": 1.2633408642132027e-11,
   "eq310": 8.881784197001252e-16,
   "green": 4.9737813445611155e-15,
   "conv": 2.220446049250313e-16,
   "tail": 5.5580167244561765e-28,
   "eta": 1.3322676295501878e-15,
   "solvers": 4.440892098500626e-16,
   "closed_E": 0.00020301668967737108,
   "closed_Ep": 1.4876191061913725e-05
  },
  "closed_forms_P0": {
   "u": 2.098360655737705,
   "a": 0.00953125,
   "eps2": 0.035156249999999986,
   "compare": {
    "s3_1": [
     0.9965076038341719,
     0.9964244816984306
    ],
    "s3_2": [
     0.9879570643793468,
     0.9874298184710452
    ],
    "A1": [
     0.0070534612009323285,
     0.007151036603138771
    ],
    "A2": [
     0.01959694681368228,
     0.02011229044632779
    ],
    "U": [
     0.0179595857911024,
     0.018054602308312292
    ],
    "Ebind": [
     0.031483249143368086,
     0.031686265833045575
    ],
    "Epp0": [
     -0.003121011047160065,
     -0.0031736605620080204
    ]
   },
   "item4": {
    "mb_over_m1_plus_m2": [
     -2.3636728831961515,
     -2.3244606775654373
    ],
    "mb_minus_m1_m2": [
     -455.9645463888116,
     -447.7617655945683
    ]
   },
   "max_dE_over_P": 0.00020301668967737108,
   "max_dEp_over_P": 1.4876191061913725e-05,
   "rel_dev_Epp0": 0.016589522987500434
  }
 },
 "D_wide_R": {
  "params": {
   "M1": 1.3,
   "M2": 1.0,
   "tau1": 0.15,
   "tau2": 0.2,
   "w": [
    -0.004,
    0.002,
    0.001,
    0.003
   ]
  },
  "P": {
   "-0.30": {
    "E": 2.2999698406707054,
    "isolation": 0.0005676902764646385,
    "inside_band": false,
    "weight0": 0.27803153364811334,
    "Gamma": 1.0000000000000016,
    "tail": 2.5420251273295236e-08,
    "conv_2L": 3.1086244689504383e-15,
    "eta_dependence": 3.9968028886505635e-15,
    "dense_minus_banded": 2.220446049250313e-15,
    "dM1": [
     0.9995878102232201,
     0.9995878102226097
    ],
    "dM2": [
     0.9994525069865201,
     0.9994525069865698
    ],
    "dtau1": [
     0.0010710953159964731,
     0.0010710953162301957
    ],
    "dtau2": [
     0.0010942109083626288,
     0.0010942109070576644
    ],
    "dtheta": [
     -0.0011121258306120059,
     -0.0011121258285397067
    ],
    "euler_residual": 5.329070518200751e-15,
    "Ep": [
     -0.003402250763991551,
     -0.0034022507589530036,
     -0.003402250758953079
    ],
    "Epp": [
     0.010746616826059116,
     0.01074661686468223
    ],
    "green_rel_error": 2.3374007407359554e-13,
    "eq_3a_root": 2.299969840670707,
    "eq_3a_root_minus_E": 1.7763568394002505e-15,
    "closed_E": 2.299969153832336,
    "closed_Ep": -0.003403264820215837
   },
   "-0.15": {
    "E": 2.2995833452872985,
    "isolation": 0.0005521813277367116,
    "inside_band": false,
    "weight0": 0.27073149336333957,
    "Gamma": 0.9999999999999983,
    "tail": 4.14179099418866e-08,
    "conv_2L": 4.440892098500626e-16,
    "eta_dependence": 4.440892098500626e-15,
    "dense_minus_banded": 0.0,
    "dM1": [
     0.9998046921911036,
     0.9998046921896625
    ],
    "dM2": [
     0.9995861016039997,
     0.9995861016019525
    ],
    "dtau1": [
     0.0005071638142783996,
     0.0005071638149982289
    ],
    "dtau2": [
     0.0008269056284149201,
     0.0008269056293956405
    ],
    "dtheta": [
     -0.0010829256051521814,
     -0.0010829256056103754
    ],
    "euler_residual": -1.3322676295501878e-15,
    "Ep": [
     -0.0017343104155761089,
     -0.0017343104135742542,
     -0.0017343104135741697
    ],
    "Epp": [
     0.01141561427608906,
     0.01141561422753753
    ],
    "green_rel_error": 2.1441330315987695e-13,
    "eq_3a_root": 2.2995833452873002,
    "eq_3a_root_minus_E": 1.7763568394002505e-15,
    "closed_E": 2.299582581337323,
    "closed_Ep": -0.0017344866586560333
   },
   "+0.00": {
    "E": 2.2994528607227624,
    "isolation": 0.000547139277237374,
    "inside_band": false,
    "weight0": 0.2683527421411404,
    "Gamma": 0.9999999999999991,
    "tail": 4.853656656034339e-08,
    "conv_2L": 4.440892098500626e-15,
    "eta_dependence": 1.7763568394002505e-15,
    "dense_minus_banded": 1.7763568394002505e-15,
    "dM1": [
     0.9998771296688006,
     0.9998771296692601
    ],
    "dM2": [
     0.9996319144148039,
     0.9996319144145291
    ],
    "dtau1": [
     0.0003188390674072986,
     0.00031883906936428863
    ],
    "dtau2": [
     0.000735249248003574,
     0.0007352492475109331
    ],
    "dtheta": [
     -0.00107341058008803,
     -0.0010734105786802063
    ],
    "euler_residual": -4.440892098500626e-16,
    "Ep": [
     1.1102230246251565e-14,
     -2.2352182505058147e-19,
     5.295571825345954e-19
    ],
    "Epp": [
     0.01163513175472808,
     0.011635131655509572
    ],
    "green_rel_error": 2.302157628221212e-13,
    "eq_3a_root": 2.299452860722764,
    "eq_3a_root_minus_E": 1.3322676295501878e-15,
    "closed_E": 2.2994520877886893,
    "closed_Ep": 0.0
   },
   "+0.15": {
    "E": 2.2995833452872985,
    "isolation": 0.0005521813277367116,
    "inside_band": false,
    "weight0": 0.27073149336333957,
    "Gamma": 0.9999999999999983,
    "tail": 4.14179099418866e-08,
    "conv_2L": 4.440892098500626e-16,
    "eta_dependence": 4.440892098500626e-15,
    "dense_minus_banded": 0.0,
    "dM1": [
     0.9998046921911036,
     0.9998046921896625
    ],
    "dM2": [
     0.9995861016039997,
     0.9995861016019525
    ],
    "dtau1": [
     0.0005071638142783996,
     0.0005071638149982289
    ],
    "dtau2": [
     0.0008269056284149201,
     0.0008269056293956405
    ],
    "dtheta": [
     -0.0010829256051521814,
     -0.0010829256056103754
    ],
    "euler_residual": -1.3322676295501878e-15,
    "Ep": [
     0.0017343104155650066,
     0.0017343104135742542,
     0.0017343104135741697
    ],
    "Epp": [
     0.011415614271278093,
     0.01141561422753753
    ],
    "green_rel_error": 2.1464067675813775e-13,
    "eq_3a_root": 2.2995833452873002,
    "eq_3a_root_minus_E": 1.7763568394002505e-15,
    "closed_E": 2.299582581337323,
    "closed_Ep": 0.0017344866586560333
   },
   "+0.30": {
    "E": 2.2999698406707054,
    "isolation": 0.0005676902764646385,
    "inside_band": false,
    "weight0": 0.27803153364811334,
    "Gamma": 1.0000000000000016,
    "tail": 2.5420251273295236e-08,
    "conv_2L": 3.1086244689504383e-15,
    "eta_dependence": 3.9968028886505635e-15,
    "dense_minus_banded": 2.220446049250313e-15,
    "dM1": [
     0.9995878102232201,
     0.9995878102226097
    ],
    "dM2": [
     0.9994525069865201,
     0.9994525069865698
    ],
    "dtau1": [
     0.0010710953159964731,
     0.0010710953162301957
    ],
    "dtau2": [
     0.0010942109083626288,
     0.0010942109070576644
    ],
    "dtheta": [
     -0.0011121258306120059,
     -0.0011121258285397067
    ],
    "euler_residual": 5.329070518200751e-15,
    "Ep": [
     0.0034022507639841493,
     0.0034022507589530036,
     0.003402250758953079
    ],
    "Epp": [
     0.010746616826799265,
     0.01074661686468223
    ],
    "green_rel_error": 2.328305796219475e-13,
    "eq_3a_root": 2.299969840670707,
    "eq_3a_root_minus_E": 1.7763568394002505e-15,
    "closed_E": 2.299969153832336,
    "closed_Ep": 0.003403264820215837
   }
  },
  "max_abs_deviation": {
   "dM": 2.0472512574087887e-12,
   "dtau": 1.956990017086546e-12,
   "dtheta": 2.0722991465188523e-12,
   "euler": 5.329070518200751e-15,
   "V1": 5.038547270380667e-12,
   "V2": 5.038471809909462e-12,
   "V12": 8.456776945386935e-17,
   "Epp": 9.921850840921564e-11,
   "eq310": 1.7763568394002505e-15,
   "green": 2.3374007407359554e-13,
   "conv": 4.440892098500626e-15,
   "tail": 4.853656656034339e-08,
   "eta": 4.440892098500626e-15,
   "solvers": 2.220446049250313e-15,
   "closed_E": 7.729340731899015e-07,
   "closed_Ep": 1.0140562316878453e-06
  },
  "closed_forms_P0": {
   "u": 0.2791946308724832,
   "a": 0.014326923076923077,
   "eps2": 0.04000000000000001,
   "compare": {
    "s3_1": [
     0.9998771296692601,
     0.9998773988238779
    ],
    "s3_2": [
     0.9996319144145291,
     0.9996316515775179
    ],
    "A1": [
     0.00031883906936428863,
     0.00031876305791723347
    ],
    "A2": [
     0.0007352492475109331,
     0.0007366968449642731
    ],
    "U": [
     -0.0010734105786802063,
     -0.0010756421627509882
    ],
    "Ebind": [
     -0.000547139277237596,
     -0.000547912211310236
    ],
    "Epp0": [
     0.011635131655509572,
     0.011635552241296749
    ]
   },
   "item4": {
    "mb_over_m1_plus_m2": [
     1.0382810672392517,
     1.0382435368968217
    ],
    "mb_minus_m1_m2": [
     3.168821677026937,
     3.161249157372777
    ]
   },
   "max_dE_over_P": 7.729340731899015e-07,
   "max_dEp_over_P": 1.0140562316878453e-06,
   "rel_dev_Epp0": 3.61466115621009e-05
  }
 },
 "E_order_one": {
  "params": {
   "M1": 1.0,
   "M2": 1.3,
   "tau1": 1.0,
   "tau2": 0.8,
   "w": [
    -0.6,
    0.2,
    -0.15,
    0.3
   ]
  },
  "P": {
   "-0.30": {
    "E": 2.0202430653650967,
    "isolation": 0.29440305721726867,
    "inside_band": false,
    "weight0": 0.701707383851894,
    "Gamma": 1.0000000000000004,
    "tail": 1.7199875421734497e-30,
    "conv_2L": 4.440892098500626e-16,
    "eta_dependence": 4.440892098500626e-16,
    "dense_minus_banded": 4.440892098500626e-16,
    "dM1": [
     0.8503318666591339,
     0.8503318666583716
    ],
    "dM2": [
     0.9328219265201905,
     0.9328219265196965
    ],
    "dtau1": [
     0.23778305062290467,
     0.23778305062442884
    ],
    "dtau2": [
     0.13944747911154295,
     0.13944747911219654
    ],
    "dtheta": [
     -0.41998783550600827,
     -0.41998783550550445
    ],
    "euler_residual": 1.3322676295501878e-15,
    "Ep": [
     -0.0533071623368205,
     -0.05330716251086799,
     -0.05330716251086764
    ],
    "Epp": [
     0.15802105920115217,
     0.15802105937262773
    ],
    "green_rel_error": 1.9938464141953312e-15,
    "eq_3a_root": 2.020243065365098,
    "eq_3a_root_minus_E": 1.3322676295501878e-15,
    "closed_E": 1.9741936617317075,
    "closed_Ep": -0.049718216265647104
   },
   "-0.15": {
    "E": 2.0141207903858516,
    "isolation": 0.2895782974541672,
    "inside_band": false,
    "weight0": 0.6956259399840091,
    "Gamma": 0.9999999999999998,
    "tail": 2.1615467344399323e-30,
    "conv_2L": 4.440892098500626e-16,
    "eta_dependence": 8.881784197001252e-16,
    "dense_minus_banded": 2.6645352591003757e-15,
    "dM1": [
     0.8549045880839415,
     0.8549045880838624
    ],
    "dM2": [
     0.9371204279218225,
     0.9371204279213157
    ],
    "dtau1": [
     0.22858232492573016,
     0.22858232492677993
    ],
    "dtau2": [
     0.12864136876322704,
     0.1286413687625461
    ],
    "dtheta": [
     -0.416264047684541,
     -0.41626404768504804
    ],
    "euler_residual": -4.440892098500626e-16,
    "Ep": [
     -0.02776996948270864,
     -0.027769969570427034,
     -0.027769969570427072
    ],
    "Epp": [
     0.1801269900647551,
     0.1801269902164982
    ],
    "green_rel_error": 3.588255397739565e-15,
    "eq_3a_root": 2.014120790385851,
    "eq_3a_root_minus_E": -4.440892098500626e-16,
    "closed_E": 1.9684934526588127,
    "closed_Ep": -0.025810794086150356
   },
   "+0.00": {
    "E": 2.012023935088437,
    "isolation": 0.2879760649115628,
    "inside_band": false,
    "weight0": 0.6935661601144257,
    "Gamma": 0.9999999999999994,
    "tail": 2.2610645562733344e-30,
    "conv_2L": 8.881784197001252e-16,
    "eta_dependence": 8.881784197001252e-16,
    "dense_minus_banded": 8.881784197001252e-16,
    "dM1": [
     0.8564696712686226,
     0.8564696712688329
    ],
    "dM2": [
     0.938590891190379,
     0.9385908911908176
    ],
    "dtau1": [
     0.2254381116959895,
     0.22543811169631017
    ],
    "dtau2": [
     0.1249503925203251,
     0.1249503925193654
    ],
    "dtheta": [
     -0.41500239894528185,
     -0.4150023989441348
    ],
    "euler_residual": -4.440892098500626e-16,
    "Ep": [
     -7.401486830834377e-15,
     -3.140156509536244e-17,
     1.9141900210567238e-17
    ],
    "Epp": [
     0.1876436174034583,
     0.18764361764368498
    ],
    "green_rel_error": 4.983365620674174e-16,
    "eq_3a_root": 2.012023935088438,
    "eq_3a_root_minus_E": 8.881784197001252e-16,
    "closed_E": 1.9665456848909921,
    "closed_Ep": 0.0
   },
   "+0.15": {
    "E": 2.0141207903858516,
    "isolation": 0.2895782974541672,
    "inside_band": false,
    "weight0": 0.6956259399840091,
    "Gamma": 0.9999999999999998,
    "tail": 2.1615467344399323e-30,
    "conv_2L": 4.440892098500626e-16,
    "eta_dependence": 8.881784197001252e-16,
    "dense_minus_banded": 2.6645352591003757e-15,
    "dM1": [
     0.8549045880839415,
     0.8549045880838624
    ],
    "dM2": [
     0.9371204279218225,
     0.9371204279213157
    ],
    "dtau1": [
     0.22858232492580416,
     0.22858232492677993
    ],
    "dtau2": [
     0.12864136876322704,
     0.1286413687625461
    ],
    "dtheta": [
     -0.416264047684541,
     -0.41626404768504804
    ],
    "euler_residual": -4.440892098500626e-16,
    "Ep": [
     0.027769969482642026,
     0.027769969570427034,
     0.027769969570427072
    ],
    "Epp": [
     0.18012699007659747,
     0.1801269902164982
    ],
    "green_rel_error": 3.1895603535462812e-15,
    "eq_3a_root": 2.014120790385851,
    "eq_3a_root_minus_E": -4.440892098500626e-16,
    "closed_E": 1.9684934526588127,
    "closed_Ep": 0.025810794086150356
   },
   "+0.30": {
    "E": 2.0202430653650967,
    "isolation": 0.29440305721726867,
    "inside_band": false,
    "weight0": 0.701707383851894,
    "Gamma": 1.0000000000000004,
    "tail": 1.7199875421734497e-30,
    "conv_2L": 4.440892098500626e-16,
    "eta_dependence": 4.440892098500626e-16,
    "dense_minus_banded": 4.440892098500626e-16,
    "dM1": [
     0.8503318666591339,
     0.8503318666583716
    ],
    "dM2": [
     0.9328219265201905,
     0.9328219265196965
    ],
    "dtau1": [
     0.23778305062290467,
     0.23778305062442884
    ],
    "dtau2": [
     0.13944747911157998,
     0.13944747911219654
    ],
    "dtheta": [
     -0.41998783550600827,
     -0.41998783550550445
    ],
    "euler_residual": 1.3322676295501878e-15,
    "Ep": [
     0.0533071623368205,
     0.05330716251086799,
     0.05330716251086764
    ],
    "Epp": [
     0.15802105920041204,
     0.15802105937262773
    ],
    "green_rel_error": 3.9876928283906716e-16,
    "eq_3a_root": 2.020243065365098,
    "eq_3a_root_minus_E": 1.3322676295501878e-15,
    "closed_E": 1.9741936617317075,
    "closed_Ep": 0.049718216265647104
   }
  },
  "max_abs_deviation": {
   "dM": 7.622791287076325e-13,
   "dtau": 1.5241696793566462e-12,
   "dtheta": 1.1470269178914805e-12,
   "euler": 1.3322676295501878e-15,
   "V1": 1.7404749169669387e-10,
   "V2": 1.7404713781310477e-10,
   "V12": 3.5388358909926865e-16,
   "Epp": 2.4022667188816627e-10,
   "eq310": 1.3322676295501878e-15,
   "green": 3.588255397739565e-15,
   "conv": 8.881784197001252e-16,
   "tail": 2.2610645562733344e-30,
   "eta": 8.881784197001252e-16,
   "solvers": 2.6645352591003757e-15,
   "closed_E": 0.04604940363338916,
   "closed_Ep": 0.003588946071173396
  },
  "closed_forms_P0": {
   "u": 1.6082474226804122,
   "a": 0.3730769230769231,
   "eps2": 1.0,
   "compare": {
    "s3_1": [
     0.8564696712688329,
     0.8820100594684337
    ],
    "s3_2": [
     0.9385908911908176,
     0.9553174189702944
    ],
    "A1": [
     0.22543811169631017,
     0.23597988106313272
    ],
    "A2": [
     0.1249503925193654,
     0.11617471067723459
    ],
    "U": [
     -0.4150023989441348,
     -0.5095316109791912
    ],
    "Ebind": [
     -0.287976064911563,
     -0.3334543151090077
    ],
    "Epp0": [
     0.18764361764368498,
     0.1741988413604073
    ]
   },
   "item4": {
    "mb_over_m1_plus_m2": [
     1.7581035334915232,
     1.893795071426206
    ],
    "mb_minus_m1_m2": [
     2.298001335896179,
     2.339805527406449
    ]
   },
   "max_dE_over_P": 0.04604940363338916,
   "max_dEp_over_P": 0.003588946071173396,
   "rel_dev_Epp0": 0.07718062978077568
  }
 },
 "epsilon_scan_set_B": [
  {
   "eps": 1.0,
   "dE_P0": 8.151469865325112e-06,
   "dE_P03": 8.267477692225356e-06,
   "rel_dEpp0": 0.0005445581432701723,
   "d_s3_1": -4.2426369883941106e-07,
   "d_s3_2": -1.7673889233238427e-06
  },
  {
   "eps": 0.5,
   "dE_P0": 5.094345443268367e-07,
   "dE_P03": 5.167414247608804e-07,
   "rel_dEpp0": 0.00013707918516712943,
   "d_s3_1": -2.720324154825704e-08,
   "d_s3_2": -1.10197183156302e-07,
   "ratio_to_previous": {
    "dE_P0": 16.001015157102092,
    "dE_P03": 15.99925474535178,
    "rel_dEpp0": 3.972580830607048,
    "d_s3_1": 15.596071449308377,
    "d_s3_2": 16.038421969616095
   }
  },
  {
   "eps": 0.25,
   "dE_P0": 3.183914820681366e-08,
   "dE_P03": 3.2296711527379784e-08,
   "rel_dEpp0": 3.432847031626075e-05,
   "d_s3_1": -1.7109325067821146e-09,
   "d_s3_2": -6.883195680096321e-09,
   "ratio_to_previous": {
    "dE_P0": 16.000256697125344,
    "dE_P03": 15.999815471083144,
    "rel_dEpp0": 3.9931632229530947,
    "d_s3_1": 15.899657900252487,
    "d_s3_2": 16.00959616402478
   }
  },
  {
   "eps": 0.125,
   "dE_P0": 1.9899379921639593e-09,
   "dE_P03": 2.018550659954599e-09,
   "rel_dEpp0": 8.585780804080197e-06,
   "d_s3_1": -1.0710143882874945e-10,
   "d_s3_2": -4.3013559380966626e-10,
   "ratio_to_previous": {
    "dE_P0": 16.00007052088601,
    "dE_P03": 15.999950939109054,
    "rel_dEpp0": 3.9982933526496423,
    "d_s3_1": 15.974878820422024,
    "d_s3_2": 16.002385710823354
   }
  }
 ],
 "settings": {
  "L": 120,
  "L_check": 240,
  "P_values": [
   -0.3,
   -0.15,
   0.0,
   0.15,
   0.3
  ],
  "eta": 0.5,
  "h_P": 0.01,
  "h_rel_parameters": 0.001
 },
 "new_in_v2": {
  "I3_clock": [
   {
    "part": 1,
    "N": 4,
    "D": 0.06,
    "lambda0": 78.53981633974483,
    "g0": 0.28810180056785306,
    "D_over_g0": 0.2082597188970672,
    "D_over_M": 0.06,
    "sum_q_minus_1": 2.9976021664879227e-15,
    "Gamma_level0": 0.8564696712688329,
    "Gamma_mean_level": 0.8621903822649348,
    "Gamma_first_order": 0.8623337319853568,
    "Gamma_fit": 0.8621456724086228,
    "d2E_dM2": 0.19546869055079613,
    "d2E_dM2_closed": 0.17218462083533354,
    "Gamma_closed_11_20_at_mean": 0.8870173806068575,
    "Gamma_closed_11_26": 0.8871755980934937,
    "dev_mean_level": 0.0009467967298583124,
    "dev_level0": 0.07097572305973499,
    "dev_first_order": 0.002645333718387599,
    "dev_mean_level_first_revolution": 0.0003598364085480865,
    "dev_level0_first_revolution": 0.03789662732937604,
    "set": "E_order_one"
   },
   {
    "part": 1,
    "N": 4,
    "D": 0.03,
    "lambda0": 157.07963267948966,
    "g0": 0.28810180056785306,
    "D_over_g0": 0.1041298594485336,
    "D_over_M": 0.03,
    "sum_q_minus_1": 1.9984014443252818e-15,
    "Gamma_level0": 0.8564696712688329,
    "Gamma_mean_level": 0.8593655981103847,
    "Gamma_first_order": 0.8594017016270948,
    "Gamma_fit": 0.8593541025206765,
    "d2E_dM2": 0.19546869055079613,
    "d2E_dM2_closed": 0.17218462083533354,
    "Gamma_closed_11_20_at_mean": 0.884552755442187,
    "Gamma_closed_11_26": 0.8845928287809637,
    "dev_mean_level": 0.0002475659342767722,
    "dev_level0": 0.03606318054154545,
    "dev_first_order": 0.0006866642287148839,
    "dev_mean_level_first_revolution": 9.234651743539324e-05,
    "dev_level0_first_revolution": 0.019233635157828832,
    "set": "E_order_one",
    "ratio_to_previous": {
     "dev_mean_level": 3.824422502329495,
     "dev_level0": 1.9680938284955107,
     "dev_first_order": 3.8524414229913124
    }
   },
   {
    "part": 1,
    "N": 4,
    "D": 0.015,
    "lambda0": 314.1592653589793,
    "g0": 0.28810180056785306,
    "D_over_g0": 0.0520649297242668,
    "D_over_M": 0.015,
    "sum_q_minus_1": 1.3322676295501878e-15,
    "Gamma_level0": 0.8564696712688329,
    "Gamma_mean_level": 0.8579266273579921,
    "Gamma_first_order": 0.8579356864479638,
    "Gamma_fit": 0.8579237667072714,
    "d2E_dM2": 0.19546869055079613,
    "d2E_dM2_closed": 0.17218462083533354,
    "Gamma_closed_11_20_at_mean": 0.8832913598005296,
    "Gamma_closed_11_26": 0.8833014441246987,
    "dev_mean_level": 6.07722356592566e-05,
    "dev_level0": 0.018160681641319787,
    "dev_first_order": 0.00017070048426082174,
    "dev_mean_level_first_revolution": 2.3218168594296706e-05,
    "dev_level0_first_revolution": 0.009685663579682813,
    "set": "E_order_one",
    "ratio_to_previous": {
     "dev_mean_level": 4.073668371603898,
     "dev_level0": 1.9857834223299913,
     "dev_first_order": 4.022626131896003
    }
   },
   {
    "part": 1,
    "N": 4,
    "D": 0.1,
    "lambda0": 47.12388980384689,
    "g0": 0.003589344384700155,
    "D_over_g0": 27.86024111429858,
    "D_over_M": 0.1,
    "sum_q_minus_1": 1.1102230246251565e-15,
    "Gamma_level0": 0.9977123894767301,
    "Gamma_mean_level": 0.9978093967582963,
    "Gamma_first_order": 0.9978119032690593,
    "Gamma_fit": 0.9978328312332096,
    "d2E_dM2": 0.001990275846584925,
    "d2E_dM2_closed": 0.0019957745654456236,
    "Gamma_closed_11_20_at_mean": 0.9978100720044616,
    "Gamma_closed_11_26": 0.9978126024687013,
    "dev_mean_level": 0.00046856157329266956,
    "dev_level0": 0.0014255752432916768,
    "dev_first_order": 0.000470726417796663,
    "dev_mean_level_first_revolution": 0.00041275611907753973,
    "dev_level0_first_revolution": 0.0009115174225038936,
    "set": "B_unequal_R"
   },
   {
    "part": 1,
    "N": 4,
    "D": 0.05,
    "lambda0": 94.24777960769379,
    "g0": 0.003589344384700155,
    "D_over_g0": 13.93012055714929,
    "D_over_M": 0.05,
    "sum_q_minus_1": 2.6645352591003757e-15,
    "Gamma_level0": 0.9977123894767301,
    "Gamma_mean_level": 0.9977615159617519,
    "Gamma_first_order": 0.9977621463728947,
    "Gamma_fit": 0.9977620037487646,
    "d2E_dM2": 0.001990275846584925,
    "d2E_dM2_closed": 0.0019957745654456236,
    "Gamma_closed_11_20_at_mean": 0.9977620715654857,
    "Gamma_closed_11_26": 0.9977627081045651,
    "dev_mean_level": 0.0001306954843264263,
    "dev_level0": 0.0005874380983595939,
    "dev_first_order": 0.00013091300811862716,
    "dev_mean_level_first_revolution": 0.0001251309988861138,
    "dev_level0_first_revolution": 0.000351697595908973,
    "set": "B_unequal_R",
    "ratio_to_previous": {
     "dev_mean_level": 3.5851397292532745,
     "dev_level0": 2.426766747462515,
     "dev_first_order": 3.5957192074458564
    }
   },
   {
    "part": 1,
    "N": 4,
    "D": 0.025,
    "lambda0": 188.49555921538757,
    "g0": 0.003589344384700155,
    "D_over_g0": 6.965060278574645,
    "D_over_M": 0.025,
    "sum_q_minus_1": 2.220446049250313e-15,
    "Gamma_level0": 0.9977123894767301,
    "Gamma_mean_level": 0.9977371098586924,
    "Gamma_first_order": 0.9977372679248124,
    "Gamma_fit": 0.9977368501719874,
    "d2E_dM2": 0.001990275846584925,
    "d2E_dM2_closed": 0.0019957745654456236,
    "Gamma_closed_11_20_at_mean": 0.997737601306593,
    "Gamma_closed_11_26": 0.997737760922497,
    "dev_mean_level": 3.2593668840674717e-05,
    "dev_level0": 0.00030208804183140536,
    "dev_first_order": 3.2613523463176364e-05,
    "dev_mean_level_first_revolution": 3.2593668840674717e-05,
    "dev_level0_first_revolution": 0.00014078240854031865,
    "set": "B_unequal_R",
    "ratio_to_previous": {
     "dev_mean_level": 4.009842677278695,
     "dev_level0": 1.9445923605524305,
     "dev_first_order": 4.014071287527085
    }
   },
   {
    "part": 2,
    "N": 5,
    "D": 0.1,
    "lambda0": 50.26548245743669,
    "g0": 0.003589344384700155,
    "D_over_g0": 27.86024111429858,
    "D_over_M": 0.05882352941176471,
    "sum_q_minus_1": 2.6645352591003757e-15,
    "Gamma_level0": 0.9997133235960436,
    "Gamma_mean_level": 0.999727645111026,
    "Gamma_first_order": 0.9997282035003875,
    "Gamma_fit": 0.9997277089609488,
    "d2E_dM2": 0.00029759808687771037,
    "d2E_dM2_closed": 0.0002951748287156396,
    "Gamma_closed_11_20_at_mean": 0.9997292967392039,
    "Gamma_closed_11_26": 0.9997298497264027,
    "dev_mean_level": 7.2552162198036285e-06,
    "dev_level0": 0.00021994915284728744,
    "dev_first_order": 1.3051467231628422e-05,
    "dev_mean_level_first_revolution": 5.6901172710288606e-06,
    "dev_level0_first_revolution": 0.00010832143266170657,
    "set": "B_unequal_R"
   },
   {
    "part": 2,
    "N": 5,
    "D": 0.05,
    "lambda0": 100.53096491487338,
    "g0": 0.003589344384700155,
    "D_over_g0": 13.93012055714929,
    "D_over_M": 0.029411764705882356,
    "sum_q_minus_1": 1.7763568394002505e-15,
    "Gamma_level0": 0.9997133235960436,
    "Gamma_mean_level": 0.9997206215820752,
    "Gamma_first_order": 0.9997207635482155,
    "Gamma_fit": 0.9997205698052849,
    "d2E_dM2": 0.00029759808687771037,
    "d2E_dM2_closed": 0.0002951748287156396,
    "Gamma_closed_11_20_at_mean": 0.9997223297657317,
    "Gamma_closed_11_26": 0.9997224703556848,
    "dev_mean_level": 1.8887657756705423e-06,
    "dev_level0": 0.00011137972002434049,
    "dev_first_order": 3.4333857857338224e-06,
    "dev_mean_level_first_revolution": 1.8887657756705423e-06,
    "dev_level0_first_revolution": 5.356949068496819e-05,
    "set": "B_unequal_R",
    "ratio_to_previous": {
     "dev_mean_level": 3.841247185468463,
     "dev_level0": 1.9747684120522175,
     "dev_first_order": 3.801340148217254
    }
   },
   {
    "part": 2,
    "N": 5,
    "D": 0.025,
    "lambda0": 201.06192982974676,
    "g0": 0.003589344384700155,
    "D_over_g0": 6.965060278574645,
    "D_over_M": 0.014705882352941178,
    "sum_q_minus_1": 1.3322676295501878e-15,
    "Gamma_level0": 0.9997133235960436,
    "Gamma_mean_level": 0.9997170077773905,
    "Gamma_first_order": 0.9997170435721295,
    "Gamma_fit": 0.9997169942914724,
    "d2E_dM2": 0.00029759808687771037,
    "d2E_dM2_closed": 0.0002951748287156396,
    "Gamma_closed_11_20_at_mean": 0.999718745222923,
    "Gamma_closed_11_26": 0.9997187806703258,
    "dev_mean_level": 4.854379966889866e-07,
    "dev_level0": 5.6639805733671444e-05,
    "dev_first_order": 8.02049628600976e-07,
    "dev_mean_level_first_revolution": 4.854379966889866e-07,
    "dev_level0_first_revolution": 2.6731036821658893e-05,
    "set": "B_unequal_R",
    "ratio_to_previous": {
     "dev_mean_level": 3.890848653284651,
     "dev_level0": 1.9664566038249502,
     "dev_first_order": 4.280764759810082
    }
   }
  ],
  "I4_w22": [
   {
    "eps": 2.0,
    "w22": 0.032,
    "dE": 2.86729628928839e-07,
    "w22_times_weight": 2.867347376495886e-07,
    "weight_22_at_0": 8.960460551549645e-06
   },
   {
    "eps": 1.0,
    "w22": 0.008,
    "dE": 4.444423051808144e-09,
    "w22_times_weight": 4.444422510851054e-09,
    "weight_22_at_0": 5.555528138563818e-07,
    "ratio_to_previous": {
     "dE": 64.51447703930604,
     "weight_22_at_0": 16.128908589896998
    }
   },
   {
    "eps": 0.5,
    "w22": 0.002,
    "dE": 6.930322982157122e-11,
    "w22_times_weight": 6.93040919254433e-11,
    "weight_22_at_0": 3.465204596272165e-08,
    "ratio_to_previous": {
     "dE": 64.13009989939573,
     "weight_22_at_0": 16.0323235878782
    }
   },
   {
    "eps": 0.25,
    "w22": 0.0005,
    "dE": 1.0800249583553523e-12,
    "w22_times_weight": 1.0823293910994822e-12,
    "weight_22_at_0": 2.1646587821989643e-09,
    "ratio_to_previous": {
     "dE": 64.16817434210526,
     "weight_22_at_0": 16.00808693161351
    }
   }
  ],
  "I5_j_zero": [
   {
    "eps": 1.0,
    "E": 2.001000623469512,
    "closed_E": 2.001,
    "dE": 6.234695120177491e-07,
    "one_minus_weight_r0_11": 0.0024954676847248614,
    "weight_r_not_0_in_11": 3.044137799612656e-07
   },
   {
    "eps": 0.5,
    "E": 2.000250039038553,
    "closed_E": 2.0002500000000003,
    "dE": 3.9038552834824713e-08,
    "one_minus_weight_r0_11": 0.0006247164369600489,
    "weight_r_not_0_in_11": 1.906156910091994e-08,
    "ratio_to_previous": {
     "dE": 15.970610249199023,
     "one_minus_weight": 3.9945606311691275
    }
   },
   {
    "eps": 0.25,
    "E": 2.000062502441032,
    "closed_E": 2.0000625000000003,
    "dE": 2.441031821120987e-09,
    "one_minus_weight_r0_11": 0.0001562322727233223,
    "weight_r_not_0_in_11": 1.1919065734389278e-09,
    "ratio_to_previous": {
     "dE": 15.992643970080312,
     "one_minus_weight": 3.998638860399753
    }
   }
  ],
  "I2_degenerate": {
   "X_P0_0.3": {
    "P0": 0.3,
    "E0": 1.0,
    "W0_block_11_22": [
     [
      -0.8709984901538393,
      0.1699989926373006
     ],
     [
      0.1699989926373006,
      2.488875934645938
     ]
    ],
    "level": 0.9999999999999982,
    "splitting": 2.1094237467877974e-15,
    "isolation": 0.5367646288937746,
    "tail": 1.329247076629414e-30,
    "xi": {
     "M1": {
      "branch_overlap_min": 0.9999971099677671,
      "second_order_branches": false,
      "matrix_eigenvalues": [
       -0.6284491302935782,
       0.8930763706569885
      ],
      "slopes_finite_difference": [
       -0.6284491302942693,
       0.8930763706587833
      ],
      "max_abs_deviation": 1.794786541609028e-12
     },
     "M2": {
      "branch_overlap_min": 0.9999992632573971,
      "second_order_branches": false,
      "matrix_eigenvalues": [
       -0.9193836682493896,
       0.8379556562603612
      ],
      "slopes_finite_difference": [
       -0.919383668249835,
       0.8379556562611896
      ],
      "max_abs_deviation": 8.284484209752918e-13
     },
     "tau1": {
      "branch_overlap_min": 0.9999994652353024,
      "second_order_branches": false,
      "matrix_eigenvalues": [
       0.13701364783169456,
       0.6017382679216703
      ],
      "slopes_finite_difference": [
       0.13701364783985648,
       0.6017382679187796
      ],
      "max_abs_deviation": 8.161915587834301e-12
     },
     "tau2": {
      "branch_overlap_min": 0.9999997344706929,
      "second_order_branches": false,
      "matrix_eigenvalues": [
       -0.1562399942386677,
       0.5336387103127493
      ],
      "slopes_finite_difference": [
       -0.15623999423875992,
       0.5336387103116194
      ],
      "max_abs_deviation": 1.1299849944634843e-12
     },
     "theta": {
      "branch_overlap_min": 0.9999958486105363,
      "second_order_branches": false,
      "matrix_eigenvalues": [
       -0.726064560740659,
       2.016971420266951
      ],
      "slopes_finite_difference": [
       -0.7260645607407579,
       2.016971420271583
      ],
      "max_abs_deviation": 4.632294547946003e-12
     },
     "P": {
      "branch_overlap_min": 0.9999549236248141,
      "second_order_branches": false,
      "matrix_eigenvalues": [
       -0.031846375003745014,
       0.05626498105111962
      ],
      "slopes_finite_difference": [
       -0.03184637502647488,
       0.05626498076378439
      ],
      "max_abs_deviation": 2.8733523199653277e-10,
      "second_derivative_11_24": [
       -0.10636246132447708,
       0.1732240845088477
      ],
      "second_derivative_finite_difference": [
       -0.10636246133695812,
       0.1732240843798268
      ],
      "max_abs_deviation_second": 1.290208773152557e-10,
      "term_of_11_9_from_the_level": {
       "numerator": 0.0006549251905570781,
       "denominator": -2.1094237467877974e-15
      }
     }
    },
    "every_eigenvector": {
     "euler": 1.5543122344752192e-15,
     "V12": 1.0755285551056204e-16,
     "mean_rule": 4.083622329176251e-12,
     "norm_Pi_V1_minus_V2_Pi": 1.623807045561269e-16
    },
    "overlap_of_branch_0_of_M1_with_branch_0_of": {
     "M2": 0.9912457291055672,
     "tau1": 0.27691133128244105,
     "tau2": 0.727218460602937,
     "theta": 0.00125015493571443,
     "P": 0.5106343791399865
    },
    "U_in_the_branch_vectors_of_M1": [
     2.0135422002964525,
     -0.7226353407701603
    ]
   },
   "X_P0_0": {
    "P0": 0.0,
    "E0": 1.0,
    "W0_block_11_22": [
     [
      -0.8690861691877569,
      0.17779417922648388
     ],
     [
      0.17779417922648388,
      2.4886177820527084
     ]
    ],
    "level": 0.9999999999999998,
    "splitting": 3.552713678800501e-15,
    "isolation": 0.5397467369356923,
    "tail": 3.220867649153723e-30,
    "xi": {
     "M1": {
      "branch_overlap_min": 0.9999971876593898,
      "second_order_branches": false,
      "matrix_eigenvalues": [
       -0.6311961096511747,
       0.8954732540945399
      ],
      "slopes_finite_difference": [
       -0.6311961096529725,
       0.8954732540947807
      ],
      "max_abs_deviation": 1.797784143775516e-12
     },
     "M2": {
      "branch_overlap_min": 0.9999993323005603,
      "second_order_branches": false,
      "matrix_eigenvalues": [
       -0.9189017363386298,
       0.8450716129595568
      ],
      "slopes_finite_difference": [
       -0.9189017363377326,
       0.8450716129607921
      ],
      "max_abs_deviation": 1.2353451595004117e-12
     },
     "tau1": {
      "branch_overlap_min": 0.9999994664039994,
      "second_order_branches": false,
      "matrix_eigenvalues": [
       0.12086946671832857,
       0.6053049489183279
      ],
      "slopes_finite_difference": [
       0.12086946671909422,
       0.6053049489162521
      ],
      "max_abs_deviation": 2.075783989141655e-12
     },
     "tau2": {
      "branch_overlap_min": 0.999999739781839,
      "second_order_branches": false,
      "matrix_eigenvalues": [
       -0.17900441992705343,
       0.5381300536834165
      ],
      "slopes_finite_difference": [
       -0.17900441992700963,
       0.5381300536826712
      ],
      "max_abs_deviation": 7.452927164308676e-13
     },
     "theta": {
      "branch_overlap_min": 0.9999959710756143,
      "second_order_branches": false,
      "matrix_eigenvalues": [
       -0.7256826731364663,
       2.0243054354253944
      ],
      "slopes_finite_difference": [
       -0.7256826731369959,
       2.024305435429141
      ],
      "max_abs_deviation": 3.746780663504978e-12
     },
     "P": {
      "branch_overlap_min": 0.9999515656387844,
      "second_order_branches": true,
      "matrix_eigenvalues": [
       -1.5990099605146319e-18,
       1.4220717080865478e-17
      ],
      "slopes_finite_difference": [
       1.7578531223231646e-14,
       -5.551115123125783e-15
      ],
      "max_abs_deviation": 1.758013023319216e-14,
      "second_derivative_11_24": [
       -0.10630609567694373,
       0.19294340823060183
      ],
      "second_derivative_finite_difference": [
       -0.1063060956525234,
       0.19294340782016753
      ],
      "max_abs_deviation_second": 4.1043429765963424e-10,
      "term_of_11_9_from_the_level": {
       "numerator": 9.381668279642345e-35,
       "denominator": -3.552713678800501e-15
      }
     }
    },
    "every_eigenvector": {
     "euler": 1.5543122344752192e-15,
     "V12": 3.495273306657225e-17,
     "mean_rule": 2.8810287489022812e-12,
     "norm_Pi_V1_minus_V2_Pi": 6.395302922133256e-17
    },
    "overlap_of_branch_0_of_M1_with_branch_0_of": {
     "M2": 0.990444344926481,
     "tau1": 0.28434210754965816,
     "tau2": 0.7171408387658194,
     "theta": 0.0013826601406883624,
     "P": 0.511202997513944
    },
    "U_in_the_branch_vectors_of_M1": [
     2.0205031364803183,
     -0.7218803741913904
    ]
   }
  },
  "I1_listing": {
   "scan": [
    {
     "kappa": 0.04,
     "centred": {
      "total_contract_listing_B_minus_A": 1.2827761084789717e-15,
      "Cbod_listing_B_minus_A": 5.162369185311951e-16,
      "Cbod_minus_listed_Cpair_A": 1.3390402313457069e-15,
      "Cbod_minus_listed_Cpair_A_minus_gradient": 1.3390402313457069e-15,
      "Cbod_minus_listed_Cpair_B": 2.589160095474978,
      "view_minus_evolution_by_Cbod": 0.04140756807593813,
      "view_minus_evolution_by_listed_Cpair_A": 0.04140756807593793,
      "view_minus_evolution_by_listed_Cpair_B": 1.0252105518165358
     },
     "not_centred": {
      "total_contract_listing_B_minus_A": 1.4541908674370036e-15,
      "Cbod_listing_B_minus_A": 1.2727338794797184e-15,
      "Cbod_minus_listed_Cpair_A": 0.6533790368880953,
      "Cbod_minus_listed_Cpair_A_minus_gradient": 1.337937461793145e-15,
      "Cbod_minus_listed_Cpair_B": 2.4911510444119456,
      "view_minus_evolution_by_Cbod": 0.04147399211699122,
      "view_minus_evolution_by_listed_Cpair_A": 0.15258106910530397,
      "view_minus_evolution_by_listed_Cpair_B": 1.0454209777590693
     }
    },
    {
     "kappa": 0.02,
     "centred": {
      "total_contract_listing_B_minus_A": 1.277058133722624e-15,
      "Cbod_listing_B_minus_A": 1.0104924317347425e-15,
      "Cbod_minus_listed_Cpair_A": 1.2979632982043458e-15,
      "Cbod_minus_listed_Cpair_A_minus_gradient": 1.2979632982043458e-15,
      "Cbod_minus_listed_Cpair_B": 2.589160095474978,
      "view_minus_evolution_by_Cbod": 0.010524595210457292,
      "view_minus_evolution_by_listed_Cpair_A": 0.010524595210457895,
      "view_minus_evolution_by_listed_Cpair_B": 1.0344041743048134
     },
     "not_centred": {
      "total_contract_listing_B_minus_A": 1.4352611847732062e-15,
      "Cbod_listing_B_minus_A": 9.818780061564638e-16,
      "Cbod_minus_listed_Cpair_A": 0.3266895184440475,
      "Cbod_minus_listed_Cpair_A_minus_gradient": 1.5067593816740945e-15,
      "Cbod_minus_listed_Cpair_B": 2.5195368069500708,
      "view_minus_evolution_by_Cbod": 0.010533024092336463,
      "view_minus_evolution_by_listed_Cpair_A": 0.07442241670320898,
      "view_minus_evolution_by_listed_Cpair_B": 1.0437996321633354
     }
    },
    {
     "kappa": 0.01,
     "centred": {
      "total_contract_listing_B_minus_A": 1.4427560722082318e-15,
      "Cbod_listing_B_minus_A": 8.320400019456291e-16,
      "Cbod_minus_listed_Cpair_A": 1.2946481703345058e-15,
      "Cbod_minus_listed_Cpair_A_minus_gradient": 1.2946481703345058e-15,
      "Cbod_minus_listed_Cpair_B": 2.589160095474978,
      "view_minus_evolution_by_Cbod": 0.00264233315616465,
      "view_minus_evolution_by_listed_Cpair_A": 0.0026423331561647428,
      "view_minus_evolution_by_listed_Cpair_B": 1.036936456151247
     },
     "not_centred": {
      "total_contract_listing_B_minus_A": 1.3322676295501878e-15,
      "Cbod_listing_B_minus_A": 1.2047738841180856e-15,
      "Cbod_minus_listed_Cpair_A": 0.16334475922202352,
      "Cbod_minus_listed_Cpair_A_minus_gradient": 1.7886148401916585e-15,
      "Cbod_minus_listed_Cpair_B": 2.5493580271163903,
      "view_minus_evolution_by_Cbod": 0.0026433907275934454,
      "view_minus_evolution_by_listed_Cpair_A": 0.03695338761977342,
      "view_minus_evolution_by_listed_Cpair_B": 1.0414064786548582
     }
    }
   ],
   "mean_of_X_not_centred": -0.6020967706836465
  }
 }
}
output/check_bound_pair.txt28 KB · raw
range of r: -L..L with L=120 (open ends); convergence: comparison with L=240 and weight at |r|>L/2
finite differences: 5-point, step 0.01 in P, relative step 0.001 in M_i, tau_i, theta; convention eta=1/2

=== set A_equal_R: {'M1': 1.0, 'M2': 1.0, 'tau1': 0.1, 'tau2': 0.1, 'w': [-0.004, 0.003, -0.002, 0.006]}  max tau_i/M_i = 0.100
P=-0.30  E_b=1.998771748883  isolation=1.452e-03  in a band: False  weight(r=0,11)=0.6408  Gamma=+1.000000  E_b'=-1.133090e-03  <V1>=-1.133090e-03  <V2>=-1.133090e-03  E_b''=+3.517649e-03  (11.9)=+3.517649e-03
P=-0.15  E_b=1.998642641792  isolation=1.414e-03  in a band: False  weight(r=0,11)=0.6278  Gamma=+1.000000  E_b'=-5.810445e-04  <V1>=-5.810445e-04  <V2>=-5.810445e-04  E_b''=+3.809572e-03  (11.9)=+3.809572e-03
P=+0.00  E_b=1.998598883527  isolation=1.401e-03  in a band: False  weight(r=0,11)=0.6235  Gamma=+1.000000  E_b'=+1.850372e-15  <V1>=+7.893878e-21  <V2>=-2.053590e-20  E_b''=+3.905596e-03  (11.9)=+3.905596e-03
P=+0.15  E_b=1.998642641792  isolation=1.414e-03  in a band: False  weight(r=0,11)=0.6278  Gamma=+1.000000  E_b'=+5.810445e-04  <V1>=+5.810445e-04  <V2>=+5.810445e-04  E_b''=+3.809572e-03  (11.9)=+3.809572e-03
P=+0.30  E_b=1.998771748883  isolation=1.452e-03  in a band: False  weight(r=0,11)=0.6408  Gamma=+1.000000  E_b'=+1.133090e-03  <V1>=+1.133090e-03  <V2>=+1.133090e-03  E_b''=+3.517649e-03  (11.9)=+3.517649e-03
max |deviation| over the P values:
  2(a): dE/dM_i - <sigma3_i> 1.25e-12; tau_i dE/dtau_i - <A_i> 1.37e-12; dE/dtheta - <U> 8.96e-13; Euler residual 4.22e-15
  2(b): E_b' - <V1> 1.59e-12; E_b' - <V2> 1.59e-12; <V1> - <V2> 6.51e-19
  2(c): E_b'' (finite difference) - formula (11.9) 1.59e-11
  3(a): coefficients of (11.10) against direct inversion (relative) 1.19e-14; root of (11.10) - E_b 1.55e-15
  numerics: |E_b(L) - E_b(2L)| 2.00e-15; weight at |r|>L/2 3.17e-20; dependence on eta 2.44e-15; dense - banded 2.44e-15
closed forms (items 3, 4), regime R: |w11|/a = 0.800, (max tau/M)^2 = 1.000e-02
  max_P |E_b - (11.12)| = 2.053e-06  = 0.021 * (tau/M)^4;  max_P |E_b' - d(11.12)/dP| = 2.354e-07
  E_b''(0): numeric +3.90559613e-03  closed +3.90434405e-03  rel.dev 3.207e-04  = 0.032 * (tau/M)^2
  s3_1   numeric +9.9945154586e-01  closed +9.9945217202e-01  diff -6.26e-07
  s3_2   numeric +9.9945154586e-01  closed +9.9945217202e-01  diff -6.26e-07
  A1     numeric +1.0948993397e-03  closed +1.0956559528e-03  diff -7.57e-07
  A2     numeric +1.0948993397e-03  closed +1.0956559528e-03  diff -7.57e-07
  U      numeric -2.4940068754e-03  closed -2.4987801902e-03  diff +4.77e-06
  Ebind  numeric -1.4011164735e-03  closed -1.4031242374e-03  diff +2.01e-06
  Epp0   numeric +3.9055961250e-03  closed +3.9043440472e-03  diff +1.25e-06
  m_b/(m_1+m_2): numeric +1.280214  (11.16) +1.280625;  m_b-(m_1+m_2): numeric +5.604286e+01  -4 m_1 m_2 E_bind +5.604466e+01

=== set B_unequal_R: {'M1': 1.0, 'M2': 1.7, 'tau1': 0.2, 'tau2': 0.12, 'w': [-0.01, 0.005, -0.004, 0.008]}  max tau_i/M_i = 0.200
P=-0.30  E_b=2.696652071452  isolation=3.657e-03  in a band: False  weight(r=0,11)=0.6441  Gamma=+1.000000  E_b'=-1.546134e-03  <V1>=-1.546134e-03  <V2>=-1.546134e-03  E_b''=+4.673251e-03  (11.9)=+4.673251e-03
P=-0.15  E_b=2.696475088077  isolation=3.603e-03  in a band: False  weight(r=0,11)=0.6368  Gamma=+1.000000  E_b'=-8.001290e-04  <V1>=-8.001290e-04  <V2>=-8.001290e-04  E_b''=+5.213785e-03  (11.9)=+5.213785e-03
P=+0.00  E_b=2.696414739677  isolation=3.585e-03  in a band: False  weight(r=0,11)=0.6344  Gamma=+1.000000  E_b'=+1.110223e-14  <V1>=-1.752348e-19  <V2>=+3.687192e-20  E_b''=+5.394417e-03  (11.9)=+5.394417e-03
P=+0.15  E_b=2.696475088077  isolation=3.603e-03  in a band: False  weight(r=0,11)=0.6368  Gamma=+1.000000  E_b'=+8.001290e-04  <V1>=+8.001290e-04  <V2>=+8.001290e-04  E_b''=+5.213785e-03  (11.9)=+5.213785e-03
P=+0.30  E_b=2.696652071452  isolation=3.657e-03  in a band: False  weight(r=0,11)=0.6441  Gamma=+1.000000  E_b'=+1.546134e-03  <V1>=+1.546134e-03  <V2>=+1.546134e-03  E_b''=+4.673251e-03  (11.9)=+4.673251e-03
max |deviation| over the P values:
  2(a): dE/dM_i - <sigma3_i> 1.49e-12; tau_i dE/dtau_i - <A_i> 1.56e-12; dE/dtheta - <U> 6.98e-13; Euler residual 4.44e-15
  2(b): E_b' - <V1> 8.50e-13; E_b' - <V2> 8.50e-13; <V1> - <V2> 7.35e-17
  2(c): E_b'' (finite difference) - formula (11.9) 1.83e-11
  3(a): coefficients of (11.10) against direct inversion (relative) 4.28e-14; root of (11.10) - E_b 4.88e-15
  numerics: |E_b(L) - E_b(2L)| 3.11e-15; weight at |r|>L/2 9.86e-21; dependence on eta 6.22e-15; dense - banded 3.55e-15
closed forms (items 3, 4), regime R: |w11|/a = 0.825, (max tau/M)^2 = 4.000e-02
  max_P |E_b - (11.12)| = 8.267e-06  = 0.005 * (tau/M)^4;  max_P |E_b' - d(11.12)/dP| = 6.697e-07
  E_b''(0): numeric +5.39441742e-03  closed +5.39148145e-03  rel.dev 5.446e-04  = 0.014 * (tau/M)^2
  s3_1   numeric +9.9771238948e-01  closed +9.9771281374e-01  diff -4.24e-07
  s3_2   numeric +9.9971332360e-01  closed +9.9971509098e-01  diff -1.77e-06
  A1     numeric +4.5625732894e-03  closed +4.5743725191e-03  diff -1.18e-05
  A2     numeric +9.7104322032e-04  closed +9.6869065111e-04  diff +2.35e-06
  U      numeric -6.3439164227e-03  closed -6.3649433780e-03  diff +2.10e-05
  Ebind  numeric -3.5852603230e-03  closed -3.5934117929e-03  diff +8.15e-06
  Epp0   numeric +5.3944174247e-03  closed +5.3914814496e-03  diff +2.94e-06
  m_b/(m_1+m_2): numeric +1.295838  (11.16) +1.296544;  m_b-(m_1+m_2): numeric +4.232127e+01  -4 m_1 m_2 E_bind +4.232599e+01

=== set C_above_band_R: {'M1': 1.0, 'M2': 0.8, 'tau1': 0.1, 'tau2': 0.15, 'w': [0.02, -0.005, 0.003, -0.01]}  max tau_i/M_i = 0.187
P=-0.30  E_b=1.831346531561  isolation=1.274e-02  in a band: False  weight(r=0,11)=0.9037  Gamma=+1.000000  E_b'=+8.867732e-04  <V1>=+8.867732e-04  <V2>=+8.867732e-04  E_b''=-2.629234e-03  (11.9)=-2.629234e-03
P=-0.15  E_b=1.831448371991  isolation=1.260e-02  in a band: False  weight(r=0,11)=0.8994  Gamma=+1.000000  E_b'=+4.619112e-04  <V1>=+4.619112e-04  <V2>=+4.619112e-04  E_b''=-2.996418e-03  (11.9)=-2.996418e-03
P=+0.00  E_b=1.831483249143  isolation=1.255e-02  in a band: False  weight(r=0,11)=0.8980  Gamma=+1.000000  E_b'=+1.850372e-15  <V1>=-1.604183e-19  <V2>=+5.735736e-19  E_b''=-3.121011e-03  (11.9)=-3.121011e-03
P=+0.15  E_b=1.831448371991  isolation=1.260e-02  in a band: False  weight(r=0,11)=0.8994  Gamma=+1.000000  E_b'=-4.619112e-04  <V1>=-4.619112e-04  <V2>=-4.619112e-04  E_b''=-2.996418e-03  (11.9)=-2.996418e-03
P=+0.30  E_b=1.831346531561  isolation=1.274e-02  in a band: False  weight(r=0,11)=0.9037  Gamma=+1.000000  E_b'=-8.867732e-04  <V1>=-8.867732e-04  <V2>=-8.867732e-04  E_b''=-2.629234e-03  (11.9)=-2.629234e-03
max |deviation| over the P values:
  2(a): dE/dM_i - <sigma3_i> 1.04e-12; tau_i dE/dtau_i - <A_i> 1.30e-12; dE/dtheta - <U> 1.11e-12; Euler residual 1.78e-15
  2(b): E_b' - <V1> 2.74e-12; E_b' - <V2> 2.74e-12; <V1> - <V2> 8.55e-17
  2(c): E_b'' (finite difference) - formula (11.9) 1.26e-11
  3(a): coefficients of (11.10) against direct inversion (relative) 4.97e-15; root of (11.10) - E_b 8.88e-16
  numerics: |E_b(L) - E_b(2L)| 2.22e-16; weight at |r|>L/2 5.56e-28; dependence on eta 1.33e-15; dense - banded 4.44e-16
closed forms (items 3, 4), regime R: |w11|/a = 2.098, (max tau/M)^2 = 3.516e-02
  max_P |E_b - (11.12)| = 2.030e-04  = 0.164 * (tau/M)^4;  max_P |E_b' - d(11.12)/dP| = 1.488e-05
  E_b''(0): numeric -3.12101105e-03  closed -3.17366056e-03  rel.dev 1.659e-02  = 0.472 * (tau/M)^2
  s3_1   numeric +9.9650760383e-01  closed +9.9642448170e-01  diff +8.31e-05
  s3_2   numeric +9.8795706438e-01  closed +9.8742981847e-01  diff +5.27e-04
  A1     numeric +7.0534612009e-03  closed +7.1510366031e-03  diff -9.76e-05
  A2     numeric +1.9596946814e-02  closed +2.0112290446e-02  diff -5.15e-04
  U      numeric +1.7959585791e-02  closed +1.8054602308e-02  diff -9.50e-05
  Ebind  numeric +3.1483249143e-02  closed +3.1686265833e-02  diff -2.03e-04
  Epp0   numeric -3.1210110472e-03  closed -3.1736605620e-03  diff +5.26e-05
  m_b/(m_1+m_2): numeric -2.363673  (11.16) -2.324461;  m_b-(m_1+m_2): numeric -4.559645e+02  -4 m_1 m_2 E_bind -4.477618e+02

=== set D_wide_R: {'M1': 1.3, 'M2': 1.0, 'tau1': 0.15, 'tau2': 0.2, 'w': [-0.004, 0.002, 0.001, 0.003]}  max tau_i/M_i = 0.200
P=-0.30  E_b=2.299969840671  isolation=5.677e-04  in a band: False  weight(r=0,11)=0.2780  Gamma=+1.000000  E_b'=-3.402251e-03  <V1>=-3.402251e-03  <V2>=-3.402251e-03  E_b''=+1.074662e-02  (11.9)=+1.074662e-02
P=-0.15  E_b=2.299583345287  isolation=5.522e-04  in a band: False  weight(r=0,11)=0.2707  Gamma=+1.000000  E_b'=-1.734310e-03  <V1>=-1.734310e-03  <V2>=-1.734310e-03  E_b''=+1.141561e-02  (11.9)=+1.141561e-02
P=+0.00  E_b=2.299452860723  isolation=5.471e-04  in a band: False  weight(r=0,11)=0.2684  Gamma=+1.000000  E_b'=+1.110223e-14  <V1>=-2.235218e-19  <V2>=+5.295572e-19  E_b''=+1.163513e-02  (11.9)=+1.163513e-02
P=+0.15  E_b=2.299583345287  isolation=5.522e-04  in a band: False  weight(r=0,11)=0.2707  Gamma=+1.000000  E_b'=+1.734310e-03  <V1>=+1.734310e-03  <V2>=+1.734310e-03  E_b''=+1.141561e-02  (11.9)=+1.141561e-02
P=+0.30  E_b=2.299969840671  isolation=5.677e-04  in a band: False  weight(r=0,11)=0.2780  Gamma=+1.000000  E_b'=+3.402251e-03  <V1>=+3.402251e-03  <V2>=+3.402251e-03  E_b''=+1.074662e-02  (11.9)=+1.074662e-02
max |deviation| over the P values:
  2(a): dE/dM_i - <sigma3_i> 2.05e-12; tau_i dE/dtau_i - <A_i> 1.96e-12; dE/dtheta - <U> 2.07e-12; Euler residual 5.33e-15
  2(b): E_b' - <V1> 5.04e-12; E_b' - <V2> 5.04e-12; <V1> - <V2> 8.46e-17
  2(c): E_b'' (finite difference) - formula (11.9) 9.92e-11
  3(a): coefficients of (11.10) against direct inversion (relative) 2.34e-13; root of (11.10) - E_b 1.78e-15
  numerics: |E_b(L) - E_b(2L)| 4.44e-15; weight at |r|>L/2 4.85e-08; dependence on eta 4.44e-15; dense - banded 2.22e-15
closed forms (items 3, 4), regime R: |w11|/a = 0.279, (max tau/M)^2 = 4.000e-02
  max_P |E_b - (11.12)| = 7.729e-07  = 0.000 * (tau/M)^4;  max_P |E_b' - d(11.12)/dP| = 1.014e-06
  E_b''(0): numeric +1.16351317e-02  closed +1.16355522e-02  rel.dev 3.615e-05  = 0.001 * (tau/M)^2
  s3_1   numeric +9.9987712967e-01  closed +9.9987739882e-01  diff -2.69e-07
  s3_2   numeric +9.9963191441e-01  closed +9.9963165158e-01  diff +2.63e-07
  A1     numeric +3.1883906936e-04  closed +3.1876305792e-04  diff +7.60e-08
  A2     numeric +7.3524924751e-04  closed +7.3669684496e-04  diff -1.45e-06
  U      numeric -1.0734105787e-03  closed -1.0756421628e-03  diff +2.23e-06
  Ebind  numeric -5.4713927724e-04  closed -5.4791221131e-04  diff +7.73e-07
  Epp0   numeric +1.1635131656e-02  closed +1.1635552241e-02  diff -4.21e-07
  m_b/(m_1+m_2): numeric +1.038281  (11.16) +1.038244;  m_b-(m_1+m_2): numeric +3.168822e+00  -4 m_1 m_2 E_bind +3.161249e+00

=== set E_order_one: {'M1': 1.0, 'M2': 1.3, 'tau1': 1.0, 'tau2': 0.8, 'w': [-0.6, 0.2, -0.15, 0.3]}  max tau_i/M_i = 1.000
P=-0.30  E_b=2.020243065365  isolation=2.944e-01  in a band: False  weight(r=0,11)=0.7017  Gamma=+1.000000  E_b'=-5.330716e-02  <V1>=-5.330716e-02  <V2>=-5.330716e-02  E_b''=+1.580211e-01  (11.9)=+1.580211e-01
P=-0.15  E_b=2.014120790386  isolation=2.896e-01  in a band: False  weight(r=0,11)=0.6956  Gamma=+1.000000  E_b'=-2.776997e-02  <V1>=-2.776997e-02  <V2>=-2.776997e-02  E_b''=+1.801270e-01  (11.9)=+1.801270e-01
P=+0.00  E_b=2.012023935088  isolation=2.880e-01  in a band: False  weight(r=0,11)=0.6936  Gamma=+1.000000  E_b'=-7.401487e-15  <V1>=-3.140157e-17  <V2>=+1.914190e-17  E_b''=+1.876436e-01  (11.9)=+1.876436e-01
P=+0.15  E_b=2.014120790386  isolation=2.896e-01  in a band: False  weight(r=0,11)=0.6956  Gamma=+1.000000  E_b'=+2.776997e-02  <V1>=+2.776997e-02  <V2>=+2.776997e-02  E_b''=+1.801270e-01  (11.9)=+1.801270e-01
P=+0.30  E_b=2.020243065365  isolation=2.944e-01  in a band: False  weight(r=0,11)=0.7017  Gamma=+1.000000  E_b'=+5.330716e-02  <V1>=+5.330716e-02  <V2>=+5.330716e-02  E_b''=+1.580211e-01  (11.9)=+1.580211e-01
max |deviation| over the P values:
  2(a): dE/dM_i - <sigma3_i> 7.62e-13; tau_i dE/dtau_i - <A_i> 1.52e-12; dE/dtheta - <U> 1.15e-12; Euler residual 1.33e-15
  2(b): E_b' - <V1> 1.74e-10; E_b' - <V2> 1.74e-10; <V1> - <V2> 3.54e-16
  2(c): E_b'' (finite difference) - formula (11.9) 2.40e-10
  3(a): coefficients of (11.10) against direct inversion (relative) 3.59e-15; root of (11.10) - E_b 1.33e-15
  numerics: |E_b(L) - E_b(2L)| 8.88e-16; weight at |r|>L/2 2.26e-30; dependence on eta 8.88e-16; dense - banded 2.66e-15
closed forms (items 3, 4), control, outside R: |w11|/a = 1.608, (max tau/M)^2 = 1.000e+00
  max_P |E_b - (11.12)| = 4.605e-02  = 0.046 * (tau/M)^4;  max_P |E_b' - d(11.12)/dP| = 3.589e-03
  E_b''(0): numeric +1.87643618e-01  closed +1.74198841e-01  rel.dev 7.718e-02  = 0.077 * (tau/M)^2
  s3_1   numeric +8.5646967127e-01  closed +8.8201005947e-01  diff -2.55e-02
  s3_2   numeric +9.3859089119e-01  closed +9.5531741897e-01  diff -1.67e-02
  A1     numeric +2.2543811170e-01  closed +2.3597988106e-01  diff -1.05e-02
  A2     numeric +1.2495039252e-01  closed +1.1617471068e-01  diff +8.78e-03
  U      numeric -4.1500239894e-01  closed -5.0953161098e-01  diff +9.45e-02
  Ebind  numeric -2.8797606491e-01  closed -3.3345431511e-01  diff +4.55e-02
  Epp0   numeric +1.8764361764e-01  closed +1.7419884136e-01  diff +1.34e-02
  m_b/(m_1+m_2): numeric +1.758104  (11.16) +1.893795;  m_b-(m_1+m_2): numeric +2.298001e+00  -4 m_1 m_2 E_bind +2.339806e+00

=== epsilon scan on set B_unequal_R (tau -> eps*tau, w -> eps^2*w)
eps= 1.000  E_b-(11.12): P=0 +8.1515e-06, P=0.3 +8.2675e-06;  rel.dev E_b''(0) +5.4456e-04;  <sigma3_i>-(11.14): -4.2426e-07, -1.7674e-06
eps= 0.500  E_b-(11.12): P=0 +5.0943e-07, P=0.3 +5.1674e-07;  rel.dev E_b''(0) +1.3708e-04;  <sigma3_i>-(11.14): -2.7203e-08, -1.1020e-07
          ratios to the previous eps: dE_P0 16.00, dE_P03 16.00, rel_dEpp0 3.97, d_s3_1 15.60, d_s3_2 16.04
eps= 0.250  E_b-(11.12): P=0 +3.1839e-08, P=0.3 +3.2297e-08;  rel.dev E_b''(0) +3.4328e-05;  <sigma3_i>-(11.14): -1.7109e-09, -6.8832e-09
          ratios to the previous eps: dE_P0 16.00, dE_P03 16.00, rel_dEpp0 3.99, d_s3_1 15.90, d_s3_2 16.01
eps= 0.125  E_b-(11.12): P=0 +1.9899e-09, P=0.3 +2.0186e-09;  rel.dev E_b''(0) +8.5858e-06;  <sigma3_i>-(11.14): -1.0710e-10, -4.3014e-10
          ratios to the previous eps: dE_P0 16.00, dE_P03 16.00, rel_dEpp0 4.00, d_s3_1 15.97, d_s3_2 16.00
expected for halving eps: 16 for E_b and <sigma3_i> (next order eps^4), 4 for the relative deviation of E_b''(0)

=== new in v2, I3: reading statistics of the clock of a part, (11.19), (11.25), (11.26)
start: bound eigenvector of the level 0 on every level, clock label in |0>, total label P=0 sharp, no records;
readings at lambda = t*lambda_0, t = 0.25, 0.5, ..., 2N; deviation = max over a and t of |q - P_N(a; Gamma*t)|
set E_order_one, clock of part 1, N=4, spread D=0.0600 (D/g0=0.208, D/m=0.0600, lambda_0=78.54)
  Gamma: level 0 (v1) 0.8564696713; mean level (11.19) 0.8621903823; first order (11.25) 0.8623337320; least-squares fit 0.8621456724
  d2E_b/dM^2 at m: spectral sum +1.95468691e-01; closed form of (11.26) +1.72184621e-01;  closed (11.20) at the mean level 0.8870173806; closed (11.26) 0.8871755981
  deviation of the statistics: Gamma at the mean level 9.468e-04 (t<=N: 3.598e-04); first order 2.645e-03; Gamma of the level 0 7.098e-02 (t<=N: 3.790e-02)
set E_order_one, clock of part 1, N=4, spread D=0.0300 (D/g0=0.104, D/m=0.0300, lambda_0=157.08)
  Gamma: level 0 (v1) 0.8564696713; mean level (11.19) 0.8593655981; first order (11.25) 0.8594017016; least-squares fit 0.8593541025
  d2E_b/dM^2 at m: spectral sum +1.95468691e-01; closed form of (11.26) +1.72184621e-01;  closed (11.20) at the mean level 0.8845527554; closed (11.26) 0.8845928288
  deviation of the statistics: Gamma at the mean level 2.476e-04 (t<=N: 9.235e-05); first order 6.867e-04; Gamma of the level 0 3.606e-02 (t<=N: 1.923e-02)
  ratios to the previous spread: dev_mean_level 3.82, dev_level0 1.97, dev_first_order 3.85
set E_order_one, clock of part 1, N=4, spread D=0.0150 (D/g0=0.052, D/m=0.0150, lambda_0=314.16)
  Gamma: level 0 (v1) 0.8564696713; mean level (11.19) 0.8579266274; first order (11.25) 0.8579356864; least-squares fit 0.8579237667
  d2E_b/dM^2 at m: spectral sum +1.95468691e-01; closed form of (11.26) +1.72184621e-01;  closed (11.20) at the mean level 0.8832913598; closed (11.26) 0.8833014441
  deviation of the statistics: Gamma at the mean level 6.077e-05 (t<=N: 2.322e-05); first order 1.707e-04; Gamma of the level 0 1.816e-02 (t<=N: 9.686e-03)
  ratios to the previous spread: dev_mean_level 4.07, dev_level0 1.99, dev_first_order 4.02
set B_unequal_R, clock of part 1, N=4, spread D=0.1000 (D/g0=27.860, D/m=0.1000, lambda_0=47.12)
  Gamma: level 0 (v1) 0.9977123895; mean level (11.19) 0.9978093968; first order (11.25) 0.9978119033; least-squares fit 0.9978328312
  d2E_b/dM^2 at m: spectral sum +1.99027585e-03; closed form of (11.26) +1.99577457e-03;  closed (11.20) at the mean level 0.9978100720; closed (11.26) 0.9978126025
  deviation of the statistics: Gamma at the mean level 4.686e-04 (t<=N: 4.128e-04); first order 4.707e-04; Gamma of the level 0 1.426e-03 (t<=N: 9.115e-04)
set B_unequal_R, clock of part 1, N=4, spread D=0.0500 (D/g0=13.930, D/m=0.0500, lambda_0=94.25)
  Gamma: level 0 (v1) 0.9977123895; mean level (11.19) 0.9977615160; first order (11.25) 0.9977621464; least-squares fit 0.9977620037
  d2E_b/dM^2 at m: spectral sum +1.99027585e-03; closed form of (11.26) +1.99577457e-03;  closed (11.20) at the mean level 0.9977620716; closed (11.26) 0.9977627081
  deviation of the statistics: Gamma at the mean level 1.307e-04 (t<=N: 1.251e-04); first order 1.309e-04; Gamma of the level 0 5.874e-04 (t<=N: 3.517e-04)
  ratios to the previous spread: dev_mean_level 3.59, dev_level0 2.43, dev_first_order 3.60
set B_unequal_R, clock of part 1, N=4, spread D=0.0250 (D/g0=6.965, D/m=0.0250, lambda_0=188.50)
  Gamma: level 0 (v1) 0.9977123895; mean level (11.19) 0.9977371099; first order (11.25) 0.9977372679; least-squares fit 0.9977368502
  d2E_b/dM^2 at m: spectral sum +1.99027585e-03; closed form of (11.26) +1.99577457e-03;  closed (11.20) at the mean level 0.9977376013; closed (11.26) 0.9977377609
  deviation of the statistics: Gamma at the mean level 3.259e-05 (t<=N: 3.259e-05); first order 3.261e-05; Gamma of the level 0 3.021e-04 (t<=N: 1.408e-04)
  ratios to the previous spread: dev_mean_level 4.01, dev_level0 1.94, dev_first_order 4.01
set B_unequal_R, clock of part 2, N=5, spread D=0.1000 (D/g0=27.860, D/m=0.0588, lambda_0=50.27)
  Gamma: level 0 (v1) 0.9997133236; mean level (11.19) 0.9997276451; first order (11.25) 0.9997282035; least-squares fit 0.9997277090
  d2E_b/dM^2 at m: spectral sum +2.97598087e-04; closed form of (11.26) +2.95174829e-04;  closed (11.20) at the mean level 0.9997292967; closed (11.26) 0.9997298497
  deviation of the statistics: Gamma at the mean level 7.255e-06 (t<=N: 5.690e-06); first order 1.305e-05; Gamma of the level 0 2.199e-04 (t<=N: 1.083e-04)
set B_unequal_R, clock of part 2, N=5, spread D=0.0500 (D/g0=13.930, D/m=0.0294, lambda_0=100.53)
  Gamma: level 0 (v1) 0.9997133236; mean level (11.19) 0.9997206216; first order (11.25) 0.9997207635; least-squares fit 0.9997205698
  d2E_b/dM^2 at m: spectral sum +2.97598087e-04; closed form of (11.26) +2.95174829e-04;  closed (11.20) at the mean level 0.9997223298; closed (11.26) 0.9997224704
  deviation of the statistics: Gamma at the mean level 1.889e-06 (t<=N: 1.889e-06); first order 3.433e-06; Gamma of the level 0 1.114e-04 (t<=N: 5.357e-05)
  ratios to the previous spread: dev_mean_level 3.84, dev_level0 1.97, dev_first_order 3.80
set B_unequal_R, clock of part 2, N=5, spread D=0.0250 (D/g0=6.965, D/m=0.0147, lambda_0=201.06)
  Gamma: level 0 (v1) 0.9997133236; mean level (11.19) 0.9997170078; first order (11.25) 0.9997170436; least-squares fit 0.9997169943
  d2E_b/dM^2 at m: spectral sum +2.97598087e-04; closed form of (11.26) +2.95174829e-04;  closed (11.20) at the mean level 0.9997187452; closed (11.26) 0.9997187807
  deviation of the statistics: Gamma at the mean level 4.854e-07 (t<=N: 4.854e-07); first order 8.020e-07; Gamma of the level 0 5.664e-05 (t<=N: 2.673e-05)
  ratios to the previous spread: dev_mean_level 3.89, dev_level0 1.97, dev_first_order 4.28
expected for halving the spread at fixed lambda/lambda_0: 4 with Gamma at the mean level, 2 with Gamma of the level 0

=== new in v2, I4: order of the contribution of w22 (set B, tau -> eps*tau, w -> eps^2*w)
eps= 2.000  E_b(w22) - E_b(w22=0) = +2.867296e-07;  w22*|<22|psi(0)>|^2 = +2.867347e-07;  |<22|psi(0)>|^2 = 8.960461e-06
eps= 1.000  E_b(w22) - E_b(w22=0) = +4.444423e-09;  w22*|<22|psi(0)>|^2 = +4.444423e-09;  |<22|psi(0)>|^2 = 5.555528e-07;  ratios to the previous eps: dE 64.51, weight 16.13
eps= 0.500  E_b(w22) - E_b(w22=0) = +6.930323e-11;  w22*|<22|psi(0)>|^2 = +6.930409e-11;  |<22|psi(0)>|^2 = 3.465205e-08;  ratios to the previous eps: dE 64.13, weight 16.03
eps= 0.250  E_b(w22) - E_b(w22=0) = +1.080025e-12;  w22*|<22|psi(0)>|^2 = +1.082329e-12;  |<22|psi(0)>|^2 = 2.164659e-09;  ratios to the previous eps: dE 64.17, weight 16.01
expected for halving eps: 64 for the contribution of w22 to E_b (order eps^6), 16 for the weight (order eps^4)

=== new in v2, I5: equal data (a_1 = a_2) at P = pi/2, where j(P) = 0 (set A, tau -> eps*tau, w -> eps^2*w)
eps= 1.000  E_b = 2.001000623470  M_1+M_2+a+w11 = 2.001000000000  difference +6.235e-07;  1 - weight(r=0,11) = 2.495e-03;  weight of 11 at r != 0: 3.044e-07
eps= 0.500  E_b = 2.000250039039  M_1+M_2+a+w11 = 2.000250000000  difference +3.904e-08;  1 - weight(r=0,11) = 6.247e-04;  weight of 11 at r != 0: 1.906e-08;  ratios: dE 15.97, 1-weight 3.99
eps= 0.250  E_b = 2.000062502441  M_1+M_2+a+w11 = 2.000062500000  difference +2.441e-09;  1 - weight(r=0,11) = 1.562e-04;  weight of 11 at r != 0: 1.192e-09;  ratios: dE 15.99, 1-weight 4.00
expected: psi_P = delta_{r,0}|11> up to O(eps) (1 - weight of order eps^2), E_b = M_1+M_2+a+w11 up to O(eps^4)

=== new in v2, I2: twofold bound levels (on-site binding W0 = -G(E0,P0)^(-1) on span(|11>,|22>))
set X_P0_0.3: M = 1.0, 0.7; tau = 0.5, 0.35; P0 = 0.3; W0 on (11,22) = [[-0.870998, 0.169999], [0.169999, 2.488876]]; bands {'+1+1': (1.7046, 1.8965), '+1-1': (0.2832, 0.3515), '-1+1': (-0.3515, -0.2832), '-1-1': (-1.8965, -1.7046)}
  level 1.000000000000, splitting of the two eigenvalues 2.11e-15, distance to the next eigenvalue 0.5368, weight at |r|>L/2 1.3e-30
  M1   : eigenvalues of Pi dH Pi -0.628449130, +0.893076371; slopes of the branches (finite differences) -0.628449130, +0.893076371; max dev 1.8e-12; overlap with the branch vectors >= 0.999997
  M2   : eigenvalues of Pi dH Pi -0.919383668, +0.837955656; slopes of the branches (finite differences) -0.919383668, +0.837955656; max dev 8.3e-13; overlap with the branch vectors >= 0.999999
  tau1 : eigenvalues of Pi dH Pi +0.137013648, +0.601738268; slopes of the branches (finite differences) +0.137013648, +0.601738268; max dev 8.2e-12; overlap with the branch vectors >= 0.999999
  tau2 : eigenvalues of Pi dH Pi -0.156239994, +0.533638710; slopes of the branches (finite differences) -0.156239994, +0.533638710; max dev 1.1e-12; overlap with the branch vectors >= 1.000000
  theta: eigenvalues of Pi dH Pi -0.726064561, +2.016971420; slopes of the branches (finite differences) -0.726064561, +2.016971420; max dev 4.6e-12; overlap with the branch vectors >= 0.999996
  P    : eigenvalues of Pi dH Pi -0.031846375, +0.056264981; slopes of the branches (finite differences) -0.031846375, +0.056264981; max dev 2.9e-10; overlap with the branch vectors >= 0.999955
         E'' of the branches: (11.24) -0.10636246, +0.17322408; finite differences -0.10636246, +0.17322408; max dev 1.3e-10
         (11.9) with Q_P = 1 - |psi><psi|, term of the other vector of the level in the basis of the solver: |<psi'|V_eta|psi>|^2 = 6.549e-04 over E' - E = -2.109e-15
  every eigenvector (5 random vectors of the level): residual of (11.6) 1.6e-15; <V1> - <V2> 1.1e-16; ||Pi (V1 - V2) Pi|| 1.6e-16; <dH> - weighted mean of the branch slopes (M1, theta) 4.1e-12
  |<branch 0 of M1 | branch 0 of xi>|^2: M2 0.9912, tau1 0.2769, tau2 0.7272, theta 0.0013, P 0.5106
  <U> in the two branch vectors of M1: +2.013542, -0.722635  against the slopes of the branches of theta: -0.726065, +2.016971
set X_P0_0: M = 1.0, 0.7; tau = 0.5, 0.35; P0 = 0.0; W0 on (11,22) = [[-0.869086, 0.177794], [0.177794, 2.488618]]; bands {'+1+1': (1.7, 1.9007), '+1-1': (0.3, 0.3354), '-1+1': (-0.3354, -0.3), '-1-1': (-1.9007, -1.7)}
  level 1.000000000000, splitting of the two eigenvalues 3.55e-15, distance to the next eigenvalue 0.5397, weight at |r|>L/2 3.2e-30
  M1   : eigenvalues of Pi dH Pi -0.631196110, +0.895473254; slopes of the branches (finite differences) -0.631196110, +0.895473254; max dev 1.8e-12; overlap with the branch vectors >= 0.999997
  M2   : eigenvalues of Pi dH Pi -0.918901736, +0.845071613; slopes of the branches (finite differences) -0.918901736, +0.845071613; max dev 1.2e-12; overlap with the branch vectors >= 0.999999
  tau1 : eigenvalues of Pi dH Pi +0.120869467, +0.605304949; slopes of the branches (finite differences) +0.120869467, +0.605304949; max dev 2.1e-12; overlap with the branch vectors >= 0.999999
  tau2 : eigenvalues of Pi dH Pi -0.179004420, +0.538130054; slopes of the branches (finite differences) -0.179004420, +0.538130054; max dev 7.5e-13; overlap with the branch vectors >= 1.000000
  theta: eigenvalues of Pi dH Pi -0.725682673, +2.024305435; slopes of the branches (finite differences) -0.725682673, +2.024305435; max dev 3.7e-12; overlap with the branch vectors >= 0.999996
  P    : eigenvalues of Pi dH Pi -0.000000000, +0.000000000; slopes of the branches (finite differences) +0.000000000, -0.000000000; max dev 1.8e-14; overlap with the branch vectors >= 0.999952; branch vectors from the second order
         E'' of the branches: (11.24) -0.10630610, +0.19294341; finite differences -0.10630610, +0.19294341; max dev 4.1e-10
         (11.9) with Q_P = 1 - |psi><psi|, term of the other vector of the level in the basis of the solver: |<psi'|V_eta|psi>|^2 = 9.382e-35 over E' - E = -3.553e-15
  every eigenvector (5 random vectors of the level): residual of (11.6) 1.6e-15; <V1> - <V2> 3.5e-17; ||Pi (V1 - V2) Pi|| 6.4e-17; <dH> - weighted mean of the branch slopes (M1, theta) 2.9e-12
  |<branch 0 of M1 | branch 0 of xi>|^2: M2 0.9904, tau1 0.2843, tau2 0.7171, theta 0.0014, P 0.5112
  <U> in the two branch vectors of M1: +2.020503, -0.721880  against the slopes of the branches of theta: -0.725683, +2.024305

=== new in v2, I1: the operator C_bod = <chi|C|chi> of (11.21), small system in the places (dimension 64 x 3)
listing A: the terms of the question; listing B: h*sigma3 of b_1, a constant and a part of the motion term of b_2 listed in the record terms; <chi|X|chi> = -0.6021 for the medium that is not centred; lambda = 3
kappa=0.040 centred    : ||C_B - C_A|| 1.3e-15; ||C_bod(B) - C_bod(A)|| 5.2e-16; ||C_bod - C_pair(A)|| 1.339e-15 (minus the gradient: 1.3e-15); ||C_bod - C_pair(B)|| 2.589; view against evolution by C_bod 4.141e-02, by C_pair(A) 4.141e-02, by C_pair(B) 1.025
kappa=0.040 not_centred: ||C_B - C_A|| 1.5e-15; ||C_bod(B) - C_bod(A)|| 1.3e-15; ||C_bod - C_pair(A)|| 6.534e-01 (minus the gradient: 1.3e-15); ||C_bod - C_pair(B)|| 2.491; view against evolution by C_bod 4.147e-02, by C_pair(A) 1.526e-01, by C_pair(B) 1.045
kappa=0.020 centred    : ||C_B - C_A|| 1.3e-15; ||C_bod(B) - C_bod(A)|| 1.0e-15; ||C_bod - C_pair(A)|| 1.298e-15 (minus the gradient: 1.3e-15); ||C_bod - C_pair(B)|| 2.589; view against evolution by C_bod 1.052e-02, by C_pair(A) 1.052e-02, by C_pair(B) 1.034
kappa=0.020 not_centred: ||C_B - C_A|| 1.4e-15; ||C_bod(B) - C_bod(A)|| 9.8e-16; ||C_bod - C_pair(A)|| 3.267e-01 (minus the gradient: 1.5e-15); ||C_bod - C_pair(B)|| 2.520; view against evolution by C_bod 1.053e-02, by C_pair(A) 7.442e-02, by C_pair(B) 1.044
kappa=0.010 centred    : ||C_B - C_A|| 1.4e-15; ||C_bod(B) - C_bod(A)|| 8.3e-16; ||C_bod - C_pair(A)|| 1.295e-15 (minus the gradient: 1.3e-15); ||C_bod - C_pair(B)|| 2.589; view against evolution by C_bod 2.642e-03, by C_pair(A) 2.642e-03, by C_pair(B) 1.037
kappa=0.010 not_centred: ||C_B - C_A|| 1.3e-15; ||C_bod(B) - C_bod(A)|| 1.2e-15; ||C_bod - C_pair(A)|| 1.633e-01 (minus the gradient: 1.8e-15); ||C_bod - C_pair(B)|| 2.549; view against evolution by C_bod 2.643e-03, by C_pair(A) 3.695e-02, by C_pair(B) 1.041
expected for halving kappa: the view against the evolution by C_bod falls by 4 (second order); by the listed C_pair(A) with a medium that is not centred it falls by 2

Interested in this research?

Join the readers' list and get an e-mail when a new stage or a correction is published. No password, and you can unsubscribe at any time.