Template Class Hamiltonian¶
Defined in File ObservablesLQubit.hpp
Class Documentation¶
-
template<class StateVectorT>
class Hamiltonian : public HamiltonianBase<StateVectorT>¶ Final class for a general Hamiltonian representation as a sum of observables.
- Template Parameters
StateVectorT – State vector class.
Public Types
-
using PrecisionT = typename StateVectorT::PrecisionT¶
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 – Arguments to construct coefficients
obs – Arguments to construct observables
api/classPennylane_1_1LightningQubit_1_1Observables_1_1Hamiltonian
Download Python script
Download Notebook
View on GitHub