Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

ProductOperatorSum Class Reference
[Objects with a TPS]

A sum of TensorProductOperator operators. More...

#include <quantum.h>

Collaboration diagram for ProductOperatorSum:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ProductOperatorSum (const TensorProductStructure &Uinit)
 Constructor: constructs an empty sum (of no ProductOperators) on a given TensorProductStructure.
 ProductOperatorSum (const ProductOperator &oper, complex amplitude=complex(1.0, 0))
 Unit constructor: constructs the sum of exactly one ProductOperator, multiplied by a scaling factor.
 ProductOperatorSum (const ProductOperatorSum &other)
 Copy constructor: constructs an exact copy of another ProductOperatorSum.
 ~ProductOperatorSum ()
 Destructor: de-allocates the component ProductOperators.
OperatorRealize (Operator &fulloperator) const
 Realizes the dense matrix represented by this ProductOperatorSum, assigning it to the provided fulloperator.
OperatorAddTo (Operator &fulloperator, complex amplitude=complex(1.0, 0)) const
 Realizes a scalar multiple of this ProductOperator, adding it to the provided fulloperator.
ProductOperatorTerm (itype index) const
 Returns a reference to the index'th term in the sum.
const TensorProductStructureTPS () const
 Returns a const reference to this ProductOperator's underlying TensorProductStructure.
itype NTerms () const
 Returns the total number of terms in the sum.
void ApplyTo (const State &psi, State &result) const
 Acts on the dense State psi with this ProductOperatorSum, storing the result in result.
void ApplyAndAddTo (const State &psi, State &result, complex amplitude=complex(1.0)) const
State operator * (State &psi) const
 Returns a new dense State which is psi transformed by this rProductOperator.
ProductOperatorSumoperator+= (const ProductOperator &oper)
 Adds another ProductOperator to this sum, returning a reference to the result.
ProductOperatorSumoperator+= (const ProductOperatorSum &oper)
 Adds all the terms from another ProductOperatorSum to this sum, returning a reference to the result.
ProductOperatorSumoperator *= (complex scalar)
 Scales all the terms in this ProductOperatorSum by scalar, returning a reference to the result.
ProductOperatorSumoperator/= (complex scalar)
 Scales all the terms in this ProductOperatorSum by 1/scalar, returning a reference to the result.

Detailed Description

A sum of TensorProductOperator operators.

ProductOperatorSum generalizes the idea of an operator that is sparse because of its tensor product structure, making it easy to efficiently represent the sum of a small number of TensorProductOperators. A ProductOperatorSum can be constructed as an empty sum, as the sum of a single ProductOperator, or as a copy of another ProductOperatorSum. ProductOperatorSum objects are useful for representing Hamiltonians, which tend to be piecewise factorizable.

Each of the terms in the sum can be accessed as a TensorProductOperator, but the overall operator's elements are not writable (and, as of 6/06, not directly accessible at all). Things you can do with a ProductOperatorSum:


Member Function Documentation

void ProductOperatorSum::ApplyTo const State psi,
State result
const
 

Acts on the dense State psi with this ProductOperatorSum, storing the result in result.

WARNING: psi and result must not share any data, otherwise the result will be undefined!

void ProductOperatorSum::ApplyAndAddTo const State psi,
State result,
complex  amplitude = complex(1.0)
const
 

Acts on the dense State psi with this ProductOperator; adds a scalar multiple of the result to result.

WARNING: psi and result must not share any data, otherwise the result will be undefined!


The documentation for this class was generated from the following files:
Generated on Wed Jun 14 22:25:29 2006 for linalg by  doxygen 1.4.4