目录文档-技术白皮书36-EFT.WP.EDX.Current v1.0

附录B. 实现绑定与函数原型


I. 目标与覆盖

  1. 绑定层与接口:I30-* / I40-* / Methods.SimStack / Mx-* / M10-*。
  2. 强制口径(两式等价,须显式路径/测度并记录 delta_form):
    • 常量外提:T_arr = ( 1 / c_ref ) * ( ∫ n_eff d ell )
    • 一般口径:T_arr = ( ∫ ( n_eff / c_ref ) d ell )
  3. 符号与单位:英文内联、SI、check_dim=pass、Re{Z_eft}≥0、KK_consistency=pass。

II. 命名空间与版本

  1. 命名空间:
    • edx.current.binding(I30-*)
    • edx.current.circuit(I40-*)
    • edx.current.simstack(Methods.SimStack)
    • edx.current.inference(Mx-*)
    • edx.current.metrology(M10-*)
  2. 版本策略:api_version: "1.0";语义化 semver;返回体携带 {api_version, impl_version, checksum}。

III. 公共数据结构(最小)

types:

PathSegment:

fields: {mat:str, layer:str, len_m:float, w_m:float, t_m:float, neigh:str, n_eff:float}

PathSpec:

fields: {id:str, segments:list[PathSegment], weight:float} # 0..1

ArrivalRecord:

fields: {form:enum["n_over_c","one_over_c_times_n"], gamma:"explicit", measure:"d_ell",

c_ref:float, Tarr_s:float, u_Tarr_s:float, delta_form:str}

QAGates:

fields: {check_dim:enum["pass","fail"], passivity:enum["pass","fail"], KK:enum["pass","fail"]}

Ports: {names:list[str], zref_ohm:float}

Deemb: {method:str, version:str, artifact:str}

Sync: {ref:str, scheme:str, dt_sync_s:float}

BindingRef: {id:str, paths:list[PathSpec]}

Priors: {schema:str, entries:map}

PosteriorSummary: {theta_map:map, theta_mean:map, CI_95:map, logZ:float}

Grid: {freq_grid_Hz:list[float]}

Weights: {w:map[path_id->list[float]]}


IV. 边界与绑定(I30-*)函数原型

edx.current.binding:

- id: "I30-1.map_ports"

proto: "map_ports(ports_sim:Ports, anchors:any) -> Ports"

qa: ["check_dim"]

notes: ["端口名一一对应;zref 统一"]

- id: "I30-2.bind_layout"

proto: "bind_layout(layout:any, constraints:any) -> BindingRef"

requires: ["显式 γ(ell) 分段; 每段 n_eff, len_m"]

qa: ["check_dim"]

- id: "I30-3.apply_deemb"

proto: "apply_deemb(dataset:any, deemb:Deemb, baseline_id:str) -> dataset"

qa: ["check_dim"]

- id: "I30-3.time_align"

proto: "time_align(dataset:any, sync:Sync) -> dataset"

post: ["相位改正 `arg Z ← arg Z - ( omega · Δt_sync )`"]

- id: "I30-3.path_correct"

proto: "path_correct(dataset:any, binding:BindingRef, arrival:ArrivalRecord) -> dataset"

requires: ["arrival.delta_form 已填写", "paths 完整"]

qa: ["check_dim","passivity","KK"]


V. 电路级绑定(I40-*)函数原型

edx.current.circuit:

- id: "I40-1.compile"

proto: "compile(netlist:any, layout:any, binding:BindingRef, bc:any, options:any) -> model_handle"

returns: {model_handle:any, api_version:str}

- id: "I40-1.predict"

proto: "predict(model_handle:any, theta:map, grid:Grid) -> {Z_model:complex[], T_arr_p:map, w_p:Weights}"

qa: ["passivity","KK","check_dim"]

- id: "I40-1.jacobian"

proto: "jacobian(model_handle:any, theta:map, grid:Grid) -> dZ_dtheta:map[param->complex[]]"

- id: "I40-1.update_paths"

proto: "update_paths(model_handle:any, binding:BindingRef) -> model_handle"


VI. 仿真栈(Methods.SimStack)函数原型

edx.current.simstack:

- id: "SimStack.build"

proto: "build(netlist:any, layout:any, binding:BindingRef, options:any) -> sim_handle"

- id: "SimStack.forward"

proto: "forward(sim_handle:any, theta:map, grid:Grid) -> {Z_eft:complex[], argZ:float[], T_arr_p:map, w_p:Weights}"

- id: "SimStack.invert"

proto: "invert(sim_handle:any, data:any, priors:Priors, sampler:str='NUTS') -> {posterior:any, logZ:float, summary:PosteriorSummary}"

- id: "SimStack.ppc"

proto: "ppc(sim_handle:any, posterior:any, grid:Grid) -> {residual_spectrum:float[], gates:QAGates}"

- id: "SimStack.export"

proto: "export(sim_handle:any, format:enum['cards','json']) -> artifact_paths:list[str]"


VII. 参数与先验(Mx-*)

edx.current.inference:

priors:

sigma_eff: {type:"lognormal", mu:-12.0, s:0.8, unit:"S/m", bounds:[1e-8, 1e6]}

Ks_amp: {type:"halfnormal", sigma:0.5} # 使 `J` 为 A·m^-2

Ks_tau: {type:"loguniform", low:1e-12, high:1e-7, unit:"s"}

