Skip to content

add rrule for flip#241

Merged
Jutho merged 3 commits intoQuantumKitHub:masterfrom
sanderdemeyer:rrule-for-flips
Apr 15, 2025
Merged

add rrule for flip#241
Jutho merged 3 commits intoQuantumKitHub:masterfrom
sanderdemeyer:rrule-for-flips

Conversation

@sanderdemeyer
Copy link
Copy Markdown
Contributor

This implements the rrule for the function flip().

@lkdvos
Copy link
Copy Markdown
Member

lkdvos commented Apr 14, 2025

@Jutho
Copy link
Copy Markdown
Member

Jutho commented Apr 14, 2025

It turns out that this is not the right rrule, because flip is not an involution, i.e. it is not its own inverse. More specifically, the inverse of flip is flipping the index 3 times (for fermions). Probably we want to have an associated unflip function? I will make some changes to this PR to make this happen.

@lkdvos
Copy link
Copy Markdown
Member

lkdvos commented Apr 14, 2025

That sounds ... honestly scary 😬 It might be good to add a note of this in the docstring, since this is definitely something I would have wrongly assumed.

Possibly we could mimick the twist function and add an inv keyword?

@Jutho
Copy link
Copy Markdown
Member

Jutho commented Apr 14, 2025

It essentially amounts to saying that flipping twice corresponds exactly to how you get the Frobenius-Schur indicator, which is ±1.

An inv keyword is probably the better option indeed.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.65%. Comparing base (ed09f13) to head (658d75a).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #241      +/-   ##
==========================================
+ Coverage   82.61%   82.65%   +0.04%     
==========================================
  Files          43       43              
  Lines        5579     5593      +14     
==========================================
+ Hits         4609     4623      +14     
  Misses        970      970              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Jutho
Copy link
Copy Markdown
Member

Jutho commented Apr 15, 2025

The failures are again related to ChainRulesTestUtils on Julia nightly (Julia 1.13). I checked at my own machine weather everything works on beta (Julia 1.12), and there everything seems fine, so I think this is good to go, unless there are further comments.

Copy link
Copy Markdown
Member

@lkdvos lkdvos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a small note about spelling, otherwise looks good to me!

Comment thread src/tensors/indexmanipulations.jl Outdated
fix spelling mistake

Co-authored-by: Lukas Devos <ldevos98@gmail.com>
@Jutho
Copy link
Copy Markdown
Member

Jutho commented Apr 15, 2025

Great catch; I don't think we need another CI run for this so I will merge. (BTW: copilot completion also thought involutive, but I think that is wrong).

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.

3 participants