4 #ifndef CPPQEDCORE_QUANTUMDATA_STATEVECTOR_H_INCLUDED
5 #define CPPQEDCORE_QUANTUMDATA_STATEVECTOR_H_INCLUDED
7 #include "StateVectorFwd.h"
9 #include "DensityOperatorFwd.h"
32 template<
int RANK1,
int RANK2>
35 const StateVector<RANK1+RANK2>
36 operator*(
const StateVector<RANK1>&,
const StateVector<RANK2>&);
42 braket(
const StateVector<RANK>&,
const StateVector<RANK>&);
64 static const int N_RANK=RANK;
88 StateVector(
const StateVectorLow& psi, ByReference) : LDO_Base(psi.shape()), ABase(psi) {}
90 explicit StateVector(
const Dimensions&,
bool init=
true);
113 template<
typename OTHER>
119 template<
typename... SubscriptPack>
122 template<
typename... SubscriptPack>
140 const DensityOperatorLow
dyad( )
const {
return dyad(*
this);}
161 template<
typename OTHER>
164 template<
typename OTHER>
165 StateVector& operator/=(
const OTHER& dc) {ABase::operator/=(dc);
return *
this;}
169 void debug()
const {std::cerr<<
"Debug: "<<getArray()<<std::endl;}
173 const dcomp index(
const Idx& i,
const Idx& j)
const override {
return getArray()(i)*conj(getArray()(j));}
175 double trace_v()
const override {
return norm();}
180 template<
int RANK1,
int RANK2>
182 const StateVector<RANK1+RANK2>
191 #endif // CPPQEDCORE_QUANTUMDATA_STATEVECTOR_H_INCLUDED
const DensityOperatorLow dyad() const
dyad with the object itself
StateVector & operator=(const StateVector &sv)
Assignment with by-value semantics.
Comprises the common functionalities of StateVector and DensityOperator.
Defines class of the same name.
Basically only a metafunction defining types for higher-level constructs of arity RANK ...
ArrayBase & operator=(const ArrayLow &arrayLow)
Assignment with by-value semantics (like the assignment of a blitz::Array).
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.
Density operator of arbitrary arity.
StateVector & operator=(const OTHER &other)
Mixed-mode assignment with by-value semantics.
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 StateVector operator-() const
involves a deep-copy
Defines class of the same name.
Defines class of the same name.
const dcomp & operator()(int s0, SubscriptPack...subscriptPack) const
Multi-array style subscription.
double frobeniusNorm() const
The entrywise array norm.
const dcomp braket(const StateVector< RANK > &, const StateVector< RANK > &)
Calculates the inner product, relying on StateVector::vectorView.
StateVector & operator*=(const OTHER &dc)
Defines class of the same name.
Common interface for calculating quantum averages.
Base::Dimensions Dimensions
Inherited from DimensionsBookkeeper.
double norm() const
Returns the norm .
const Dimensions & getDimensions() const
Get the Dimensions vector.
dcomp & operator()(int s0, SubscriptPack...subscriptPack)
”
StateVector(const StateVectorLow &psi, ByReference)
Constructs the class in such a way that the underlying data reference the same data as psi...
std::complex< double > dcomp
Double-precision complex number.
void addTo(DensityOperator< RANK > &densityOperator) const
Adds a dyad of the present object to densityOperator
Operator aggregate for a complex vector space built on top of Boost.Operator.
CArray< RANK > ArrayLow
The underlying storage.
double renorm()
” and also renormalises
const StateVector operator+() const
simply deep copy
Extensions built on top of Boost.Operator.