SOSpin is hosted by Hepforge, IPPP Durham
SOSpin  1.0.0

Store expression... More...

#include <include/braket.h>

Public Member Functions

 Braket (void)
 Constructor, default expression mode is none. More...
 
 Braket (const DList &d0)
 Constructor without constant part and index zero. More...
 
 Braket (int id, string a, DList d0)
 Constructor, default expression mode is none. More...
 
 Braket (int id, string a, DList d0, OPMode op)
 Constructor, default expression mode is none. More...
 
 Braket (const Braket &L)
 Constructor. More...
 
 Braket (int id, string a, const Braket &L, OPMode op)
 Constructor. More...
 
 Braket (BraketOneTerm term)
 Constructor, default expression mode is none. More...
 
 Braket (BraketOneTerm term, OPMode op)
 Constructor. More...
 
 ~Braket ()
 Destructor, clear all allocated memory. More...
 
void clear ()
 Clear all allocated memory and sets default parameters. More...
 
void expfromForm (vector< string > a)
 To pass a expression from form. More...
 
OPModeType ()
 
void mode ()
 
void evaluate (bool onlydeltas=true)
 Evaluate expression. More...
 
void simplify ()
 Simplify expression. Apply the following rules:

\begin{eqnarray*} &b_? \left|0\right> = 0 \\ &\left<0\right| b^\dagger_? = 0 \\ &In \left<0\right| ... \left.0\right> \quad the\quad \#b_? = \#b^\dagger_? \end{eqnarray*}

Also checks for numeric deltas and evaluates them. This function also calls. More...

  void rearrange ()  Order nodes of DList in Braket. More...
  void checkDeltaIndex ()  Checks indices in the deltas. More...
  void gindexsetnull ()  Sets to zero the indice sum of each expression term. More...
  void checkindex ()  Check global index in expression term if setSimplifyIndexSum()/FlagSimplifyGlobalIndexSum is active. More...
  void setON ()  Activate expression term numbering for output writing for each term "Local R?=". More...
  void setOFF ()  Deactivate expression term numbering for output writing for each term "Local R?=". More...
  int size ()  Return number of terms in current expression. More...
  BraketOneTermGet (int pos)  Return expression term at position given by pos. More...
  int & GetIndex (int pos)  Return/set the index sum of the term given by pos. More...
  Braket operator= (const Braket &L)  overload operator for Braket = L More...
  Braket operator+ (const Braket &L)  overload operator for Braket + L More...
  Braket operator+= (const Braket &L)  overload operator for Braket += L More...
  Braket operator- (const Braket &L)  overload operator for Braket - L More...
  Braket operator-= (const Braket &L)  overload operator for Braket -= L More...
  Braket operator* (const Braket &L)  overload operator for Braket * L More...
  Braketoperator*= (const Braket &L)  overload operator for Braket *= L More...
  Braket operator* (const string constval)  overload operator for Braket * constant part More...
  Braket operator*= (const string constval)  overload operator for Braket *= constant part More...
 

Private Attributes

vector< BraketOneTermexpression
 Store expressions with b's, b^ and delta's. More...
 
int flag
 Flag to make the term numeration with ostream operator. More...
 
OPMode operation
 Store type of operation: none, bra, ket or braket. More...
 
unsigned int evaluated
 Store the evaluated state of the expression. More...
 

Friends

Braket operator- (const Braket &L)
 overload operator for negate, -L More...
 
OPMode operator* (const OPMode a, const OPMode b)
 calculate the mode for the multiplication More...
 
OPMode operator+ (const OPMode a, const OPMode b)
 calculate the mode for the sum More...
 
OPMode operator- (const OPMode a, const OPMode b)
 calculate the mode for the subtraction More...
 
ostream & operator<< (ostream &out, const Braket &L)
 writes expression to ostream More...
 
string & operator<< (string &out, const Braket &L)
 writes expression to string More...
 
string & operator+ (string &out, const Braket &L)
 writes expression to string More...
 

