Add operator forms of the Hermitian square-root factorizations#223
Merged
Conversation
Adds operator (`NamedTensorOperator`) forms of `project_hermitian`, `sqrth_safe`, `invsqrth_safe`, and `sqrth_invsqrth_safe`, completing the operator-form factorization family alongside the existing `gram_eigh_full` operator forms. Each takes its codomain/domain bipartition from the operator, so callers can compose it with `transpose` to project Hermitian in one bipartition and take the root in the transposed one. `project_hermitian` returns an operator and the roots return bare named arrays, matching the tensor-level forms.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #223 +/- ##
==========================================
+ Coverage 76.13% 76.90% +0.77%
==========================================
Files 29 29
Lines 1697 1706 +9
==========================================
+ Hits 1292 1312 +20
+ Misses 405 394 -11
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Covers project_hermitian, sqrth_safe, invsqrth_safe, and sqrth_invsqrth_safe on NamedTensorOperator, matching the gram_eigh_full test pattern.
A square root of a bond operator is again a bond operator, so sqrth_safe, invsqrth_safe, and sqrth_invsqrth_safe now return NamedTensorOperator with the same codomain/domain as the input rather than bare named arrays.
mtfishman
enabled auto-merge (squash)
July 20, 2026 16:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds operator (
NamedTensorOperator) forms ofproject_hermitian,sqrth_safe,invsqrth_safe, andsqrth_invsqrth_safe, alongside the existinggram_eigh_fulloperator forms. The square roots return operators with the same codomain/domain as the input, since a root of an operator is again an operator.