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

define DualSector #9

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

define DualSector #9

wants to merge 10 commits into from

Conversation

ogauthe
Copy link
Collaborator

@ogauthe ogauthe commented Feb 11, 2025

This PR defines DualSector <: AbstractSector and changes the logic of dual to put it at the level of the SymmetrySector.

Linked PR with ITensor/GradedUnitRanges.jl#15, ITensor/BlockSparseArrays.jl#45, ITensor/TensorAlgebra.jl#25

@ogauthe ogauthe changed the title define Dual sector define DualSector Feb 11, 2025
@ogauthe ogauthe changed the title define DualSector define DualSector Feb 11, 2025
@ogauthe
Copy link
Collaborator Author

ogauthe commented Feb 19, 2025

I am working on replacing DualSector{SectorProduct{Sectors}} with SectorProduct{DualArguments}. I see an issue with the tricky empty case: how to define the dual of SectorProduct{Tuple{}} or SectorProduct{NamedTuple{()}}?

Of course me may have dedicated code to handle them, making an exception and defining DualSector{SectorProduct{Tuple{}}}, but this is not a satisfying solution.

@mtfishman
Copy link
Member

I am working on replacing DualSector{SectorProduct{Sectors}} with SectorProduct{DualArguments}. I see an issue with the tricky empty case: how to define the dual of SectorProduct{Tuple{}} or SectorProduct{NamedTuple{()}}?

Can't those be defined to be self-dual?

@mtfishman
Copy link
Member

mtfishman commented Feb 20, 2025

Another way to phrase the question is, what goes wrong if you define dual(::SectorProduct{NamedTuple{()}}) = SectorProduct((;))? I could imagine a few places where that might cause some trouble but I'm curious if we can work through those with good generic code patterns.

@mtfishman
Copy link
Member

One way to view this particular issue is in a broader context that we have a few self-dual objects, such as TrivialSector, non-graded unit ranges, and empty SectorProduct. So, from that perspective we could lump all of those cases together and decide how we want to define isdual for those cases.

In ITensors.jl, we use "arrow directions" as the analog of duality information, and we have three options (captured by an enum), In, Out, and Neither. Neither is used when the space doesn't have any symmetry sectors. We could consider a similar strategy, which would mean in cases where objects are self-dual we have a third choice for isdual besides true or false, for example missing or nothing.

@ogauthe ogauthe marked this pull request as draft February 27, 2025 16:17
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