Simple multifusion example for testing#14
Conversation
Codecov ReportAttention: Patch coverage is
🚀 New features to boost your workflow:
|
|
For now I'll let |
lkdvos
left a comment
There was a problem hiding this comment.
I'm a bit on the fence about the current implementation.
It seems to me like the CatType is definitely a bit convoluted for this simple case, and given that this doesn't generalize very well either I think this is code complexity that doesn't help too much (which is a liability for maintenance in the long term...)
I also don't think the show is a very good argument, I honestly don't think this is all that legible anyways.
I might feel a row and col are a bit clearer too, since that makes it very explicit what "colors" are allowed.
On the other hand, I also don't want to (or want you to) have to spend too much time refactoring this either, if it works then why not.
For testing purposes, it might make sense to just simplify this and use the IsingAnyon equivalence a bit more thoroughly, with the correct limitations of erroring for the functions that should. For example, we could simply store an IsingAnyon + Bool flag to indicate either C,M or D,Mop as well.
Ultimately, I guess the main purpose is to have a sector that errors whenever you do an operation that isn't allowed, just to check that TensorKit is compatible with that. Therefore, I would want this to be as minimal as possible, since we won't really be using that for anything else (?) and I don't want to deal with maintaining that code.
|
Apparently, I'm testing the custom 3-argument julia> Mop = IsingBimod(2,1,0)
julia> @test eval(Meta.parse(sprint(show, Mop))) == "ℳᵒᵖ[0]"
Test Failed at REPL[46]:1
Expression: eval(Meta.parse(sprint(show, Mop))) == "ℳᵒᵖ[0]"
Evaluated: IsingBimod(2, 1, 0) == "ℳᵒᵖ[0]"Also, formatting remains an issue |
|
The goal of my suggestions is to get rid of |
|
I made some formatting changes and simplified the sorting, the only thing I'm still not sure about is the printing. Honestly, I think |
lkdvos
left a comment
There was a problem hiding this comment.
I'll merge this and tag it as soon as the final round of tests pass. Thanks for working through the details, I think it looks very clean and maintainable now.
In light of the discussion at QuantumKitHub/TensorKit.jl#247, this PR implements the multifusion category$$\mathsf{Rep} Z_2 \oplus \mathsf{Rep} Z_2 \cong \mathsf{IsingAnyon}$$ to allow for testing the proposed fusion tree manipulations changes. Since MultiTensorKit itself relies on TensorKit, this example had to be worked out in TensorKitSectors.
Since the main purpose is for testing, I may have cut some corners. In particular:
CatTypetype is quite messy, in the sense that I had to export some cursive letters so that parsability was guaranteed. I could changeCatTypeto take on integer values, and then remove the customBase.show. I cut this corner somewhat because I assumed no-one would actually use this category in TensorKit without MultiTensorKit, but I am also contradicting myself by actually exporting these.Nsymbolfunction is not as clean as in MultiTensorKit, because I didn't want to effectively work with the same struct design asBimoduleSector, namely 3 integers to uniquely specify an object.IsingAnyon, I didn't bother with the unitarity, pentagon and hexagon tests.SectorValuesproperties, but the ordering of the objects is irrelevant to the properties of the multifusion category. Maybe I'm looking too much into this from the maths perspective, since this is probably just a programming thing.Let me know which aspects I shouldn't have neglected.