Skip to content

Dispersive SHG FROG: Type I crystal phase matching and two-beam delay smearing #24

Open

Description

@chrisbrahms

What is missing

SHG FROG cannot model the nonlinear crystal. The forward models refuse dispersive propagation for SHG (

croak/croak/forward.py

Lines 150 to 159 in 73c72ba

# The slab propagation phase β(ω) is built at the *fundamental* carrier,
# but the SHG signal lives near 2ω0 — propagating it with β(ω) is
# physically inconsistent. Dispersive propagation is only meaningful for
# interactions whose signal stays at the fundamental (PG, SD).
if material is not None and thickness and self.interaction.omega0_scale != 1.0:
raise ValueError(
f"dispersive propagation is not supported for the "
f"{self.interaction.name.upper()} interaction (its signal is not at "
f"the fundamental frequency); use a thin medium (material=None)"
)
,

croak/croak/forward_jax.py

Lines 155 to 162 in 73c72ba

# Same physical guard as ForwardModel: a slab built at the fundamental
# cannot consistently propagate an SHG signal that lives near 2*omega0.
if material is not None and thickness and inter.omega0_scale != 1.0:
raise ValueError(
f"dispersive propagation is not supported for the "
f"{inter.name.upper()} interaction (its signal is not at the "
f"fundamental frequency); use a thin medium (material=None)"
)
) because they build one propagation constant β(ω0+Ω) on the fundamental grid and apply it to the fundamental and the signal (

croak/croak/forward.py

Lines 161 to 173 in 73c72ba

# Work internally in DFT-bin order.
self.omega_bin = scipy.fft.ifftshift(self.omega)
beta = materials.beta(material, self.omega, omega0)
beta_bin = scipy.fft.ifftshift(beta)
nodes, weights = quadrature_nodes_weights(self.thickness, npoints, quadrature)
self.nodes = nodes
self.weights = weights
self.q = nodes.size
# Propagation phase matrices, shape (N, Q), in DFT-bin order.
self.input_prop = np.exp(1j * np.outer(beta_bin, nodes))
self.signal_prop = np.exp(1j * np.outer(beta_bin, self.thickness - nodes))
). The SHG signal lives at 2ω0+Ω, so it needs its own β. SHG also has no geometrical (two-beam) delay smearing: the existing kernel is the three-arm BOXCARS form (

croak/croak/smearing.py

Lines 341 to 344 in 73c72ba

raise ValueError(
f"geometrical smearing is not supported for the {inter.name.upper()} "
f"interaction; only PG (TG) and SD have the required three-arm form"
)
,

croak/croak/forward.py

Lines 180 to 186 in 73c72ba

if smearing is not None:
if self.interaction.name not in ("pg", "sd"):
raise ValueError(
f"geometrical smearing is not supported for the "
f"{self.interaction.name.upper()} interaction; only PG (TG) and SD "
f"have the required three-arm form"
)
).

Why it matters

Few-cycle SHG FROG in a crystal of tens of µm is shaped by phase matching (a frequency- and pair-dependent sinc² response), by group-velocity mismatch and by delay smearing from the crossing angle (Baltuška et al., IEEE J. Quantum Electron. 35, 459 (1999), doi:10.1109/3.753651). Without them, retrievals of such traces are biased, and the only remedy is the optional marginal correction, which is approximate.

Approach (agreed with the maintainer)

  • Separate β for the fundamental (o-ray; longitudinal wavevector $\sqrt{k_o^2-(\omega\sin\alpha/c)^2}$ with the external crossing half-angle α) and the signal (e-ray at the internal angle θ). Because materials.beta keeps the carrier wavevector, the depth sum then carries the exact Δk = k_s(ω1+ω2) − k_z(ω1) − k_z(ω2). Generation prefactor ω_s/n_s; other spectral factors via the existing R_omega.
  • Type I (oo→e) only. The crystal is specified as manufacturer cut angle θ_c plus an external tilt γ, or "tilt tuned to phase-match at λ_pm"; path L/cos γ_int. Nothing is derived from the grid.
  • The fundamental polarisation relative to the crossing plane decides whether the crossing plane is the principal plane; in that case a neglected first-order signal-tilt term is estimated and warned about.
  • One TwoBeamGeometry (beam separation, focal length, beam diameter) is the single source of the crossing angle for both Δk and the delay-smearing kernel (σ_δ for Gaussian beams).
  • Depth quadrature resolution chosen from max|Δk|L/2.
  • BBO dispersion from Tamošauskas et al., Opt. Mater. Express 8, 1410 (2018), doi:10.1364/OME.8.001410, added to optmat first.

