C++QEDCore  2.100.2 (v2 Milestone 10 Development branch)
a framework for simulating open quantum dynamics – core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Sigma.h
Go to the documentation of this file.
1 // Copyright András Vukics 2006–2014. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.txt)
2 // -*- C++ -*-
4 #ifndef CPPQEDCORE_QUANTUMOPERATOR_SIGMA_H_INCLUDED
5 #define CPPQEDCORE_QUANTUMOPERATOR_SIGMA_H_INCLUDED
6 
7 #include "SigmaFwd.h"
8 
9 #include "Types.h"
10 
11 
12 namespace quantumoperator {
13 
15 
23 template<int L, int R, typename OTHER>
24 const DirectProduct<L,R,OTHER,true >
25 operator*(const Sigma<L,R>&, const OTHER&);
26 
27 
29 
37 template<int L, int R, typename OTHER>
38 const DirectProduct<L,R,OTHER,false>
39 operator*(const OTHER&, const Sigma<L,R>&);
40 
42 template<int L1, int R1, int L2, int R2>
43 const DirectProduct<L1,R1,Sigma<L2,R2>,true>
44 operator*(const Sigma<L1,R1>&, const Sigma<L2,R2>&);
45 
46 
48 
53 template<int L, int R>
54 class Sigma
55 {
56 public:
57  static const int N_RANK=1;
58 
59  typedef quantumdata::Types<1>::StateVectorLow StateVectorLow;
60 
62  void
63  apply(const StateVectorLow& psi, StateVectorLow& dpsidt) const
64  {
65  dpsidt(L)+=psi(R);
66  }
67 
69  const Sigma<R,L> dagger() const {return Sigma<R,L>();}
70 
71 };
72 
73 
75 
86 template<int RANK, bool IS_HEAD>
87 const typename quantumdata::Types<RANK-1>::StateVectorLow
88 partialProject(const typename quantumdata::Types<RANK>::StateVectorLow& psi, int n);
89 
90 } // quantumoperator
91 
92 #endif // CPPQEDCORE_QUANTUMOPERATOR_SIGMA_H_INCLUDED
Defines class of the same name.
Basically only a metafunction defining types for higher-level constructs of arity RANK ...
Definition: Types.h:23
quantumdata::Types< 1 >::StateVectorLow StateVectorLow
unary StateVectorLow
Definition: Free.h:34
void apply(const StateVectorLow &psi, StateVectorLow &dpsidt) const
Application of the operator on a state vector can be implemented trivially.
Definition: Sigma.h:63
const Sigma< R, L > dagger() const
Hermitian conjugation also trivial.
Definition: Sigma.h:69
Comprises modules representing operators of special structure (tridiagonal, sparse) over Hilbert spac...
Definition: Sigma.h:12
const quantumdata::Types< RANK-1 >::StateVectorLow partialProject(const typename quantumdata::Types< RANK >::StateVectorLow &psi, int n)
Helper for DirectProduct::apply.
Stateless class implementing the unary quantumoperator .
Definition: Sigma.h:54