#include <quantum.h>
Collaboration diagram for ProductOperatorSum:
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. | |
Operator & | Realize (Operator &fulloperator) const |
Realizes the dense matrix represented by this ProductOperatorSum, assigning it to the provided fulloperator . | |
Operator & | AddTo (Operator &fulloperator, complex amplitude=complex(1.0, 0)) const |
Realizes a scalar multiple of this ProductOperator, adding it to the provided fulloperator . | |
ProductOperator & | Term (itype index) const |
Returns a reference to the index 'th term in the sum. | |
const TensorProductStructure & | TPS () 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. | |
ProductOperatorSum & | operator+= (const ProductOperator &oper) |
Adds another ProductOperator to this sum, returning a reference to the result. | |
ProductOperatorSum & | operator+= (const ProductOperatorSum &oper) |
Adds all the terms from another ProductOperatorSum to this sum, returning a reference to the result. | |
ProductOperatorSum & | operator *= (complex scalar) |
Scales all the terms in this ProductOperatorSum by scalar , returning a reference to the result. | |
ProductOperatorSum & | operator/= (complex scalar) |
Scales all the terms in this ProductOperatorSum by 1/scalar , returning a reference to the result. |
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:
|
Acts on the dense State
WARNING: |
|
Acts on the dense State
WARNING: |