Repository navigation
Fix solution indexing for complex-typed PDE fields - #705
Merged
ChrisRackauckas merged 6 commits intoSep 27, 2026
Merged
ChrisRackauckas merged 6 commits into
ChrisRackauckas merged 6 commits into
Conversation
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.156.1 Agent-Model: gpt-6-luna Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/MethodOfLines.jl/jobs/704-codex/log.txt on amdci2.julia.csail.mit.edu
Handle Complex{Num} fields in direct and callable solution indexing and document the required field annotation. Require PDEBase 0.1.38, which includes complex-typed dependent-variable support from PDEBase PR SciML#131.
Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Codex <[email protected]>
Agent-Harness: Codex CLI 0.156.1
Agent-Model: gpt-6-luna
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/MethodOfLines.jl/jobs/704-codex/log.txt on amdci2.julia.csail.mit.edu
Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Codex <[email protected]> Agent-Harness: Codex CLI 0.156.1 Agent-Model: gpt-6-luna Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/MethodOfLines.jl/jobs/704-codex/log.txt on amdci2.julia.csail.mit.edu
Resolve Project.toml by keeping PDEBase 0.1.38 (contains complex-typed variable support from PDEBase SciML#131). Bring in SciML#703 Schrödinger phase regression fix. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent CLI 2026.09.26-dd393fe Agent-Model: auto Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/MethodOfLines.jl/jobs/704-codex/log-cont4.txt on amdci2.julia.csail.mit.edu
Validate the full Complex{Num} key against real(u)+im*imag(u) before
lookup so conj(u) and real(u)-2im*imag(u) error instead of aliasing.
Co-Authored-By: Chris Rackauckas <[email protected]>
Co-Authored-By: Cursor Agent <[email protected]>
Agent-Harness: Cursor Agent CLI 2026.09.26-dd393fe
Agent-Model: auto
Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/MethodOfLines.jl/jobs/704-codex/log-cont5.txt on amdci2.julia.csail.mit.edu
Cover direct, callable, and stationary overloads for conj and real-minus-2imag keys that previously returned the untransformed field. Co-Authored-By: Chris Rackauckas <[email protected]> Co-Authored-By: Cursor Agent <[email protected]> Agent-Harness: Cursor Agent CLI 2026.09.26-dd393fe Agent-Model: auto Agent-Session: local session, transcript at /home/crackauc/sandbox/agent-jobs/MethodOfLines.jl/jobs/704-codex/log-cont5.txt on amdci2.julia.csail.mit.edu
ChrisRackauckas
marked this pull request as ready for review
September 27, 2026 03:42
Merged
ChrisRackauckas
referenced
this pull request
Sep 29, 2026
Agent-Harness: Devin CLI 3000.11.3 (Mac) Agent-Model: Fusion (claude-opus-5-5 medium + swe-2 medium) Agent-Session: local transcript ~/.local/share/devin/cli/transcripts/helpful-exception.json Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Complex-typed PDE fields now support both direct indexing (
sol[ψ(t, x)]) and callable solution queries (sol(t, x; dv=ψ(t, x))). This normalizes the typed symbolic dependent variable for lookup, uses PDEBase's complex component map, adds a cubic NLS plane-wave regression for bothabs2(z)*zandz*conj(z)*z, and updates the Schrödinger tutorial to declareψ(..)::Complex. The callable path also fixes a separate bug for untyped (inferred-complex) fields:src/interface/solution/common.jlread the nonexistent fieldsol.disc_data_complexmap; it now usessol.disc_data.complexmap. The PDEBase compat floor is 0.1.38, the released version that contains PDEBase PR #131.Round-3 follow-up: complex-key normalization previously took only
real(key), sosol[conj(z)]andsol[real(z)-2im*imag(z)]silently returned the field. Lookup now accepts only the canonicalreal(u)+im*imag(u)form and errors on transformed keys (direct, callable, and stationary overloads), with regressions that failed on the previous head and pass after this fix.Merge / conflict resolution (cont4): merged
origin/master(includes #703 Schrödinger phase fix). The only conflict wasProject.tomlPDEBase compat (0.1.37on master vs0.1.38here); kept0.1.38.Risk assessment
src/interface/solution/common.jl: direct, callable and stationary lookup ofComplex{Num}dependent variables). No new dependencies or exports. Non-canonical keys such asconj(z)now throw where they used to return the field silently.sol[z, 3, :]) is still a follow-up. Keep discretized dependent variables as array-valued unknowns #701 edits solution indexing intimedep.jlandtimeindep.jl; reconcile the two if both merge.Verification (Julia 1.11,
OPENBLAS_NUM_THREADS=4, scratch envscratch/e2e-038/ reviewprobe-envwith MethodOfLines developed and registered PDEBase v0.1.38):2 pass, 4 errors, 6 total— direct indexingMethodError: symbolic_container(::PDESystem); callableMethodError: arguments(::Complex{Num}).1 pass, 1 error(disc_data_complexmap); after:2/2.common.jl):GROUP=Complex_Indexing … Pkg.test("MethodOfLines"):GROUP=Complex … Pkg.test("MethodOfLines"):GROUP=QA … Pkg.test("MethodOfLines"):--check,typos, andgit diff --checkon changed files: clean.Not verified: full
Everythingsuite, GPU/CUDA paths, downstream packages, docs linkcheck (previously HTTP 429), runtime composition with still-open #701.Reviewer attention: PDEBase 0.1.38 is released and required. #701 (array unknowns) still open — source overlap is in other solution files. #703 is on master and merged into this branch. Push back if supporting arbitrary symbolic transforms of complex fields is desired instead of hard rejection.
Closes #704.
Please ignore this draft until reviewed by @ChrisRackauckas.
Cursor Agent CLI 2026.09.26-dd393fe (model: auto); local transcript: /home/crackauc/sandbox/agent-jobs/MethodOfLines.jl/jobs/704-codex/log-cont5.txt on amdci2.julia.csail.mit.edu. Prior: Codex CLI 0.156.1 / gpt-6-luna (
log.txt); Claude Code cont2 (log-cont2.txt); Cursor Agent cont4 (log-cont4.txt).Risk assessment
sol[z],sol(...; dv = z)and stationary (PDENoTimeSolution) indexing, all insrc/interface/solution/common.jl. The newgetindex(::PDETimeSeriesSolution/PDENoTimeSolution, ::Complex{Num})methods only add behaviour; on master these calls hit aMethodError. The untyped callable path changes from reading the nonexistentsol.disc_data_complexmaptosol.disc_data.complexmap[operation(dv)]. That field belongs to MethodOfLines' ownMOLMetadataand uses the op →(redv, imdv)dict layout that PDEBasehandle_complexreturns. The PDEBase compat floor goes from 0.1.37 to 0.1.38, so anyone pinned below 0.1.38 is excluded. The Schrödinger tutorial now declaresψ(..)::Complex. No new dependencies or exports, no non-public dependency internals (it usesSymbolics.unwrapand SymbolicUtilsiscall/operation/arguments), no weakened or removed tests, and no SemVer-breaking change.3f28d6bhas 0 failing checks across 76 contexts, all green. That includes QA, Downgrade, PDESystemLibrary downstream Core, Documentation, Runic, Typos, and the newComplex_Indexinggroup on lts, 1 and pre. Master's latest Tests run onb5ce411(https://github.com/SciML/MethodOfLines.jl/actions/runs/35918574444) is 69/69 green, so there are no regressions and nothing pre-existing to excuse. Two caveats:Complex (julia pre)job log (https://github.com/SciML/MethodOfLines.jl/actions/runs/36243309862/job/108409983849) says "Julia 1.13.0 is not a release candidate … skipping build+test and reporting the pre lane as passing". The other ~35sprejobs (Convection, Convection_WENO, Integrals, Nonlinear_Diffusion_NU) most likely skipped the same way. Treat those greenprechecks as skipped, not as coverage.real(u)detection, and every CI lane is green, including Downgrade and downstream, with regression tests for the typed, untyped and stationary paths.🤖 Risk assessment posted by an AI agent (fleet master) — harness: Devin CLI (Mac) / fusion-claude-opus-5-5-high-sidekick-swe-2-medium; dispatched by Claude Code head, model claude-opus-5-5[1m]
Conversation: local Claude Code session 3cd6500a-1f81-46b5-ac0b-c466e15b6a53 on Chris's Mac (session ID, no URL)