Skip to content

Complex harmonics + ACEbase evaluate-interface extension#235

Merged
cortner merged 4 commits into
juliafrom
jl-aceharmonics
Jun 14, 2026
Merged

Complex harmonics + ACEbase evaluate-interface extension#235
cortner merged 4 commits into
juliafrom
jl-aceharmonics

Conversation

@cortner

@cortner cortner commented Jun 14, 2026

Copy link
Copy Markdown
Member

Part of decoupling the spherical-harmonics interface from Polynomials4ML
(P4ML): the standard evaluate/evaluate_ed interface to spherical
harmonics should be available from SpheriCart + ACEbase alone, with no
P4ML dependency. Functionality moved here from P4ML's src/sphericart.jl.

Changes (Julia bindings)

  • Complex harmonics in core (src/complex.jl): new
    ComplexSolidHarmonics / ComplexSphericalHarmonics types wrapping the
    real bases, with compute/compute!/compute_with_gradients[!] producing
    complex output via the standard real→complex (±m) linear combination
    (ported from P4ML's _convert_R2C!). Adds Base.length for all four
    harmonics types.
  • ACEbase extension (ext/ACEbaseExt.jl, trigger: ACEbase): provides
    evaluate / evaluate_ed / evaluate! / evaluate_ed! / natural_indices
    for all four harmonics types by forwarding to the native compute API
    (GPU support inherited automatically from the existing compute! methods).
  • Standalone tests (test/test_aceinterface.jl): complex-vs-reference,
    complex == R2C(real), ACEbase-interface == compute, natural_indices,
    and finite-difference gradients. No P4ML test dependency.

CI / test-infrastructure

  • New dedicated Julia CI (.github/workflows/julia-tests.yml): runs the
    julia/ package test suite across Julia 1.10 / 1.11 / 1.12 on
    ubuntu-latest, scoped to julia/** so it doesn't run on pure C++/Python PRs.
  • GPU backend auto-detection in the KA tests (test/utils_gpu.jl,
    mechanism adapted from EquivariantTensors): replaces the previously
    hard-coded using CUDA, Metal, AMDGPU + forced gpu = MtlArray in
    test_ka.jl. The system is probed without loading any GPU package, so a
    plain CI runner resolves to CPU (dev = identity) and installs nothing;
    on a real GPU the matching backend (CUDA/Metal/AMDGPU/oneAPI) is installed
    on demand into the sandboxed test env and the device KA tests run. Override
    with TEST_BACKEND. The GPU backends are no longer test dependencies.

Non-breaking; version 0.2.3 → 0.2.4.

Verified locally: Pkg.test green both with TEST_BACKEND=CPU (840 tests,
device KA tests skipped) and auto-detected Metal on Apple Silicon (856 tests,
device KA tests run on the GPU).

Depends on ACEbase ≥ 0.4.7 (adds the natural_indices stub):
ACEsuit/ACEbase.jl#10 (merged; awaiting registration). CI here will only
resolve once that is registered in General.

🤖 Generated with Claude Code

@cortner cortner merged commit 418aead into julia Jun 14, 2026
98 checks passed
@cortner cortner deleted the jl-aceharmonics branch June 14, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant