Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sectorscalartype #146

Merged
merged 4 commits into from
Sep 2, 2024
Merged

Add sectorscalartype #146

merged 4 commits into from
Sep 2, 2024

Conversation

lkdvos
Copy link
Collaborator

@lkdvos lkdvos commented Aug 23, 2024

This is a minor change that centralizes the determination of the eltype of the topological data.
This simplifies some of the fusion tree manipulations, as it makes it easier to determine the output type.

Additionally, this also provides a hook for types that don't necessarily want to have Fsymbol(one(I), one(I),....), either because it is not efficient, or because one(I) is hard to determine (multi-fusion stuff).

Finally, it could also provide a starting point for having sectors with different eltypes, as one could imagine wanting SU2 symbols with BigFloat precision etc.

I tried to not change too much, but left a couple comments in the code about things I am unsure about. We should probably also discuss the fusion tree manipulations constructions, as the @isdefined construction might not be necessary now. I don't know if this has performance implications (either on the compiler or at runtime), but it might just be slightly more readible as well.

Copy link

codecov bot commented Aug 23, 2024

Codecov Report

Attention: Patch coverage is 93.75000% with 1 line in your changes missing coverage. Please review.

Project coverage is 79.95%. Comparing base (54f2672) to head (d0d49eb).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/fusiontrees/manipulations.jl 93.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #146      +/-   ##
==========================================
- Coverage   79.97%   79.95%   -0.02%     
==========================================
  Files          42       42              
  Lines        4983     4974       -9     
==========================================
- Hits         3985     3977       -8     
+ Misses        998      997       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Jutho
Copy link
Owner

Jutho commented Aug 28, 2024

This is a good approach to eliminate all my one(I) calls, which will indeed be necessary for multifusion stuff. I am not quite sold yet on the Feltype and Reltype name. Unlike Fsymbol and Rsymbol, I feel like pronouncing this is Fel-type and Rel-type. Maybe Fscalartype and Rscalartype suffer less from this?

@lkdvos lkdvos changed the title Add Feltype and Reltype Add sectorscalartype Aug 30, 2024
@lkdvos
Copy link
Collaborator Author

lkdvos commented Aug 30, 2024

As discussed, I now replaced everything with just a unified sectorscalartype. I started going through removing the @isdefined calls, but actually it is not that elegant, as the SingletonDicts don't really support pre-initializing the dictionary. I think it really is better to just leave them for now.

If tests turn green, this is good to go for me.

@Jutho
Copy link
Owner

Jutho commented Aug 30, 2024

I am wondering to what extent it would be an abomination to replace sectorscalartype(somesectortype) with simply scalartype(somesectortype)? It is not really a correct application of method overloading, as it is definitely changing the way/meaning of scalartype from its original intention. But sectorscalartype(somesectortype) sounds like overkill.

@lkdvos
Copy link
Collaborator Author

lkdvos commented Aug 31, 2024

I have to admit that this also crossed my mind, however I was a bit worried about something like a vector of sectors which suddenly has scalartype Float64, and then the default definition of zerovector might return a vector of floats (although I did not test if this is actually the case).
In the end, it doesn't matter too much, I don't think many external users would use this, so maybe we shouldn't even export it

@Jutho
Copy link
Owner

Jutho commented Sep 2, 2024

Yes you are right that this will cause unforeseen problems further on. By lack of a better suggestion I will merge as is.

@Jutho Jutho merged commit d2010c1 into master Sep 2, 2024
13 of 14 checks passed
@lkdvos lkdvos deleted the ld-eltypes branch September 2, 2024 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants