Template Class Hamiltonian¶
Defined in File ObservablesKokkos.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¶
-
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¶
Updates the statevector sv:->sv’.
- Parameters
sv – The statevector to update
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