To do

  • optmat: BBO o/e models from Tamošauskas 2018 (separate repository), then raise croak's optmat pin.
  • Crystal numerics and both forward models (NumPy and JAX), with the marginal identity, an L→0 limit, a quadrature-convergence test and a brute-force (ω1, ω2) reference.
  • Solver, uncertainty, session, scripting and GUI threading ("Nonlinear crystal" and "Beam geometry" groups); synthetic traces with a crystal.
  • Two-beam SHG delay smearing.
  • Refuse a crystal model on a marginal-corrected trace (double counting).
  • Docs (forward model, interactions, new how-to, smearing) and changelog fragments.
  • Follow-ups to open once the model lands: a crystal-aware marginal-check prediction; fitting thickness/tilt for SHG with a crystal; an exact (ω1, ω2) option if the in-plane approximation matters in practice.

Done when

A synthetic SHG trace of a 5 fs, 800 nm pulse in 10 µm and 100 µm BBO, with smearing, is retrieved correctly by the crystal-aware model and is visibly biased with the ideal model; the BBO Type I angle at 800 nm reproduces the paper's 29.2° cut; uv run poe check passes with coverage at 100 %.


Drafted with Claude Code.

Activity

  1. added
    enhancementNew feature or request
    priority: mediumReal work that should not wait long
    area: forward modelForward models, interactions, dispersion, smearing and collection
    on Nov 12, 2026
  2. chrisbrahms commented on Nov 12, 2026

    @chrisbrahms
    ContributorAuthor

    Progress note for the session/GUI part (PR 3b), from the crystal-core work on feature/shg-crystal-core (not yet pushed):

    • Arms' delay drift. When the beams cross in the crystal's principal plane (fundamental polarised perpendicular to the crossing plane), the signal's tilt changes its extraordinary index to first order. The core models this as opposite, depth-dependent delays of the two arms, κ = (n_e'/n_s) sin α / c (about 0.57 fs per 100 µm per arm for BBO at 800 nm, 1.43°). The trace is then asymmetric in delay. CrystalSetup.delayed_beam sets the sign, which cannot be read off a real crystal; flipping it mirrors the trace in delay.
    • To do in PR 3b:
      • Call croak.crystals.check_tilt from the session pipeline before a retrieval with a principal-plane crystal (amplitude from the independent spectrum, delays from the measured axis). Nothing in croak/ calls it yet.
      • Add a switchable option (off by default) that retrieves with both signs of delayed_beam and keeps the better fit, reporting both errors.
      • Call croak.crystals.depth_points to choose npoints for a crystal.

    Drafted with Claude Code.

  3. chrisbrahms commented on Nov 13, 2026

    @chrisbrahms
    ContributorAuthor

    Follow-ups opened: #25 (crystal-aware marginal check), #26 (fitting the crystal's thickness and angle), #27 (residuals against a full-field simulation), #28 (time-zero reference of the principal-plane drift). Drafted with Claude Code.

  4. chrisbrahms commented on Nov 13, 2026

    @chrisbrahms
    ContributorAuthor

    The crystal model in the forward models is up as #31 (also closes #28). Threading through the solvers, session and GUI with BBO from optmat, and two-beam SHG delay smearing, follow as stacked PRs once #31 is in and optmat with BBO (LupoLab/optmat#48) is released. Drafted with Claude Code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: forward modelForward models, interactions, dispersion, smearing and collectionenhancementNew feature or requestpriority: mediumReal work that should not wait long

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions