Add fusionproduct
Adds a non-unicode alternative to \otimes for sectors: fusionproduct.
Fixes #108 .
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 81.40%. Comparing base (
726c044) to head (f367a3e).
Additional details and impacted files
@@ Coverage Diff @@
## master #109 +/- ##
=======================================
Coverage 81.40% 81.40%
=======================================
Files 42 42
Lines 5565 5565
=======================================
Hits 4530 4530
Misses 1035 1035
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Probably needs some coverage :-). I am also wondering whether it is not better to really just have a unicode alternative to \otimes, that does not depend on the argument types (which is probably what you had suggested at first). Otherwise, we further complicate the interface. I would be fine with, otimes, tensorproduct, tensorprod. In TensorCore.jl, they simply call this tensor, but this is maybe a bit confusing (although one does read it like "a tensor b").
I definitely also prefer having a fixed unicode alternative for this. It also creates less confusion when implementing the interface, as with the current implementation you would have to implement \otimes and not fusionproduct.
I do think tensor might be confusing, so I would vote otimes, and then use const ⊗ = otimes.
Ok sounds good. However, I would keep using the actual unicode in all of the method definitions; I do like it more than the ascii otimes.
I'll implement when I find some time.
Just for completeness: I double-checked and the alias thing works how you would expect: they are completely equivalent and defining methods for either implements them for both, so we can definitely just keep using the unicode everywhere.
julia> otimes(a, b) = a * b
otimes (generic function with 1 method)
julia> const ⊗ = otimes
otimes (generic function with 1 method)
julia> ⊗(a::Int, b::Int) = 2 * a * b
otimes (generic function with 2 methods)
julia> otimes(1, 2)
4
julia> ⊗(1, 2)
4
julia> 1 ⊗ 2
4
julia> ⊗(1.0, 2.0)
2.0
I implemented the changes, and in the meantime also added a non-unicode alternative for oplus. As these are now true aliases, I don't think I need to add coverage?