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
Prepare for generalized outcomes #71
Prepare for generalized outcomes #71
Conversation
…reverted is_outcomes_constant to is_n_outcomes_constant.
…es (mostly domains)
Great work on the PR Ian. Ian has made fairly reasonable arguments to me On Tue, Aug 16, 2016 at 5:53 PM, Steven Casagrande <notifications@github.com
|
Now that I'm back from travel, trying to catch up on PRs, I apologize for the delay and thank you for your wonderful contribution. |
Thanks Chris! Hopefully this won't be too painful. I'll get on it.
crosses fingers |
…or-generalized-outcomes Conflicts: .gitignore
Oh, that was actually pretty easy. The tests seem to be failing because qutip isn't being imported in one of the new tomography model tests and so what should be the qutip module is actually This PR should probably also include a guide on outcomes. I was pretty careful going through inline documentation making sure it still made sense, but it's possible some of the examples or guides need to deal with outcomes. |
@whitewhim2718 pointed out that in I'm not sure if this is the right thing to do because 3.1 is the highest official release of qutip, though it is quite old (2014). This fix is independent of travis-ci not having qutip at all. |
I think depending on QuTiP 3.2 prereleases is fine, since as you point out, it is quite old, and as the official 3.2 is scheduled to come out very soon. In particular, many of the features such as |
3 similar comments
2 similar comments
3 similar comments
Okay @cgranade, I have modified the |
3 similar comments
Wonderful, thank you so much @ihincks! I've looked over the documentation, and it all builds fine, looks great, so thank you as well for adding that. Since it all passes now, I think it's ready to merge in. Thank you again! |
This is a beefy PR addressing issue #66. The nutshell improvement is that we want experiment outcomes to be able to have fancy data types (like expparams), and to be compatible with future improvements that lift the constraint that any experiment must have a finite number of possible outcomes (this constraint comes in the form of some methods like bayes_risk enumurating over all possible outcomes).
This is handled as follows:
Domains
, not much to it, just tells you stuff like whether it's finite and is able to spit out values in the domain. This comes with obvious subclasses likeIntegerDomain
andRealDomain
.domain(self, expparam)
ofSimulateable
, returning aDomain
for every set of expparms.FiniteOutcomeModel
ofModel
which can have outcome-enumerating methodsare_expparam_dtypes_consistent
tells you if all the expparams correspond to the same datatype)Handling breaking changes:
There are two breaking changes, and they're both very easy to fix on existing models. You need to inherit from
FiniteOutcomeModel
instead ofModel
, and you need to implement thedomain
method, returning for exampleIntegerDomain(min=0, max=1)
for a two outcome model. Another thing that comes up is thatModel.pr0_to_likelihood_array
is moved toFiniteOutcomeModel.pr0_to_likelihood_array
.New Features
MultinomialModel
(which requires fancy outcome data type which is a tuple of results) which generalizesBinomialModel
.TODO
NOTES
I pulled in the feature-improved-docs because it would be confusing for me not to.