Template Class TensorProdObs¶
Defined in File Observables.hpp
Inheritance Relationships¶
Base Type¶
public Pennylane::Algorithms::Observable< T >
(Template Class Observable)
Class Documentation¶
-
template<typename T>
class TensorProdObs : public Pennylane::Algorithms::Observable<T>¶ Tensor product observable class.
Public Functions
-
template<typename ...Ts>
inline explicit TensorProdObs(Ts&&... arg)¶ Create a tensor product of observables.
- Parameters
arg – Arguments perfect forwarded to vector of observables.
-
inline auto getSize() const -> size_t¶
Get the number of operations in observable.
- Returns
size_t
-
inline virtual auto getWires() const -> std::vector<size_t> override¶
Get the wires for each observable operation.
- Returns
const std::vector<std::vector<size_t>>&
-
inline virtual void applyInPlace(StateVectorManagedCPU<T> &sv) const override¶
Apply the observable to the given statevector in place.
-
inline virtual auto getObsName() const -> std::string override¶
Get the name of the observable.
Public Static Functions
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
-
template<typename ...Ts>