-
Notifications
You must be signed in to change notification settings - Fork 41
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 🐬 functionality #189
add 🐬 functionality #189
Conversation
Ok this is not correct yet. I will have to investigate further. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely like the ability to have this!
Just as a sidenote, I'm fine if this is not possible or we don't have the time for this yet:
Do you know if there is any way to make this consistently work with fermions? For example, what happens if we define flip
to be:
i
in codomain and!isdual
-> flipi
in codomain andisdual
-> flip + twisti
in domain and!isdual
-> flip + twisti
in domain andisdual
-> flip
I think In some sense, what I am thinking of is thatcontract
would basically become equivalent toflip
ping all contracted indices to be<bra|ket>
instead of the other way around, and then contracting. I'm just not entirely sure if this is consistent, as in that it commutes with arbitrary permutations + contractions
Also +1 on the PR title
src/tensors/indexmanipulations.jl
Outdated
end | ||
return t | ||
end | ||
flip(t::TensorMap, I) = TensorMap(t.data, flip(space(t), I)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think here it's probably best to also include a copy
keyword, similar to permute
, which can be used to control the sharing of data. At least, it's good to have this in the docstring somewhere
Ok, this turned out slightly more complicated as anticipated, because of Frobenius Schur factors. However, I think the implementation is now fixed, and includes the suggestion of @lkdvos to also include twists. I think this guarantees that if both spaces in a pair of |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #189 +/- ##
==========================================
+ Coverage 82.95% 83.16% +0.20%
==========================================
Files 42 42
Lines 5223 5257 +34
==========================================
+ Hits 4333 4372 +39
+ Misses 890 885 -5 ☔ View full report in Codecov by Sentry. |
Flipping tensor indices, for @Adwait-Naravane and @VictorVanthilt .
Be careful with fermions, as shown in the tests, simply flipping both of a pair of contracted indices does not yield the same contraction when fermions are involved.