Class EvalExpr

Inheritance Relationships

Derived Types

Class Documentation

class EvalExpr

The EvalExpr class represents the object that go into the nodes of the binary tree that is used to evaluate the sequant expressions.

The EvalExpr class itself is not a proper node. It is rather a data that a node should hold.

Subclassed by sequant::EvalExprBTAS, sequant::EvalExprTA

Public Functions

explicit EvalExpr(Tensor const &tnsr)

Construct an EvalExpr object from a tensor. The EvalOp is Id.

explicit EvalExpr(Constant const &c)

Construct an EvalExpr object from a Constant. The EvalOp is Id.

explicit EvalExpr(Variable const &v)

Construct an EvalExpr object from a Variable. The EvalOp is Id.

EvalExpr(EvalExpr const &left, EvalExpr const &right, EvalOp op)

Construct an EvalExpr object from two EvalExpr objects and an EvalOp. The EvalOp is either Sum or Prod.

EvalOp op_type() const noexcept
Returns:

The EvalOp resulting into this EvalExpr object.

ResultType result_type() const noexcept
Returns:

The ResultType of the evaluation performed on this node.

size_t hash_value() const noexcept

Compute the hash value of this EvalExpr object.

The hash value is computed during construction of the object by also looking at the hash values of the EvalExpr objects if passed.

Returns:

The hash value of this EvalExpr object.

size_t id() const noexcept

Get the unique id of this EvalExpr object. Useful for tracing. Not used by evaluation.

Returns:

The unique id of this EvalExpr object.

ExprPtr expr() const noexcept
Returns:

The ExprPtr object that this EvalExpr object holds.

bool tot() const noexcept
Returns:

True if this EvalExpr object contains a sequant tensor with proto-indices, false otherwise.

std::wstring to_latex() const noexcept
Returns:

Returns the result of calling to_latex() on the ExprPtr object contained by this object.

bool is_tensor() const noexcept
Returns:

True if the ExprPtr held by this object is Tensor and equivalently the result of evaluation is tensor.

bool is_scalar() const noexcept
Returns:

True if the ExprPtr

held by this object is scalar(Constant, or

Variable) and equivalently the result of evaluation is scalar.

bool is_constant() const noexcept
Returns:

True if ExprPtr held by this object is Constant.

bool is_variable() const noexcept
Returns:

True if ExprPtr held by this object is Variable.

Tensor const &as_tensor() const noexcept

Calls to<Tensor>() on ExprPtr held by this object.

Returns:

Tensor const&

Constant const &as_constant() const noexcept

Calls to<Constant>() on ExprPtr held by this object.

Returns:

Constant const&.

Variable const &as_variable() const noexcept

Calls to<Variable>() on ExprPtr held by this object.

Returns:

Variable const&

std::string label() const noexcept

Get the label for this object useful for logging.

std::string braket_annot() const noexcept
Returns:

A string usable as TiledArray annotation if is_tensor() true, empty string otherwise.