Template Class HermitianObs

Inheritance Relationships

Base Type

Class Documentation

template<typename T>
class HermitianObs : public Pennylane::Algorithms::Observable<T>

Class models.

Public Types

using MatrixT = std::vector<std::complex<T>>

Public Functions

template<typename T1>
inline HermitianObs(T1 &&matrix, std::vector<size_t> wires)

Create Hermitian observable.

Parameters
  • matrix – Matrix in row major format.

  • wires – Wires the observable applies to.

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

Get the wires the observable applies to.

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

Get the name of the observable.

inline virtual void applyInPlace(StateVectorManagedCPU<T> &sv) const override

Apply the observable to the given statevector in place.