-
Notifications
You must be signed in to change notification settings - Fork 34
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
Occupations interface #160
Conversation
Also this PR introduces (as an example of the interface and for performance reasons) fermion states as bitstrings. This introduces up to 5x speedup in operator creation (below - 36 modes, 4 fermions)
|
Thanks, Alexander, this is great! Sorry for the slow response, it is end of the semester and we are a bit short staffed. I will try to review this in the next couple of days. |
It's OK, I understand, I also have end of semester now :) This was the last-est commit before review, had to unify the interface for |
Sorry for the long wait on review! This is awesome, thank you for taking the time to implement it. Looking through it, I do not see anything that raises any flags for me. I added a commit to bump the version number. When the tests pass I will merge and make a release. I will make a new issue to track:
|
This PR extends #157 by providing a more thought-out occupations interface. It also fixes the #102 issue, because the statistics is now stored in the occupations object.
To implement the occupations interface, one must implement these methods for the object:
==
andisless
Vector{Int}
, akaconvert(::Type{YourType}, v::AbstractVector)
so thatbasisstate
could work normallyQuantumOpticsBase.state_transition!(buffer, occ, at_inds, a_inds)
for transition coefficientssimilar
(if mutable) orQuantumOpticsBase.allocate_buffer
(if immutable) for allocating a bufferMaybe this should be documented for someone who needs, for example, anyon statistics or extra performance?