Detailed Description

Store expression...

Definition at line 198 of file braket.h.

Constructor & Destructor Documentation

sospin::Braket::Braket ( void  )

Constructor, default expression mode is none.

Definition at line 140 of file braket.cpp.

sospin::Braket::Braket ( const DList d0)

Constructor without constant part and index zero.

Parameters
[in]d0DList expression

Definition at line 145 of file braket.cpp.

sospin::Braket::Braket ( int  id,
string  a,
DList  d0 
)

Constructor, default expression mode is none.

Parameters
[in]idindex of the expression
[in]aconstant part
[in]d0DList expression

Definition at line 166 of file braket.cpp.

sospin::Braket::Braket ( int  id,
string  a,
DList  d0,
OPMode  op 
)

Constructor, default expression mode is none.

Parameters
[in]idindex of the expression
[in]aconstant part
[in]d0DList expression
[in]opBraket type, i.e., bra/ket/braket/none

Definition at line 173 of file braket.cpp.

sospin::Braket::Braket ( const Braket L)

Constructor.

Parameters
[in]LBraket expression

Definition at line 180 of file braket.cpp.

sospin::Braket::Braket ( int  id,
string  a,
const Braket L,
OPMode  op 
)

Constructor.

Parameters
[in]idindex of the expression
[in]aconstant part
[in]LBraket expression, ignores current constant part of L
[in]opBraket type, i.e., bra/ket/braket/none

Definition at line 187 of file braket.cpp.

sospin::Braket::Braket ( BraketOneTerm  term)

Constructor, default expression mode is none.

Parameters
[in]termBraketOneTerm expression

Definition at line 152 of file braket.cpp.

sospin::Braket::Braket ( BraketOneTerm  term,
OPMode  op 
)

Constructor.

Parameters
[in]termBraketOneTerm expression
[in]opBraket type, i.e., bra/ket/braket/none

Definition at line 159 of file braket.cpp.

sospin::Braket::~Braket ( )

Destructor, clear all allocated memory.

destructor

Definition at line 220 of file braket.cpp.

Member Function Documentation

void sospin::Braket::checkDeltaIndex ( )

Checks indices in the deltas.

void sospin::Braket::checkindex ( )

Check global index in expression term if setSimplifyIndexSum()/FlagSimplifyGlobalIndexSum is active.

Returns
true if |index| is equal to 0 or N of SO(2N), otherwise returns false

Definition at line 650 of file braket.cpp.

void sospin::Braket::clear ( )

Clear all allocated memory and sets default parameters.

Definition at line 212 of file braket.cpp.

void sospin::Braket::evaluate ( bool  onlydeltas = true)

Evaluate expression.

Parameters
[in]onlydeltasif true evaluate expression to deltas, if false evaluate expression to levi-civita

Definition at line 1034 of file braket.cpp.

void sospin::Braket::expfromForm ( vector< string >  a)

To pass a expression from form.

Definition at line 200 of file braket.cpp.

BraketOneTerm & sospin::Braket::Get ( int  pos)

Return expression term at position given by pos.

Definition at line 240 of file braket.cpp.

int & sospin::Braket::GetIndex ( int  pos)

Return/set the index sum of the term given by pos.

Definition at line 248 of file braket.cpp.

void sospin::Braket::gindexsetnull ( )

Sets to zero the indice sum of each expression term.

Definition at line 674 of file braket.cpp.

void sospin::Braket::mode ( )

Definition at line 330 of file braket.cpp.

Braket sospin::Braket::operator* ( const Braket L)

overload operator for Braket * L

Definition at line 510 of file braket.cpp.

Braket sospin::Braket::operator* ( const string  constval)

overload operator for Braket * constant part

Definition at line 469 of file braket.cpp.

Braket & sospin::Braket::operator*= ( const Braket L)

overload operator for Braket *= L

Definition at line 534 of file braket.cpp.

Braket sospin::Braket::operator*= ( const string  constval)

