[Breaking] UnitStyle, allunits and a bunch of renaming#25
Conversation
|
Tests fail because |
lkdvos
left a comment
There was a problem hiding this comment.
I'm not so sure it makes sense to have the same distinction as for the FusionStyle, since really the only distinction we care for currently is whether or not the unit is simple. I think I would suggest
abstract type MultiFusionStyle end
struct SimpleMultiFusion <: MultiFusionStyle end
struct GenericMultiFusion <: MultiFusionStyle endwhere the former denotes a simple unit, and the latter everything else.
Similarly, I don't think this should be defined as a replacement of FusionStyle, or have any interplay with that at all, since that really only says something about the output of otimes(a, b), and how many times these appear, so I'd definitely keep that for IsingBimodule.
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
|
There is a little bit of interplay in the sense that the multifusion case can never be |
|
I think strictly that fusion categories aren't multifusion ones, so in principle |
|
I want to propose something a bit radical, which is that we adopt the name
The new trait could simply be called abstract type UnitStyle end
struct SimpleUnit <: UnitStyle end # ordinary fusion category
struct GenericUnit <: UnitStyle end # multifusion categoryWhile I recognize that this is a large breaking change for TensorKitSectors.jl, I am not sure that the downstream effects would be that large. TensorKit.jl would need to make a few small Finally, TensorKit should have an intrinsically named method to replace |
|
I can definitely see the arguments for this, and I agree that it is nice to be a bit more consistent internally about when we do and do not incorporate the I don't think this is really what you are suggesting, but I would be opposed to dropping these Base overloads altogether. While it is definitely nice to be correct and consistent, the number one complaint I hear about TensorKit is that it requires too much knowledge that is irrelevant to typical usecases. Having I do want to say that all of these changes are very much breaking, as SUNRepresentations and CategoryData and GroupData and SymmetricGroupRepresentations all have to be updated to reflect this change since they have to implement the intrinsic functions, not the overloads. TensorKit also has to be updated for this, and I do think we are making use of this in both MPSKit and PEPSKit as well. I'm not against breaking changes, but I do want to mention that this is quite a big change just to be more correct about naming things, where most of the users probably don't even have the background to see why this is more correct because this doesn't relate to things they are using. |
Well, actually, I had clearly myself forgotten, since at the level of sectors, For spaces, on the other hand, that is a very different situation. There I am definitely not suggesting to remove the
Oh yes, when I said, not that breaking, I should have clarified that I meant this from the perspective of the user (of which there are hopefully ever more), exactly for the reason of above: I don't know if they need to manipulate sectors often (but I don't mind being corrected). On the developer side, this whole suggestion is of course very much breaking throughout the several levels of packages in our ecosystem 😄 . |
|
I'm not sure if what I've changed up till now is breaking or not. If so, depending on whether we rename or not, I might need to revert a bunch of changes. |
lkdvos
left a comment
There was a problem hiding this comment.
I left some small comments, but otherwise looks like a great PR. Can you also bump the version, since this is definitely breaking?
src/sectors.jl
Outdated
| allunits(::Type{TimeReversed{I}}) where {I <: Sector} = SectorSet{TimeReversed{I}}(TimeReversed{I}, allunits(I)) | ||
| dual(c::TimeReversed{I}) where {I <: Sector} = TimeReversed{I}(dual(c.a)) | ||
| function ⊗(c1::TimeReversed{I}, c2::TimeReversed{I}) where {I <: Sector} | ||
| return Iterators.map(TimeReversed{I}, c1.a ⊗ c2.a) |
|
While implementing |
|
Definitely fine by me, I think that also doesn't even qualify as breaking, since fields are typically assumed internal |
|
+1 for |
|
I added one more comment/request. Otherwise this is good to go for me. |
b4c4477 to
881cbe7
Compare
|
Ok, this looks great. Thanks @borisdevos . I know we suggested to start with this "small" PR that would be easy and quickly merged a few weeks ago, and it turned out a bit bigger than that. But the result is really nice. |
alloneswill return all units of some sector, which is useful for multifusion cats where there are multiple.MultiFusionStylewill aid us where needed in specialising to multifusion cases within TensorKit. I added also its interplay withFusionStyle, but this is completely untested. It's untested even within the multifusion case, as in I've yet to take any product sector involving a multifusion sector.A question is if we should have aliases combining e.g.
UniqueFusionandUniqueMultiFusion, since there are some specialties for e.g. abelian groups which otherwise go throughGenericFusioncode. Coming up with a name is then hard as usual 😄. This works, so it might be overkill.