Linopt
Linear optics circuit calculator
|
The class representing a Fock state. More...
#include <states.h>
Public Types | |
using | Vector = std::vector< int > |
Convenience typedef to std::vector. | |
using | Value = int |
using | value_type = Value |
using | Reference = Value & |
using | reference = Reference |
using | Iterator = Base::iterator |
using | ConstIterator = Base::const_iterator |
using | ReverseIterator = Base::reverse_iterator |
using | ConstReverseIterator = Base::const_reverse_iterator |
Public Member Functions | |
int | size () const |
Returns the number of modes in a Fock state. | |
void | pushBack (Value n) |
void | popBack () |
Fock ()=default | |
Default constructor. | |
Fock (const Vector &v) | |
Construct a Fock state from a fock::vector_class . | |
int | total () const |
Returns the total number of photons in all modes. | |
Real | prodFact () const |
Returns a product of factorials of occupation numbers. | |
Fock | operator* (const Fock &f) const |
Returns a tensor product of *this and f . | |
Fock & | operator*= (const Fock &f) |
Effectively equivalent to *this = (*this) * f . | |
Fock | operator+ (const Fock &f) const |
Returns a sum of two Fock states (elementwise addition of corresponding occupation numbers). More... | |
Fock & | operator+= (const Fock &f) |
Effectively equivalent to *this = (*this) + f . | |
The class representing a Fock state.
A Fock state is a state with exact number of photons in each mode. A Fock state is represented as a list of nonnegative integers:
\[ | n_0, \dots, n_m \rangle, \]
where \( n_i \) is called an occupation number of an \( i \)-th mode.
The interface of this class is very similar to std::vector
.