Function libwalrus::powtrace(vec_double&, int, int)

Function Documentation

vec_double libwalrus::powtrace(vec_double &z, int n, int l)

Given a real matrix \(z\) of dimensions \(n\times n\), it calculates \(Tr(z^j)~\forall~1\leq j\leq l\).

Return

a vector containing the power traces of matrix z to power \(1\leq j \leq l\).

Parameters
  • z: a flattened complex vector of size \(n^2\), representing an \(n\times n\) row-ordered matrix.

  • n: size of the matrix z.

  • l: maximum matrix power when calculating the power trace.