From: Raimar S. <rai...@ui...> - 2012-02-15 11:48:45
|
Dear András, thanks for your reply. So you are saying blitzplusplus::vfmsi::fullRange could always only give me the two-particle (left or right) state vector from my DensityOperatorLow, this is why I have to use blitzplusplus::basi::fullRange. Actually, your code snippet is pretty much what I also had in mind. On a related note, would it be possible that, given a blitzplusplus::basi::Iterator with two or more retained index positions, to slice it even further? This would somehow be related to the concept that a slice of a multi-array is again a multi-array and can be sliced. On Wednesday 15 February 2012 11:53:02 Andras Vukics wrote: > This is actually rather wasteful, because even in the case when the > underlying data is just a state vector, it is treated in the same way as a > full density operator. You could maybe think about a nice general solution > to this problem (I have just added a tracker #3487814 on this issue). Yes I have noticed the tracker :). So in principle the slicing would occur in the fft function, not in the average function anymore. How would such a fft function with specialized implementation determine the type of the passed LazyDensityOperator, by dynamic_cast? > // left: > for_each(fullRange(rhotemp,Vector<0>()),bind(&ffTransform,_1,FFTDIR_KX)); > for_each(fullRange(rhotemp,Vector<1>()),bind(&ffTransform,_1,FFTDIR_KX)); > // right: > for_each(fullRange(rhotemp,Vector<2>()),bind(&ffTransform,_1,FFTDIR_XK)); > for_each(fullRange(rhotemp,Vector<3>()),bind(&ffTransform,_1,FFTDIR_XK)); > > Where Vector stands for tmptools::Vector. (This is not the only class that > works with the slice iterators, because e.g. boost::mpl::range_c also > works, but here you need this.) Wouldn't boost::mpl::range_c<int,0,1>, boost::mpl::range_c<int,1,2> etc work, although of course a bit awkward? Best regards Raimar |