4 #ifndef CPPQEDCORE_QUANTUMDATA_NONORTHOGONALSTATEVECTOR_H_INCLUDED
5 #define CPPQEDCORE_QUANTUMDATA_NONORTHOGONALSTATEVECTOR_H_INCLUDED
7 #include "NonOrthogonalStateVectorFwd.h"
11 #include "Transformation.h"
17 template<
int RANK,
typename TRAFO>
26 typedef typename Base::StateVectorLow StateVectorLow;
27 typedef typename Base::DensityOperatorLow DensityOperatorLow;
29 typedef typename Base::Idx
Idx;
32 typedef transformation::Traits<Trafo> TrafoTraits;
37 : Base(psi,byReference), dual_(psi.shape()), transformation_(tf){}
40 const Trafo& tf,
bool init=
true)
41 : Base(dimensions, init), dual_(dimensions), transformation_(tf){}
44 : Base(sv), dual_(sv().shape()),
45 transformation_(sv.getTrafo()){}
51 const StateVectorLow& dual()
const {
return dual_;};
52 const Trafo& getTrafo()
const {
return transformation_;}
54 template<
typename OTHER>
65 template<
typename OTHER>
68 template<
typename OTHER>
71 void addTo(NonOrthogonalDensityOperator<RANK>&)
const;
74 mutable StateVectorLow dual_;
76 const Trafo transformation_;
82 template<
typename SV1,
typename SV2>
83 struct TensorType : mpl::identity<NonOrthogonalStateVector<SV1::N_RANK+SV2::N_RANK,
84 typename transformation::Compose<typename SV1::Trafo,
85 typename SV2::Trafo>::type> >
91 template<
typename SV1,
int RANK2>
93 : mpl::identity<NonOrthogonalStateVector<SV1::N_RANK+RANK2,
94 typename transformation::Compose<typename SV1::Trafo,
95 transformation::Identity<RANK2> >::type> >
100 template<
int RANK1,
typename SV2>
102 : mpl::identity<NonOrthogonalStateVector<RANK1+SV2::N_RANK,
103 typename transformation::Compose<transformation::Identity<RANK1>,
104 typename SV2::Trafo>::type> >
111 #define RETURN_typeKERNEL transformation::Compose<TRAFO1,TRAFO2>
112 #define RETURN_type NonOrthogonalStateVector<RANK1+RANK2,typename RETURN_typeKERNEL::type>
115 template<
int RANK1,
typename TRAFO1,
int RANK2,
typename TRAFO2>
118 operator*(
const NonOrthogonalStateVector<RANK1,TRAFO1>& sv1,
const NonOrthogonalStateVector<RANK2,TRAFO2>& sv2)
121 return RETURN_type(doDirect<dodirect::multiplication>(sv1(),sv2()),RETURN_typeKERNEL::compose(sv1.getTrafo(),sv2.getTrafo()),byReference);
124 #undef RETURN_typeKERNEL
126 #define RETURN_typeKERNEL transformation::Compose<TRAFO1,transformation::Identity<RANK2> >
128 template<
int RANK1,
typename TRAFO1,
int RANK2>
131 operator*(
const NonOrthogonalStateVector<RANK1,TRAFO1>& sv1,
const StateVector<RANK2>& sv2)
134 return RETURN_type(doDirect<dodirect::multiplication>(sv1(),sv2()),RETURN_typeKERNEL::compose(sv1.getTrafo(),transformation::Identity<RANK2>()),byReference);
137 #undef RETURN_typeKERNEL
139 #define RETURN_typeKERNEL transformation::Compose<transformation::Identity<RANK1>,TRAFO2>
141 template<
int RANK1,
int RANK2,
typename TRAFO2>
144 operator*(
const StateVector<RANK1>& sv1,
const NonOrthogonalStateVector<RANK2,TRAFO2>& sv2)
147 return RETURN_type(doDirect<dodirect::multiplication>(sv1(),sv2()),RETURN_typeKERNEL::compose(transformation::Identity<RANK1>(),sv2.getTrafo()),byReference);
151 #undef RETURN_typeKERNEL
156 #endif // CPPQEDCORE_QUANTUMDATA_NONORTHOGONALSTATEVECTOR_H_INCLUDED
Comprises classes representing the state of composite quantum systems and providing various interface...
const CVector vectorView() const
1d view created on the fly via blitzplusplus::unaryArray.
quantumdata::StateVector< 1 > StateVector
unary StateVector
State vector of arbitrary arity.
IdxTiny< RANK > Idx
The type used for indexing the “rows” and the “columns”: a tiny vector of integers (multi-index) ...
const dcomp & operator()(int s0, SubscriptPack...subscriptPack) const
Multi-array style subscription.
StateVector & operator*=(const OTHER &dc)
Defines class of the same name.
Base::Dimensions Dimensions
Inherited from DimensionsBookkeeper.
Defines class of the same name.
ExtTiny< RANK > Dimensions
The dimensions as a static vector of size N_RANK.
Operator aggregate for a complex vector space built on top of Boost.Operator.
Comprises our own extensions to Blitz++.
size_t getTotalDimension() const
Get the total dimension of a system of arbitrary arity.