Template Class TensorProdObsTNCuda

Inheritance Relationships

Base Type

Class Documentation

template<class TensorNetT>
class TensorProdObsTNCuda : public Pennylane::LightningTensor::TNCuda::Observables::ObservableTNCuda<TensorNetT>

Tensor product of observables.

Template Parameters

TensorNetT – tensor network class.

Public Types

using BaseType = ObservableTNCuda<TensorNetT>
using PrecisionT = typename TensorNetT::PrecisionT
using MetaDataT = BaseType::MetaDataT

Public Functions

template<typename ...Ts>
inline explicit TensorProdObsTNCuda(Ts&&... arg)

Create a tensor product of observables.

Parameters

arg – Arguments perfect-forwarded to vector of observables.

inline auto getSize() const -> std::size_t

Get the number of operations in the observable.

Returns

std::size_t

inline virtual auto getWires() const -> std::vector<std::size_t> override

Get the wires for each observable operation.

Returns

const std::vector<std::size_t>

inline virtual auto getObsName() const -> std::string override

Get the name of the observable.

inline auto getObs() const -> std::vector<std::shared_ptr<ObservableTNCuda<TensorNetT>>>

Get the observable.

Public Static Functions

static inline auto create(std::initializer_list<std::shared_ptr<ObservableTNCuda<TensorNetT>>> obs) -> std::shared_ptr<TensorProdObsTNCuda<TensorNetT>>

Convenient wrapper for the constructor as the constructor does not convert the std::shared_ptr with a derived class correctly.

This function is useful as std::make_shared does not handle brace-enclosed initializer list correctly.

Parameters

obs – List of observables

Returns

std::shared_ptr<TensorProdObsTNCuda<TensorNetT>>

static inline auto create(std::vector<std::shared_ptr<ObservableTNCuda<TensorNetT>>> obs) -> std::shared_ptr<TensorProdObsTNCuda<TensorNetT>>

Convenient wrapper for the constructor as the constructor does not convert the std::shared_ptr with a derived class correctly.

This function is useful as std::make_shared does not handle brace-enclosed initializer list correctly.

Parameters

obs – List of observables

Returns

std::shared_ptr<TensorProdObsTNCuda<TensorNetT>>