HHL.expand_to_powerdim

static HHL.expand_to_powerdim(matrix, vector)[source]

Expand a matrix to the next-larger 2**n dimensional matrix with ones on the diagonal and zeros on the off-diagonal and expand the vector with zeros accordingly.

Parameters
  • matrix (np.array) – the input matrix

  • vector (np.array) – the input vector

Returns

the expanded matrix, the expanded vector

Return type

tuple(np.array, np.array)