Class ItfContext

Inheritance Relationships

Base Type

Class Documentation

class ItfContext : public sequant::ReorderingContext

Context for the ItfGenerator.

Public Types

using TagMap = container::map<IndexSpace, std::string>
using NameMap = container::map<IndexSpace, std::string>
using TensorImportMap = container::map<Tensor, std::string, TensorBlockLessThanComparator>
using VariableImportMap = container::map<Variable, std::string>

Public Functions

inline ItfContext()
~ItfContext() = default
virtual std::string index_name(const IndexSpace &space, std::size_t ordinal) const
Returns:

The ITF representation of an index in the given space and with the given ordinal

virtual std::string get_name(const IndexSpace &space) const
Returns:

The ITF representation of the given index space

virtual std::string get_tag(const IndexSpace &space) const
Returns:

The tag corresponding to the given index space. Tags are appended to tensor names in order to make different blocks of the same tensor distinguishable

virtual std::optional<std::string> import_name(const Tensor &tensor) const
Returns:

The name under which the given tensor shall be imported. If none is obtained, the tensor will not be imported.

virtual std::optional<std::string> import_name(const Variable &variable) const
Returns:

The name under which the given variable shall be imported. If none is obtained, the variable will not be imported.

virtual void set_name(const IndexSpace &space, std::string name)

Sets the name of the given index space.

virtual void set_tag(const IndexSpace &space, std::string tag)

Sets the name for the given index space.

virtual void set_import_name(const Tensor &tensor, std::string name)

Sets the name under which the given tensor is to be exported.

virtual void set_import_name(const Variable &variable, std::string name)

Sets the name under which the given variable is to be exported.

inline virtual const std::wstring two_electron_integral_label() const
Returns:

The label of the 2-electron integral tensor

inline virtual void set_two_electron_integral_label(std::wstring label)

Sets the label of the 2-electron integral tensor.

virtual bool rewrite(Tensor &tensor) const override

Performs necessary (backend-specific) modifications (if any) on the given Tensor in-place

Parameters:

tensor – The Tensor to be modified

Returns:

Whether any modification has been performed

virtual std::size_t index_id_offset() const
Returns:

The offset index ordinals are using. All index ordinals are expected to be >= this value

virtual void set_index_id_offset(std::size_t offset)

Sets the offset index ordinals are using. All index ordinals are expected to be >= this value

Protected Functions

bool is_exceptional_J(std::span<Index> bra, std::span<Index> ket) const