Issue: #10 - Introduce a FidelityComputer class (see qutip-qtrl) for custom fidelity types #40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have introduced a new FidelityComputer class in qutip-qoc, modeled after the implementation in qutip-qtrl, to support custom fidelity types.
Changes Made:
Added a new module: fidcomp.py under src/qutip_qoc/
Implemented the FidelityComputer class with support for user-defined/custom fidelity functions.
Integrated the class by importing it in the existing test_fidelity.py file for testing purposes.
All 11 existing test cases passed successfully using the new implementation.
Additionally, I created 6 new test cases locally to validate edge cases and custom fidelity types — these also passed.
Notes:
The 6 new tests are currently local and not pushed to the repo — they can be added if needed.
No changes were made to the overall API structure; this class is modular and can be easily extended or plugged into future workflows.