for a_state_vector in state_vectors: do some operation on a_state_vector
For a set of StateVector in a StateVectors object.
But currently that doesn't work - you get an array of each state vector element for all 'particles'. To get an individual state vector you need to do for a_state_vector in state vectors.T: and then cast a_state_vector to the StateVector type.
Could/should we overwrite the __iter__() method in StateVectors so it does the sensible thing of running through the state vectors by default?
You may wish to do:
for a_state_vector in state_vectors: do some operation on a_state_vector
For a set of
StateVector
in aStateVectors
object.But currently that doesn't work - you get an array of each state vector element for all 'particles'. To get an individual state vector you need to do
for a_state_vector in state vectors.T:
and then casta_state_vector
to theStateVector
type.Could/should we overwrite the
__iter__()
method inStateVectors
so it does the sensible thing of running through the state vectors by default?