#10683 closed enhancement (fixed)
Hermitian inner product
Reported by: | rbeezer | Owned by: | jason, was |
---|---|---|---|
Priority: | minor | Milestone: | sage-4.7 |
Component: | linear algebra | Keywords: | |
Cc: | Merged in: | sage-4.7.alpha4 | |
Authors: | Rob Beezer | Reviewers: | Karl-Dieter Crisman |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
One patch adds the Hermitian inner product, by that name, for use with vectors over the complex numbers.
Second patch is totally doctests, no code changes. Explains, expands, and cross-references the dot product, inner product, Hermitian inner product and vector norm.
Depends on:
Apply:
Attachments (5)
Change History (16)
Changed 10 years ago by
Changed 10 years ago by
comment:1 Changed 10 years ago by
- Status changed from new to needs_review
comment:2 Changed 10 years ago by
comment:3 Changed 10 years ago by
- Description modified (diff)
After working with this for a while, I though it better to build off the dot product, rather than the inner product with its custom inner product matrices, due to the havoc that could result by specifying a matrix without the necessary properties for certain algorithms to run properly.
v2 series reflects this change. On 4.6.2.alpha4 depends only on #10536 now.
comment:4 Changed 10 years ago by
- Description modified (diff)
comment:5 follow-up: ↓ 6 Changed 10 years ago by
- Reviewers set to Karl-Dieter Crisman
- Status changed from needs_review to needs_info
This is really good. Docs are fine, excellent examples. I could barely think of anything to test.
sage: k.<b> = FiniteField(9); k Finite Field in b of size 3^2 sage: vector([1,1]).hermitian_inner_product(vector(k,[1,b])) b + 1 sage: vector([1,i]).hermitian_inner_product(vector(k,[1,b])) --------------------------------------------------------------------------- ArithmeticError:
Which is a little obscure, especially if this were buried in other code. Of course,
sage: vector([1,i]).dot_product(vector(k,[1,b])) --------------------------------------------------------------------------- ArithmeticError:
So I don't know whether this is a reason to deny positive review. What do you think? Separate ticket, or fix here?
comment:6 in reply to: ↑ 5 Changed 10 years ago by
- Status changed from needs_info to needs_review
Replying to kcrisman:
So I don't know whether this is a reason to deny positive review. What do you think? Separate ticket, or fix here?
This routine is an extension of the idea of a dot product. So I'd say the dot product is broken and needs to be more careful about mixing the two base rings. Maybe it should check compatibility, and if there is no conflict, then go on its way. If there is a conflict, the vectors should be converted to a common base ring, then do the dot product. If that does not work, then the routine should fail gracefully.
So I'd like that to be on another ticket. If you make the ticket and cc me, then I'll put it on my list for SD 29 next week, and coordinate with this ticket, if necessary. But I'd like to see this go in pretty much as-is and let improvements to the "plain" dot product improve this routine from outside.
Thanks, Rob
comment:7 Changed 10 years ago by
- Status changed from needs_review to positive_review
See #10960 - it's really a problem for multiplication in general, not the dot or Hermitian product, as it turns out, so definitely a different ticket is needed.
Positive review!
comment:8 Changed 10 years ago by
- Status changed from positive_review to needs_work
This needs to be rebased to sage-4.7.alpha3:
applying /scratch/jdemeyer/merger/downloads/trac_10683-hermitian_inner_product-v2.patch patching file sage/modules/free_module_element.pyx Hunk #1 FAILED at 2126 1 out of 1 hunks FAILED -- saving rejects to file sage/modules/free_module_element.pyx.rej abort: patch failed to apply
Changed 10 years ago by
comment:9 Changed 10 years ago by
- Description modified (diff)
- Status changed from needs_work to positive_review
v3 patch is a trivial rebase, no changes. Just didn't match up with surrounding routines. So I have sent this back to positive review (and made the depends/apply block look really pretty).
comment:10 Changed 10 years ago by
- Merged in set to sage-4.7.alpha4
- Resolution set to fixed
- Status changed from positive_review to closed
comment:11 Changed 10 years ago by
Feeding the patchbot:
Depends on #10536
Apply: trac_10683-hermitian_inner_product-v3.patch, trac_10683-vector-products-docs-v2.patch
Apply patches in order given here:
Apply: trac_10683-hermitian_inner_product.patch
Apply: trac_10683-vector-products-docs.patch