Skip to content

feat: Integrate standalone FidelityComputer (WIP - some tests failing) #41

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Akhils777
Copy link
Contributor

Description

This PR integrates the new FidelityComputer system, replacing the previous dependency on qutip_qtrl.fid_computer.

Note: This is a work-in-progress merge. 3 test cases are currently failing (listed below), and fixes are actively being developed.


Key Improvements

  • Introduced fidcomp.py with support for:
    • PSU / SU / TRACEDIFF fidelity types
    • State and process fidelity
    • JAX compatibility
  • Refactored optimization algorithms to use the new fidelity system

Known Failing Test Cases:

  1. State-to-state GRAPE optimization
  2. State-to-state CRAB optimization
  3. Parameterized CRAB optimization

Verification

  • All other test cases pass with numerical consistency
  • Improved fidelity handling and input type compatibility
  • Side-by-side equivalence with legacy fidelity module

@Akhils777 Akhils777 marked this pull request as ready for review May 7, 2025 15:55
@coveralls
Copy link

Pull Request Test Coverage Report for Build 14846815312

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 185 of 345 (53.62%) changed or added relevant lines in 8 files are covered.
  • 59 unchanged lines in 6 files lost coverage.
  • Overall coverage decreased (-15.8%) to 70.815%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/qutip_qoc/_jopt.py 13 16 81.25%
src/qutip_qoc/_optimizer.py 18 22 81.82%
src/qutip_qoc/fidcomp.py 58 65 89.23%
src/qutip_qoc/_rl.py 45 73 61.64%
src/qutip_qoc/_grape.py 6 39 15.38%
src/qutip_qoc/pulse_optim.py 22 60 36.67%
src/qutip_qoc/_crab.py 7 54 12.96%
Files with Coverage Reduction New Missed Lines %
src/qutip_qoc/_jopt.py 1 90.77%
src/qutip_qoc/_optimizer.py 2 83.45%
src/qutip_qoc/objective.py 4 90.48%
src/qutip_qoc/result.py 13 73.2%
src/qutip_qoc/_grape.py 14 16.0%
src/qutip_qoc/pulse_optim.py 25 36.36%
Totals Coverage Status
Change from base Build 14120830666: -15.8%
Covered Lines: 791
Relevant Lines: 1117

💛 - Coveralls

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