Skip to content

Add support for state-dependent running costs#103

Merged
goerz merged 3 commits into
masterfrom
state-dependent-running-costs
Apr 19, 2026
Merged

Add support for state-dependent running costs#103
goerz merged 3 commits into
masterfrom
state-dependent-running-costs

Conversation

@goerz
Copy link
Copy Markdown
Member

@goerz goerz commented Apr 18, 2026

Adds make_xi and J_b functions in QuantumControl.Functionals, with support for automatic differentiation.

This is a pre-requisite for state-dependent-running costs in GRAPE, see JuliaQuantumControl/GRAPE.jl#53

@goerz goerz added the enhancement New feature or request label Apr 18, 2026
@goerz goerz force-pushed the state-dependent-running-costs branch from dfd7de9 to 46e185f Compare April 18, 2026 13:00
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 18, 2026

Codecov Report

❌ Patch coverage is 91.89189% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.5%. Comparing base (8891bab) to head (0952feb).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
src/functionals.jl 91.6% 5 Missing ⚠️
ext/QuantumControlZygoteExt.jl 87.5% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #103     +/-   ##
========================================
+ Coverage    88.3%   88.5%   +0.3%     
========================================
  Files          20      20             
  Lines        1046    1120     +74     
========================================
+ Hits          923     991     +68     
- Misses        123     129      +6     

☔ 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.

@goerz goerz force-pushed the state-dependent-running-costs branch from 887de3c to 5aa5869 Compare April 18, 2026 16:06
@goerz goerz requested a review from Copilot April 18, 2026 16:39
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the missing building blocks in QuantumControl.Functionals for state-dependent running costs (as needed by GRAPE): a running-cost functional J_b and a corresponding state-gradient builder make_xi, with AD backend support and tests.

Changes:

  • Add make_xi (analytic/automatic selection, default AD framework support) and J_b to QuantumControl.Functionals.
  • Implement make_automatic_xi for Zygote and FiniteDifferences via package extensions.
  • Add comprehensive tests for make_xi and a basic integration test for J_b; add a Documenter interlink fallback label.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/functionals.jl Introduces make_xi/make_automatic_xi and J_b, plus exports and storage access.
ext/QuantumControlZygoteExt.jl Adds Zygote-based automatic differentiation path for xi.
ext/QuantumControlFiniteDifferencesExt.jl Adds FiniteDifferences-based automatic differentiation path for xi.
test/test_functionals.jl Adds tests for make_xi modes/backends and a J_b integration test.
docs/make.jl Adds an interlinks fallback label referenced by J_b docs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/functionals.jl Outdated
Comment thread src/functionals.jl
Comment thread test/test_functionals.jl
As identified by copilot review
@goerz goerz merged commit 9bdff36 into master Apr 19, 2026
5 checks passed
@goerz goerz deleted the state-dependent-running-costs branch April 19, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants