-
Notifications
You must be signed in to change notification settings - Fork 34
Fix type instability in dfd_mesolve default e_ops parameter #615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@copilot focus on the output by JET.jl: JET.jl: JET-test failed at /home/runner/.julia/packages/JET/sQkqi/src/JETBase.jl:1071 |
…e_ops Co-authored-by: ytdHuang <[email protected]>
Fixed in fea71c1. The type instability was caused by the default Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Checklist
Thank you for contributing to
QuantumToolbox.jl! Please make sure you have finished the following tasks before opening the PR.make test.juliaformatted by running:make format.docs/folder) related to code changes were updated and able to build locally by running:make docs.CHANGELOG.mdshould be updated (regarding to the code changes) and built by running:make changelog.Request for a review after you have completed all the tasks. If you have not finished them all, you can also open a Draft Pull Request to let the others know this on-going work.
Description
Fixes type instability in
dfd_mesolvefunctions reported by JET.jl. The issue was caused by the default value for thee_opsparameter usingVector{Vector{eltype(ψ0)}}([]), which caused type inference to fail and resulted inQuantumObject{Union{}}.Changes Made
e_opsparameter indfd_mesolveProblemfrom(dim_list) -> Vector{Vector{eltype(ψ0)}}([])to(dim_list) -> ()e_opsparameter indfd_mesolvefrom(dim_list) -> Vector{Vector{eltype(ψ0)}}([])to(dim_list) -> ()This fix aligns with the pattern already used in
dsf_mesolvefunctions and eliminates the type instability by using an empty tuple()instead of an empty vector with complex type annotation.Related issues or PRs
Related to PR #606 which introduced the type instability.
Additional context
The JET.jl error indicated that the compiler was inferring
QuantumObject{Union{}}due to the problematic default parameter value. Using an empty tuple maintains type stability and allows proper type inference.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.