-
Notifications
You must be signed in to change notification settings - Fork 108
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
return_problem keyword added to QuantumOptics integrators #413
base: master
Are you sure you want to change the base?
Conversation
Hi, Henry! Thanks for the contribution! A few minor stylistic things to get out of the way before a real review:
This pull request also seems to be related to the following issue: #298 |
I know that this is frustrating to hear, but I would also be reluctant to merge this with all of the formatting changes. They might be for the better, and it kinda makes sense to run JuliaFormatter and enforce it in future pull requests, but that should be done in a separate single-purpose pull request, otherwise reviewing would be too difficult and using |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #413 +/- ##
==========================================
- Coverage 97.03% 96.61% -0.43%
==========================================
Files 18 19 +1
Lines 1554 1686 +132
==========================================
+ Hits 1508 1629 +121
- Misses 46 57 +11 ☔ View full report in Codecov by Sentry. |
Ok, I will go back and incorporate all your comments. Remove the toml, get rid of the formating changes, switch the dict to using string keys to one using symbols, and fix the two lines missing in the code coverage. The one thing that concerns me is the "I think it would be more idiomatic to have |
To your last question, I do suspect I am missing something. My original thinking was that making something like Another minor point is that |
Currently, I only need to modify the functions integrate, integrate_stoch, and integrate_mcwf, because the functions that call them already pass all kwargs through to them. If I do what you are proposing, I will need to change the body of stochastic.schroedinger, stochastic.schroedinger_dynamic, stochastic.master, stochastic.master_dynamic, etc. I agree that it is in the end a cleaner way of programing it, but is just going to be a lot of edits. Again, I am willing to do it, but wanted to discuss it before hand to make sure it's not going to go to waist. As for the NameTuple suggestion, noted. I had not used that before. I think you still want the NamedTuple in this case because you want to know what QuantumOptics' default solver arguments would have been. It's useful if you're trying to compair different runs. Also makes writing the tests simipler. |
@@ -322,14 +322,15 @@ Integrate a single Monte Carlo wave function trajectory. | |||
* `kwargs`: Further arguments are passed on to the ode solver. | |||
""" | |||
function integrate_mcwf(dmcwf::T, jumpfun::J, tspan, | |||
psi0, seed, fout; |
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 can't get the formatting to match here may be a tab vs spaces thing
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.
the diff tool gets confused occasionally -- this probably will be resolved when we squash
Thanks for proceeding with the changes! Below I try to answer the questions you have raised and I also try to give a few git tips that might make your work easier (you might already know some or all of them, but I am posting just in case). Named tuple containing configuration options or solver kwargs makes sense. In particular, it would be nice if it can be structured in a way where the named tuple (or an entry in that tuple) can be directly destructured. E.g. for a function I would suggest trying it out just for one of the solvers for now just to make sure we are both happy with the approach and amount of work involved. After you explained which functions you are currently changing, I noticed another issue: the current version of this pull request is modifying private functions. On its own, that is fine, but if the point is to make this generally available to all users, these functions need to be made part of the public API -- however they were never meant to be user facing, rather only an internal implementation detail (that we probably want to remove when the broadcasing interface improvements by @apkille land). E.g. currently we have this: Concerning git workflow: I noticed you were undoing some of the changes in a somewhat manual fashion. Of course, you should do it in whatever way is most convenient for you, but you might be interested in the following options:
|
@henhen724 #404 and qojulia/QuantumOpticsBase.jl#172 are also good PRs to look at, they contain a lot of examples. You can create |
Hi there! I will mark this as a draft, just to make it easier to manage my review queue. Please do not hesitate to ping us if there is anything we can help with on this PR. |
This feature allows you to make any QuantumOptics solver return the SciML problem rather than trying to solve the problem immediately. This allows end users to more easily incorporate QuantumOptics with other SciML packages and features.
Here is a simple example of how to use it:
Sorry about all formatting changes my VSCode did that automatically.