qutip/qutip — pull request #31 by jrjohansson (2013-07-24 08:01:09+00:00)
Title: Flat vectors

Hi Paul, please code review this PR when you have time.

I have restructured the spmv and cy_expect in the qutip/cyQ module so that we always use 1d arrays. Before we had a mix of 1d and 2d arrays to represent vectors and several duplicated cython functions, which made things complicated when using these functions (for ex. expect_psi and expect_rho_vec) from user-defined callback functions (python function callbacks for mesolve and mcsovle, and these are also often is used with the new stochastic me and se solvers). I think it would be too confusing for end-users to know whether to use spmv or spmv1d so I wanted to unify this API. It means that we need to make sure to flatten all array representations of state vectors and density matrices used with the ODE solver etc, but we can take this internally as implemented in this PR, and end up with a cleaner API for end-users.