Skip to content

Migrate to SymbolicUtils v4.17 / Symbolics v7.13#171

Merged
Krastanov merged 2 commits intoQuantumSavory:mainfrom
Krastanov-agent:compat-symbolicutils4-code
Feb 5, 2026
Merged

Migrate to SymbolicUtils v4.17 / Symbolics v7.13#171
Krastanov merged 2 commits intoQuantumSavory:mainfrom
Krastanov-agent:compat-symbolicutils4-code

Conversation

@Krastanov-agent
Copy link
Copy Markdown
Contributor

Summary

  • Migrates from SymbolicUtils v3 (Symbolic{T} as symtype) to v4 (BasicSymbolic{T} with vartype) and Symbolics v6 to v7.13
  • Defines a local abstract type Symbolic{T} end to preserve the existing type hierarchy with minimal changes
  • Adds custom tree walkers (_prewalk/_fixpoint_prewalk) since SymbolicUtils v4's Prewalk/Postwalk only walk BasicSymbolic trees
  • Adds Symbolic{Complex} scalar arithmetic types (SScaledComplex, SAddComplex, SMulComplex) to replace functionality previously inherited from Symbolic{<:Number}
  • Extends SymbolicUtils.substitute for our types so Symbolics.substitute works on quantum expressions
  • Updates Term(f, [args])SymbolicUtils.term(f, args...) API change
  • One previously broken fock test (dagger(displace)*Create*displace) now passes with the new tree walker

Test plan

  • Full test suite passes: 401 pass, 2 broken (pre-existing in test_gabs.jl)
  • CI passes on all supported Julia versions
  • Extension tests (QuantumClifford, QuantumOpticsBase, QuantumToolbox) pass in CI

🤖 Generated with Claude Code

SymbolicUtils v4 removed `Symbolic{T}` and changed tree walkers to only
operate on `BasicSymbolic{T}`. This adapts QuantumSymbolics with minimal
changes by:

- Defining a local `abstract type Symbolic{T} end` preserving the type
  hierarchy
- Adding `vartype` fallback for `@rule` pattern matching compatibility
- Writing custom `_prewalk`/`_fixpoint_prewalk` tree walkers since
  SymbolicUtils v4's `Prewalk`/`Postwalk` no-op on non-BasicSymbolic types
- Adding `Symbolic{Complex}` scalar arithmetic types (SScaledComplex,
  SAddComplex, SMulComplex) replacing functionality previously inherited
  from `Symbolic{<:Number}`
- Extending `SymbolicUtils.substitute` for our types
- Updating `Term(f, [args])` to `SymbolicUtils.term(f, args...)`
- Updating scalar coefficient dispatch to use
  `Union{Number, BasicSymbolic, Symbolic{Complex}}`

Test results: 401 pass, 2 broken (pre-existing in test_gabs.jl).
One previously broken fock test now passes with the new tree walker.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 5, 2026

Codecov Report

❌ Patch coverage is 63.63636% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.42%. Comparing base (1f95ef4) to head (9e399df).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/QSymbolicsBase/QSymbolicsBase.jl 41.66% 28 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #171      +/-   ##
==========================================
- Coverage   76.85%   75.42%   -1.44%     
==========================================
  Files          21       21              
  Lines         877      948      +71     
==========================================
+ Hits          674      715      +41     
- Misses        203      233      +30     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Krastanov Krastanov merged commit ed91542 into QuantumSavory:main Feb 5, 2026
14 of 17 checks passed
@Krastanov
Copy link
Copy Markdown
Member

done with same prompt as #151, but with the skills from https://github.com/Krastanov/JuliaLLMAgentSkills (probably not much of a change though) and a newer version of claude code. Same model

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.

2 participants