Template Function Pennylane::Util::kronProd

Function Documentation

template<typename T>
auto Pennylane::Util::kronProd(const std::vector<T> &diagA, const std::vector<T> &diagB) -> std::vector<T>

Kronecker product of two diagonal matrices. Only diagonal elements are stored.

Template Parameters

T – Data type.

Parameters
  • diagA – A vector containing the values of a diagonal matrix.

  • diagB – A vector containing the values of a diagonal matrix.

Returns

kronAB A vector containing the diagonal values of the Kronecker product.