w_dirichlet: {type:"dirichlet", alpha:[0.3,0.3,0.3]} # Σ=1

n_eff_seg: {type:"normal", mu:"n_eff_hat", sigma:"0.05*mu"}

dt_sync: {type:"normal", mu:0.0, sigma:2.0e-12, unit:"s"}

likelihoods:

complex_Z: "joint_gaussian(Re,Im; W_ω)"

mag_phase: "gaussian(|Z|) + gaussian(argZ - omega*Δt_sync) # 相干窗"

evidence:

compute: ["laplace","nested_sampling"]

gates: ["passivity","KK","check_dim"]


VIII. 计量与对齐(M10-*)函数原型

edx.current.metrology:

- id: "M10.align_pipeline"

proto: "align(raw:any, deemb:Deemb, sync:Sync, binding:BindingRef, arrival:ArrivalRecord) -> aligned"

post: ["产生 `Z_eft, argZ, T_arr, w_p`", "写入 QAGates"]

- id: "M10.arrival_consistency"

proto: "arrival_consistency(arrival:ArrivalRecord, paths:BindingRef) -> {diff_s:float, pass:bool}"

rule: "|T_arr(n_over_c) - T_arr(one_over_c_times_n)| ≤ u_Tarr"


IX. 质量门与校核函数

qa:

- id: "check_dim"

proto: "check_dim(equations:any) -> enum['pass','fail']"

- id: "check_passivity"

proto: "check_passivity(Z:complex[]) -> {min_Re:float, pass:bool}"

- id: "check_KK"

proto: "check_KK(Z:complex[], grid:Grid) -> enum['pass','fail']"

- id: "check_weights"

proto: "check_weights(w:Weights) -> {sum_max:float, pass:bool}" # Σ_p w_p ≤ 1

- id: "check_radiation_positive"

proto: "check_radiation_positive(dZrad:complex[]) -> {min_Re:float, pass:bool}"


X. 错误码

errors:

E_BAD_UNITS: "单位或量纲不一致"

E_KK_FAIL: "K–K 一致性失败"

E_PASSIVITY: "被动性失败 (Re{Z}<0)"

E_BINDING_MISSING: "缺失 binding_ref 或路径段"

E_DELTA_FORM_MISSING: "到达时 delta_form 未记录"

E_TARR_MISMATCH: "两口径 T_arr 不一致"

E_QA_FAIL: "QA 门未通过"

E_PRIOR_INVALID: "先验或边界不合法"


XI. 请求/响应模式(最小示例)

request:

api_version: "1.0"

op: "forward"

payload:

grid: {freq_grid_Hz: [1e6, 2e6, ...]}

theta: {sigma_eff: 5.0e5, Ks_amp: 0.12, Ks_tau: 3.0e-10, w_main: 0.85, w_side: 0.15}

response:

api_version: "1.0"

result:

Z_eft: {real:[...], imag:[...]}

argZ: [...]

T_arr_p: {γ_main: 1.21e-9, γ_side: 1.35e-9}

w_p: {γ_main:[...], γ_side:[...]}

qa_gates: {check_dim:"pass", passivity:"pass", KK:"pass"}

checksum: "sha256:..."


XII. 合规模板(到达时与绑定)

arrival:

form: "n_over_c" # 或 "one_over_c_times_n"

gamma: "explicit"

measure: "d_ell"

c_ref: 299792458.0

Tarr_s: 1.234e-09

u_Tarr_s: 6.0e-12

delta_form: "n_over_c"

binding_ref:

id: "LAY2PATH-xxxx"

paths:

- id: "γ_main"

segments:

- {mat:"Cu", layer:"L3", len_m:0.0102, w_m:1.2e-4, t_m:3.5e-5, neigh:"GND_L2", n_eff: 2.15}

weight: 0.86

- id: "γ_side"

segments:

- {mat:"Cu", layer:"L4", len_m:0.0031, w_m:1.0e-4, t_m:3.5e-5, neigh:"GND_L5", n_eff: 2.40}

weight: 0.14


XIII. 端到端调用顺序(伪代码)

# 1) 绑定与对齐

ports = map_ports(ports_sim, anchors)

binding = bind_layout(layout, constraints)

aligned = align(raw, deemb, sync, binding, arrival)

# 2) 构建与前向

sim = build(netlist, layout, binding, options)

out = forward(sim, theta0, grid)

# 3) 反演与 PPC

post = invert(sim, aligned, priors, sampler="NUTS")

pp = ppc(sim, post.posterior, grid)

# 4) 导出

export(sim, format="cards")


XIV. 约束与门限

w_p ≥ 0, Σ_p w_p ≤ 1;min Re{Z_eft} ≥ 0;核谱无右半平面极点;两口径 T_arr 差值 ≤ u_Tarr;check_dim / KK / passivity = pass。

版权与许可(CC BY 4.0)

版权声明:除另有说明外,《能量丝理论》(含文本、图表、插图、符号与公式)的著作权由作者(“屠广林”先生)享有。
许可方式:本作品采用 Creative Commons 署名 4.0 国际许可协议(CC BY 4.0)进行许可;在注明作者与来源的前提下,允许为商业或非商业目的进行复制、转载、节选、改编与再分发。
署名格式(建议):作者:“屠广林”;作品:《能量丝理论》;来源:energyfilament.org;许可证:CC BY 4.0。

首次发布: 2025-11-11|当前版本:v5.1
协议链接:https://creativecommons.org/licenses/by/4.0/