CM Evaluation

cm.printing_cms(n, vector)[source]
Calculates the cumulation of the coefficient matrices values which is an invariant.

In fact, at first, from the input vector, all the flattenings are made. Then, a calculation is done from each of them. In the end, the invariant is just the sum of all the results.

Example:
>>> printing_cms(3, [1 / sqrt(2), 0, 0, 0, 0, 0, 0, 1 / sqrt(2)])
1
Parameters:
  • n (int) – The number of qubits.

  • vector (list[int]) – A list filled with the coefficients corresponding to the vector.

Returns:

int – The invariant.