quantcore_circuits.analysis.epr =============================== .. py:module:: quantcore_circuits.analysis.epr .. autoapi-nested-parse:: Energy-participation-ratio Hamiltonian (pyEPR calculation core, no AEDT needed). Input: linear eigenmode frequencies (HFSS/Palace eigenmode with Lj as a lumped inductor), junction participation ratios ``p_mj`` (M modes × J junctions), signs ``s_mj`` and junction inductances. pyEPR's ``QuantumAnalysis`` needs a pickle produced by ``DistributedAnalysis``; the calculation functions below are what it calls internally. :func:`participations` is pyEPR's ``DistributedAnalysis.calc_p_junction`` + ``QuantumAnalysis`` renormalisation (``config.epr.renorm_pj = True``) applied to the field integrals that ``qcc_solve.py`` evaluates inside AEDT (:mod:`quantcore_circuits.sim_tools.aedt_scripts`), method ``line_voltage``: * V_j = sign(∫Re E·dl) √((∫Re E·dl)² + (∫Im E·dl)²) over the junction line, I_j = V_j / (ω L_j); * U_E = ∫Re(E·εE*)/2, U_H = ∫Re(H·μH*)/2 (peak energies), U_J = ½ L_j I_j², U_Cj = ½ C_j V_j²; * p_mj = U_J / (U_E + ΣU_Cj), then rescaled so Σ_j p_mj = \|(Ū − U_H)/Ū\|, Ū = mean of total capacitive and inductive energy; s_mj = sign(V_j). Sign conventions are converted to qcc's (α < 0, χ = E11 − E10 − E01 + E00 < 0); pyEPR reports positive shifts. Functions --------- .. autoapisummary:: quantcore_circuits.analysis.epr.epr_analysis quantcore_circuits.analysis.epr.epr_hamiltonian quantcore_circuits.analysis.epr.epr_qutip quantcore_circuits.analysis.epr.junction_participation_from_energy quantcore_circuits.analysis.epr.junction_self_modes quantcore_circuits.analysis.epr.participations Module Contents --------------- .. py:function:: epr_analysis(epr: dict, freqs_GHz=None, Q=None, tan_delta: float | None = None, **kw) -> dict Participations (:func:`participations`) + EPR Hamiltonian (:func:`epr_hamiltonian`) in one dict. Adds ``chi_MHz`` (M×M, diagonal = α), ``f_GHz`` dressed (numerical diagonalisation), the first-order values, and with ``tan_delta`` the bulk-dielectric Q per mode (1 / (p_substrate tan δ)); ``Q`` (per mode) is passed through. .. py:function:: epr_hamiltonian(freqs_GHz, p_mj, lj_nH, s_mj=None, cos_trunc: int = 8, fock_trunc: int = 9, numerical: bool = True) -> dict Dressed frequencies and χ matrix from EPR data. Returns ``f_GHz`` (dressed, numerical diagonalisation or 1st-order PT), ``chi_MHz`` (M×M; diagonal = α), and the first-order values ``f_O1_GHz`` / ``chi_O1_MHz``. .. py:function:: epr_qutip(freqs_GHz, p_mj, lj_nH, s_mj=None, fock: int = 8) -> dict Independent QuTiP check of the EPR Hamiltonian (not pyEPR's code path). H = sum_m h f_m a_m^+ a_m - sum_j EJ_j [cos(phi_j) + phi_j^2 / 2], phi_j = sum_m s_mj phi_mj (a_m + a_m^+), phi_mj^2 = p_mj h f_m / (2 EJ_j), EJ = (hbar / 2e)^2 / Lj. The cosine is exact (``cosm``), so only the Fock truncation differs from pyEPR's Taylor series. Returns the dressed single-excitation ``f_GHz`` and ``chi_MHz`` (M x M, qcc sign: diagonal = alpha, off-diagonal chi_mn = E(1_m 1_n) - E(1_m) - E(1_n) + E(0)). .. py:function:: junction_participation_from_energy(freq_GHz: float, lj_nH: float, i_peak_A: float, u_total_J: float) -> float p_J = ½ Lj I² / U_total for a mode with peak junction current ``i_peak_A`` and total energy ``u_total_J``. .. py:function:: junction_self_modes(p: dict, p_min: float = 0.95, rel: float = 0.15) -> list[int] Modes that are a junction's lumped L_J ‖ C_J resonating on its own: p_mj ≥ ``p_min`` for one junction and f within ``rel`` of 1/2π√(L_J C_J) of that junction (with C_J > 0). Seen on coarse / fast meshes (tutorial 00, C_J 14.7 fF: a 15.65 GHz mode with p_J 0.9999 beside the real qubit mode, p_J 0.985); a circuit mode has the island's capacitance in parallel and sits far below. Returned as mode indices (0-based). .. py:function:: participations(epr: dict, freqs_GHz=None, renorm: bool = True) -> dict Junction participations from qcc's in-AEDT EPR integrals (``_project_qcc.json`` ``"epr"``). ``freqs_GHz`` (mode order) overrides the per-mode ``freq_Hz`` read in AEDT (e.g. the ``.eig`` export). Returns ``{"junctions", "Lj_nH", "Cj_fF", "f_GHz", "p_mj", "s_mj", "p_mj_raw", "U_diff", "p_volume"}`` with M×J lists.