Template Class ObservableTNCuda

Inheritance Relationships

Derived Types

Class Documentation

template<class TensorNetT>
class ObservableTNCuda

A base class for observable classes of cutensornet backends.

We note that the observable classes for cutensornet backends have the same user interface as the observable classes for the statevector backends across the lightning ecosystem.

Template Parameters

TensorNetT – tensor network class.

Subclassed by Pennylane::LightningTensor::TNCuda::Observables::HamiltonianTNCuda< TensorNetT >, Pennylane::LightningTensor::TNCuda::Observables::HermitianObsTNCuda< TensorNetT >, Pennylane::LightningTensor::TNCuda::Observables::NamedObsTNCuda< TensorNetT >, Pennylane::LightningTensor::TNCuda::Observables::TensorProdObsTNCuda< TensorNetT >

Public Types

using PrecisionT = typename TensorNetT::PrecisionT
using ComplexT = typename TensorNetT::ComplexT
using MetaDataT = std::tuple<std::string, std::vector<PrecisionT>, std::vector<ComplexT>>

Public Functions

virtual ~ObservableTNCuda() = default
virtual auto getObsName() const -> std::string = 0

Get the name of the observable.

virtual auto getWires() const -> std::vector<std::size_t> = 0

Get the wires the observable applies to.

inline auto getNumTensors() const -> const vector1D<std::size_t>&

Get the number of tensors in each term (For non-Hamiltonian observables, the size of std::vector return is 1).

inline auto getNumStateModes() const -> const vector2D<std::size_t>&

Get the number of state modes of each tensor in each term.

inline auto getStateModes() const -> const vector3D<std::size_t>&

Get the state modes of each tensor in each term.

inline auto getMetaData() const -> const vector2D<MetaDataT>&

Get the meta data of each tensor in each term on host.

inline auto getCoeffs() const -> const vector1D<PrecisionT>&

Get the coefficients of a observable.

inline auto operator==(const ObservableTNCuda<TensorNetT> &other) const -> bool

Test whether this object is equal to another object.

inline auto operator!=(const ObservableTNCuda<TensorNetT> &other) const -> bool

Test whether this object is different from another object.

Protected Functions

ObservableTNCuda() = default
ObservableTNCuda(const ObservableTNCuda&) = default
ObservableTNCuda(ObservableTNCuda&&) noexcept = default
ObservableTNCuda &operator=(const ObservableTNCuda&) = default
ObservableTNCuda &operator=(ObservableTNCuda&&) noexcept = default

Protected Attributes

vector1D<PrecisionT> coeffs_
vector1D<std::size_t> numTensors_
vector2D<std::size_t> numStateModes_
vector3D<std::size_t> stateModes_
vector2D<MetaDataT> metaData_