Template Class TensorProdObs

Inheritance Relationships

Base Type

  • public TensorProdObsBase< StateVectorT >

Class Documentation

template<class StateVectorT>
class TensorProdObs : public TensorProdObsBase<StateVectorT>

Final class for TensorProdObs observables.

Template Parameters

StateVectorT – State vector class.

Public Types

using PrecisionT = typename StateVectorT::PrecisionT

Public Functions

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

Create an Hermitian observable.

Parameters
  • matrix – Matrix in row major format.

  • wires – Wires the observable applies to.

Public Static Functions

static inline auto create(std::initializer_list<std::shared_ptr<Observable<StateVectorT>>> obs) -> std::shared_ptr<TensorProdObs<StateVectorT>>

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

static inline auto create(std::vector<std::shared_ptr<Observable<StateVectorT>>> obs) -> std::shared_ptr<TensorProdObs<StateVectorT>>