Template Class NamedObs

Inheritance Relationships

Base Type

Class Documentation

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

Class models named observables (PauliX, PauliY, PauliZ, etc.)

Template Parameters

T – Floating point type

Public Functions

inline NamedObs(std::string obs_name, std::vector<size_t> wires, std::vector<T> params = {})

Construct a NamedObs object, representing a given observable.

Parameters
  • arg1 – Name of the observable.

  • arg2 – Argument to construct wires.

  • arg3 – Argument to construct parameters

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

Get the name of the observable.

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

Get the wires the observable applies to.

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

Apply the observable to the given statevector in place.