Template Class StateVectorCPU

Inheritance Relationships

Base Type

Class Documentation

template<class PrecisionT, class Derived>
class StateVectorCPU : public Pennylane::StateVectorBase<PrecisionT, Derived>

StateVector class where data resides in CPU memory.

Template Parameters
  • PrecisionT – Data floating point type

  • Derived – Derived class for CRTP.

Public Types

using ComplexPrecisionT = std::complex<PrecisionT>

Public Functions

inline auto getKernelForGate(Gates::GateOperation gate_op) const -> Gates::KernelType

Get a kernel for a gate operation.

Parameters

gate_op – Gate operation

Returns

KernelType

inline auto getKernelForGenerator(Gates::GeneratorOperation gntr_op) const -> Gates::KernelType

Get a kernel for a gate operation.

Parameters

gntr_op – Generator operation

Returns

KernelType

inline auto getKernelForMatrix(Gates::MatrixOperation mat_op) const -> Gates::KernelType

Get a kernel for a gate operation.

Parameters

mat_op – Matrix operation

Returns

KernelType

inline CPUMemoryModel memoryModel() const

Get memory model of the statevector.

inline Threading threading() const

Get threading of the statevector.

inline auto getGateKernelMap() const & -> const std::unordered_map<Gates::GateOperation, Gates::KernelType>&

Get kernels for all gate operations.

inline auto getGateKernelMap() && -> std::unordered_map<Gates::GateOperation, Gates::KernelType>
inline auto getGeneratorKernelMap() const & -> const std::unordered_map<Gates::GeneratorOperation, Gates::KernelType>&

Get kernels for all generator operations.

inline auto getGeneratorKernelMap() && -> std::unordered_map<Gates::GeneratorOperation, Gates::KernelType>
inline auto getMatrixKernelMap() const & -> const std::unordered_map<Gates::MatrixOperation, Gates::KernelType>&

Get kernels for all matrix operations.

inline auto getMatrixKernelMap() && -> std::unordered_map<Gates::MatrixOperation, Gates::KernelType>

Protected Functions

inline explicit StateVectorCPU(size_t num_qubits, Threading threading, CPUMemoryModel memory_model)

Protected Attributes

const Threading threading_
const CPUMemoryModel memory_model_