tehruhn / bofin

BoFiN HEOM Python version.
BSD 3-Clause "New" or "Revised" License
16 stars 11 forks source link

HSolverDL subclass for backwards compat. #7

Open nwlambert opened 3 years ago

nwlambert commented 3 years ago

Redoing this is a PR: Added a HSolverDL subclass for backwards compatibility with the old version of the solver in qutip. This should ideally mean anyone using the old solver should not be affected by the upgrades, though I did remove the stats and the renorm option.

nwlambert commented 3 years ago

Just for more info, I made a HSolverDL subclass of BosonicHEOMSolver. It accepts the same variables as the old HSolverDL in qutip, but then uses them to construct the matsubara decomposition and sends them to the standard functions in BosonicHEOMSolver. It seems to work ok (example 1a has a quick check), but I am not sure if I have done anything a bit silly in this sub-class approach, so perhaps @tehruhn or @quantshah can just take a quick look.

nwlambert commented 3 years ago

Also added pure dephasing tests for both bosonicHEOMSolver and HSolverDL. These are based on the old test alex wrote for the old HSolverDL.

nwlambert commented 3 years ago

Started on some slight modularization of both process_input() functions.

Also added a basic fermionic solver test based against the the single-impurity current solution (which was in example 4b). This is kind of clunky because it needs lots of utility functions from that example. I should just bite the bullet and include these in the heom.py

quantshah commented 3 years ago

Hi @nwlambert everything looks good. I started reviewing and also tested if I can directly make changes to the PR and push to this commit. I can do it and used the powers to update the _check_Hsys function and write some tests for it. It was not working as expected since checking the type for time-dependence as function does not work. I will continue to review/edit the changes. But overall it looks great.

nwlambert commented 3 years ago

Thanks Shahnawaz. if this inheritance stuff is ok, I might do another slight rearrangement, with a parent class containing the .run() and .steadystate() functions, and have the boson and fermion things as sub-classes, and hsolverDL as a sub-sub-class. Probably makes it easier in the long run.

hodgestar commented 3 years ago

@nwlambert @quantshah I've started merging BoFiN and this PR into QuTiP at qutip/qutip#1601. Comments and reviews there appreciated.