Template Class Hamiltonian¶
Defined in File ObservablesGPU.hpp
Class Documentation¶
-
template<class StateVectorT>
class Hamiltonian : public HamiltonianBase<StateVectorT>¶ General Hamiltonian as a sum of observables.
Public Types
-
using PrecisionT = typename StateVectorT::PrecisionT¶
-
using ComplexT = typename StateVectorT::ComplexT¶
Public Functions
-
template<typename T1, typename T2>
inline explicit Hamiltonian(T1 &&coeffs, T2 &&obs)¶ Create a Hamiltonian from coefficients and observables.
- Parameters
coeffs – Arguments to construct coefficients
obs – Arguments to construct observables
-
inline void applyInPlace(StateVectorT &sv) const override¶
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
coeffs – Argument to construct coefficients
obs – Argument to construct terms
-
using PrecisionT = typename StateVectorT::PrecisionT¶
api/classPennylane_1_1LightningGPU_1_1Observables_1_1Hamiltonian
Download Python script
Download Notebook
View on GitHub