-
Notifications
You must be signed in to change notification settings - Fork 13
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
Refactor indexing #230
base: master
Are you sure you want to change the base?
Refactor indexing #230
Conversation
Little update on the status here: derivation of equations, averaging and the cumulant expansion all work so far. I haven't checked the results in detail, but the equations look okay. I'll check that by comparing to a "brute-force" approach later, when I can actually get a numerical solution out. The next step would be to implement A couple of things I've learned so far:
Some other notes, that can be addressed in a follow-up PR:
@ChristophHotter anything you'd like to add here? |
That sounds very good, nice!
|
This lays the foundation for refactoring the entire indexing implementation. The basic idea is one we already discussed in the very beginning. Essentially, we want to use the following commutation relation for indexed bosonic operators
Similarly, for transition operators, we have
The problem here is the fact that the original product of transition operators on the left-hand side appears again on the right-hand side. This can potentially lead to infinite recursion. Currently, the solution to this problem is to store the fact that in the latter product$r \neq s$ on any sum expression that may occur. This has other problems, mostly the complex implementation and handling all kinds of special cases.
Instead, here I propose to implement the commutation relations using the above relations directly. To prevent infinite recursion on the transition operators, we store an additional field on indexed operators called
merge_events
, which is just aVector{UUID}
. Whenever two indexed transitions get rewritten according to the above, we generate a random UUID, currently usingUUIDs.uuid4()
, and store that on two copies of the original transition operators. Therefore, the operators behave just as they should when multiplied together with other operators, except when we find a shared UUID in themerge_events
. That can only occur when a product of indexed transitions was returned from the*
implementation and thus they have already been merged.To ensure that in products involving three or more indexed transitions, we also sort by the length of the
merge_events
vector.Since this needs to be a full rewrite, I'm opening this as a draft until we add back all the features. If we don't complete the rewrite within this PR, it at least serves as documentation of the fundamental concept, which seems to work.
Feature list:
FYI, @ChristophHotter and @j-moser