overload operator for Braket *= constant part

Definition at line 452 of file braket.cpp.

Braket sospin::Braket::operator+ ( const Braket L)

overload operator for Braket + L

Definition at line 432 of file braket.cpp.

Braket sospin::Braket::operator+= ( const Braket L)

overload operator for Braket += L

Definition at line 422 of file braket.cpp.

Braket sospin::Braket::operator- ( const Braket L)

overload operator for Braket - L

Definition at line 406 of file braket.cpp.

Braket sospin::Braket::operator-= ( const Braket L)

overload operator for Braket -= L

Definition at line 394 of file braket.cpp.

Braket sospin::Braket::operator= ( const Braket L)

overload operator for Braket = L

Definition at line 353 of file braket.cpp.

void sospin::Braket::rearrange ( )

Order nodes of DList in Braket.

First deltas and then b's and b\dagger's and remove the identity node when deltas, b or b^dagger is present

Definition at line 630 of file braket.cpp.

void sospin::Braket::setOFF ( )

Deactivate expression term numbering for output writing for each term "Local R?=".

Definition at line 229 of file braket.cpp.

void sospin::Braket::setON ( )

Activate expression term numbering for output writing for each term "Local R?=".

Definition at line 225 of file braket.cpp.

void sospin::Braket::simplify ( )

Simplify expression. Apply the following rules:

\begin{eqnarray*} &b_? \left|0\right> = 0 \\ &\left<0\right| b^\dagger_? = 0 \\ &In \left<0\right| ... \left.0\right> \quad the\quad \#b_? = \#b^\dagger_? \end{eqnarray*}

Also checks for numeric deltas and evaluates them. This function also calls.

Definition at line 728 of file braket.cpp.

int sospin::Braket::size ( )

Return number of terms in current expression.

Definition at line 237 of file braket.cpp.

OPMode & sospin::Braket::Type ( )

Definition at line 256 of file braket.cpp.

Friends And Related Function Documentation

OPMode operator* ( const OPMode  a,
const OPMode  b 
)
friend

calculate the mode for the multiplication

Parameters
amode of the left operand
bmode of the right operand
Returns
mode of the multiplication, if this results in an invalid operation the the program exit.

Definition at line 317 of file braket.cpp.

OPMode operator+ ( const OPMode  a,
const OPMode  b 
)
friend

calculate the mode for the sum

Parameters
amode of the left operand
bmode of the right operand
Returns
mode of the sum, if this results in an invalid operation the the program exit.

Definition at line 304 of file braket.cpp.

string& operator+ ( string &  out,
const Braket L 
)
friend

writes expression to string

Definition at line 617 of file braket.cpp.

Braket operator- ( const Braket L)
friend

overload operator for negate, -L

Definition at line 384 of file braket.cpp.

OPMode operator- ( const OPMode  a,
const OPMode  b 
)
friend

calculate the mode for the subtraction

Parameters
amode of the left operand
bmode of the right operand
Returns
mode of the subtraction, if this results in an invalid operation the the program exit.

Definition at line 291 of file braket.cpp.

ostream& operator<< ( ostream &  out,
const Braket L 
)
friend

writes expression to ostream

Definition at line 598 of file braket.cpp.

string& operator<< ( string &  out,
const Braket L 
)
friend

writes expression to string

Definition at line 612 of file braket.cpp.

Member Data Documentation

unsigned int sospin::Braket::evaluated
private

Store the evaluated state of the expression.

Definition at line 206 of file braket.h.

vector< BraketOneTerm > sospin::Braket::expression
private

Store expressions with b's, b^ and delta's.

Definition at line 200 of file braket.h.

int sospin::Braket::flag
private

Flag to make the term numeration with ostream operator.

Definition at line 202 of file braket.h.

OPMode sospin::Braket::operation
private

Store type of operation: none, bra, ket or braket.

Definition at line 204 of file braket.h.


The documentation for this class was generated from the following files: