Template Function Pennylane::LightningQubit::Util::matrixVecProd(const std::complex<T> *, const std::complex<T> *, std::complex<T> *, std::size_t, std::size_t, Trans)

Function Documentation

template<class T>
inline void Pennylane::LightningQubit::Util::matrixVecProd(const std::complex<T> *mat, const std::complex<T> *v_in, std::complex<T> *v_out, std::size_t m, std::size_t n, Trans transpose = Trans::NoTranspose)

Calculates the matrix-vector product using the best available method.

Template Parameters

T – Floating point precision type.

Parameters
  • mat – Complex data array repr. a flatten (row-wise) matrix m * n.

  • v_in – Complex data array repr. a vector of shape n * 1.

  • v_out – Pre-allocated complex data array to store the result.

  • m – Number of rows of mat.

  • n – Number of columns of mat.

  • transpose – Whether use a transposed version of m_right.