Skip to content

Conversation

@albertomercurio
Copy link
Member

@albertomercurio albertomercurio commented Oct 10, 2025

Description

This PR adds support for Julia v1.12 by fixing a JET static analysis warning that was introduced with stricter world age semantics in Julia 1.12.

Changes

  • Added ::Diagonal type annotation to Id_cache parameter in liouvillian function in src/qobj/superoperators.jl

Problem

Julia 1.12 introduced more strict world age semantics for global bindings, causing JET to report:

WARNING: Detected access to binding `QuantumToolbox.liouvillian` in a world prior to its definition world.
WARNING: Detected access to binding `QuantumToolbox._sum_lindblad_dissipators` in a world prior to its definition world.
no matching method found `_sum_lindblad_dissipators(::Tuple, ::Nothing)`, 
`_sum_lindblad_dissipators(::AbstractVector, ::Nothing)`, etc.

Solution

By adding the ::Diagonal type annotation to Id_cache, Julia can now properly infer the type at compile time, eliminating the type instability that was causing issues with Julia 1.12's stricter semantics.

Testing

All code quality tests now pass:

  • ✅ Aqua.jl: 9/9 tests passed
  • ✅ JET.jl: 1/1 test passed

@albertomercurio albertomercurio added the Skip ChangeLog Skip changelog update check in PR label Oct 10, 2025
@albertomercurio albertomercurio changed the title Fix JET type stability warning in liouvillian function Add support for Julia v1.12 by fixing JET type stability warning Oct 10, 2025
@ytdHuang ytdHuang merged commit ecb5b5e into qutip:main Oct 11, 2025
14 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip ChangeLog Skip changelog update check in PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants