Template Class HermitianObsBase¶
Defined in File Observables.hpp
Inheritance Relationships¶
Base Type¶
public Pennylane::Observables::Observable< StateVectorT >
(Template Class Observable)
Class Documentation¶
-
template<class StateVectorT>
class HermitianObsBase : public Pennylane::Observables::Observable<StateVectorT>¶ Base class for Hermitian observables.
- Template Parameters
StateVectorT – State vector class.
Public Types
-
using PrecisionT = typename StateVectorT::PrecisionT¶
-
using ComplexT = typename StateVectorT::ComplexT¶
Public Functions
-
inline HermitianObsBase(MatrixT matrix, std::vector<std::size_t> wires)¶
Create an Hermitian observable.
- Parameters
matrix – Matrix in row major format.
wires – Wires the observable applies to.
-
inline virtual auto getWires() const -> std::vector<std::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(StateVectorT &sv) const override¶
Apply the observable to the given statevector in place.
-
inline void applyInPlaceShots([[maybe_unused]] StateVectorT &sv, [[maybe_unused]] std::vector<std::vector<PrecisionT>> &eigenValues, [[maybe_unused]] std::vector<std::size_t> &ob_wires) const override¶
api/classPennylane_1_1Observables_1_1HermitianObsBase
Download Python script
Download Notebook
View on GitHub