paddle_quantum.qsvt.qsp_utils

paddle_quantum.qsvt.qsp_utils.clean_small_error(array)

clean relatively small quantity

Parameters:

array (ndarray) – target array

Returns:

cleaned array

Return type:

ndarray

paddle_quantum.qsvt.qsp_utils.poly_norm(poly, p=1)

calculate the p-norm of a polynomial

Parameters:
  • poly (Polynomial) – the target polynomial

  • p (int | None) – order of norm, 0 means to be infinity

Returns:

p-norm of the target polynomial

Return type:

float

paddle_quantum.qsvt.qsp_utils.poly_real(poly)

return the real part of a polynomial

Parameters:

poly (Polynomial) – the target polynomial

Returns:

the real part of poly

Return type:

Polynomial

paddle_quantum.qsvt.qsp_utils.poly_imag(poly)

return the imaginary part of the polynomial

Parameters:

poly (Polynomial) – the target polynomial

Returns:

the imaginary part of poly

Return type:

Polynomial

paddle_quantum.qsvt.qsp_utils.poly_matrix(poly, matrix_A)

calculate the polynomial of a matrix, poly(matrix_A)

Parameters:
  • poly (Polynomial) – the polynomial

  • matrix_A (Tensor) – the matrix

Returns:

poly(matrix_A)

Return type:

Tensor

paddle_quantum.qsvt.qsp_utils.exp_matrix(t, matrix_A)

calculate \(e^{itA}\)

Parameters:
  • t (float) – time constant

  • A – the target matrix

Returns:

\(e^{itA}\)

Return type:

Tensor