feat(pipekit): Fourier derivative operators on the spectral carrier

Aperta
#152 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@jejjohnson ci sta già lavorando.

Dal 17/10/2026.

  • #160 di @jejjohnson — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
42/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Start by reading the referenced Tier-A work in #151, #149, and #150, then locate the Tier-B operator definitions and check_operator tests; the payload does not name file paths. Implement each listed operator as a wrapper around its Tier-A method and check allclose results and compiled HLO transform budgets on both carriers and output modes. Verify the barotropic vorticity RHS totals 5 transforms per evaluation and that the Hyperviscosity gradient matches finite differences; the issue notes the latter depends on #103.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Part of epic #148. Depends on: #151 (E4.1), #149 (E4.0a) (traced coefficients), #150 (E4.0b) (spectral_out)

Proposal

One Tier-B op per Tier-A method, each Array | Spectral → Array | Spectral per out. Bodies call Tier A with spectral=isinstance(x, Spectral) and spectral_out=(out == "spectral"). No multipliers are re-implemented.

op math (Fourier) transforms, spectral → spectral transforms, physical → physical
Gradient (ikₓ û, ik_y û) 0 1 + 2
Divergence ikₓ v̂ₓ + ik_y v̂_y 0 2 + 1
Curl ikₓ v̂_y − ik_y v̂ₓ 0 2 + 1
Laplacian −|k|² û 0 1 + 1
InverseLaplacian −û/|k|², mean → 0 0 1 + 1
Biharmonic |k|⁴ û 0 1 + 1
Hyperviscosity −ν |k|²ⁿ û (ν a leaf) 0 1 + 1
VelocityFromStreamfunction (−ik_y ψ̂, ikₓ ψ̂) 0 1 + 2
ProjectVector Leray: v̂ − k(k·v̂)/|k|² 0 2 + 2
Jacobian ℱ[fₓg_y − f_yg_x], 2/3-truncated 4 inv + 1 fwd 2 fwd + 4 inv + dealias round trip (1 + 1), today
AdvectionScalar ℱ[u·∇q], 2/3-truncated 2 inv + 1 fwd if u, v arrive physical; 4 inv + 1 fwd if all three are Spectral per #108
Dealias m ⊙ û 0 1 + 1

Each row's spectral → spectral budget is asserted with check_operator(..., budget=...). The physical → physical column documents today's cost and explains why the carrier exists.

Acceptance criteria

  • Every op equals its Tier-A method (allclose, x64) on both carriers and both out modes.
  • The budgets in the table hold in compiled HLO.
  • Barotropic vorticity RHS −Jacobian(InverseLaplacian(q), q) + Hyperviscosity(q) on a Spectral input with out="spectral": 5 transforms per evaluation, 20 per RK4 step (prototype: 20, vs 40 on the physical carrier).
  • jax.grad w.r.t. Hyperviscosity.nu matches finite differences (prototype: −1.0073e8 vs −1.0063e8). This fails today with TracerBoolConversionError until #103 lands.

Generated by Claude Code

Lingua principale
Python
Stelle
2
Fork
0
Merge medio
8h 13m
PR unite (30g)
8

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di jejjohnson/spectraldiffx

Tutte le issue di jejjohnson/spectraldiffx

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.