paddle_quantum.qsvt.qsp
- paddle_quantum.qsvt.qsp.signal_unitary(signal_x)
signal unitary
in paper https://arxiv.org/abs/1806.01838- Parameters:
signal_x (float) – variable x in [-1, 1]
- Returns:
matrix W(x = x)
- Return type:
ndarray
- paddle_quantum.qsvt.qsp.poly_parity_verification(poly_p, k, error=1e-06)
verify whether
has parity-(k mod 2), i.e., the second condition of theorem 3 holds- Parameters:
poly_p (Polynomial) – polynomial
k (int) – parameter that determine parity
error (float) – tolerated error, defaults to 1e-6
- Returns:
determine whether
has parity-(k mod 2)- Return type:
bool
- paddle_quantum.qsvt.qsp.normalization_verification(poly_p, poly_q, trials=10, error=0.01)
verify whether polynomials
and satisfy the normalization condition , i.e., the third condition of Theorem 3.- Parameters:
poly_p (Polynomial) – polynomial
poly_q (Polynomial) – polynomial
trials (int) – number of tests, defaults to 10
error (float) – tolerated error, defaults to 1e-2
- Returns:
determine whether
- Return type:
bool
- paddle_quantum.qsvt.qsp.angle_phi_verification(phi, poly_p, poly_p_hat, poly_q_hat, trials=10, error=0.01)
verify
during the iteration of finding- Parameters:
phi (float) – rotation angle
poly_p (Polynomial) – polynomial
poly_p_hat (Polynomial) – updated polynomial
poly_q_hat (Polynomial) – updated polynomial
trials (int) – number of tests, defaults to 10
error (float) – tolerated error, defaults to 0.01
- Returns:
//arxiv.org/abs/1806.01838 holds
- Return type:
determine whether the equation (6) in paper https
- paddle_quantum.qsvt.qsp.processing_unitary(list_matrices, signal_x)
processing unitary
, see equation 1 in paper https://arxiv.org/abs/1806.01838- Parameters:
list_matrices (List[ndarray]) – array of phi’s matrices
signal_x (float) – input signal x in [-1, 1]
- Returns:
matrix
- Return type:
ndarray
- paddle_quantum.qsvt.qsp.Phi_verification(list_phi, poly_p, trials=100, error=1e-06)
verify the final
- Parameters:
list_phi (ndarray) – array of
’spoly_p (Polynomial) – polynomial
trials (int) – number of tests, defaults to 100
error (float) – tolerated error, defaults to 1e-6
- Returns:
determine whether
is a block encoding of- Return type:
bool
- paddle_quantum.qsvt.qsp.update_polynomial(poly_p, poly_q, phi)
update
by given phi according to proof in theorem 3- Parameters:
poly_p (Polynomial) – polynomial
poly_q (Polynomial) – polynomial
phi (float) – derived
- Returns:
updated
- Return type:
Tuple[Polynomial, Polynomial]
- paddle_quantum.qsvt.qsp.alg_find_Phi(poly_p, poly_q, length)
The algorithm of finding phi’s by theorem 3
- Parameters:
poly_p (Polynomial) – polynomial
poly_q (Polynomial) – polynomial
length (int) – length of returned array
- Returns:
array of phi’s
- Return type:
ndarray
- paddle_quantum.qsvt.qsp.poly_A_hat_generation(poly_p)
function for
generation- Parameters:
poly_p (Polynomial) – polynomial
- Returns:
polynomial
, with- Return type:
Polynomial
- paddle_quantum.qsvt.qsp.poly_A_hat_decomposition(A_hat, error=0.001)
function for
decomposition- Parameters:
A_hat (Polynomial) – polynomial
error (float) – tolerated error, defaults to 0.001
- Returns:
including the following elements - leading coefficient of
- list of roots of such that there exist no two roots that are complex conjugates- Return type:
Tuple
- paddle_quantum.qsvt.qsp.poly_Q_generation(leading_coef, roots, parity)
function for polynomial
generation- Parameters:
leading_coef (float) – leading coefficient of
roots (List[float]) – filtered list of roots of
parity (int) – parity that affects decomposition
- Returns:
polynomial
- Return type:
Polynomial
- paddle_quantum.qsvt.qsp.alg_find_Q(poly_p, k)
The algorithm of finding
by theorem 4 in paper https://arxiv.org/abs/1806.01838- Parameters:
poly_p (Polynomial) – polynomial
k (int) – length of returned array
- Returns:
polynomial
- Return type:
Polynomial
- paddle_quantum.qsvt.qsp.quantum_signal_processing(poly_p, length=None)
Compute
that transfer a block encoding of x to a block encoding of by- Parameters:
poly_p (Polynomial) – polynomial
length (int | None) – length of returned array, defaults to None to be the degree of
- Returns:
array of
’s- Return type:
ndarray
- paddle_quantum.qsvt.qsp.reflection_based_quantum_signal_processing(P)
Reflection-based quantum signal processing, compute Phi that transfer a block encoding of x to a block encoding of
with . Refer to Corollary 8 in the paper.- Parameters:
P (Polynomial) – polynomial
- Returns:
array of
’s- Return type:
ndarray
- class paddle_quantum.qsvt.qsp.ScalarQSP(poly_p, length=None)
Bases:
object
- block_encoding(signal_x)
generate a block encoding of
by quantum circuit- Parameters:
x – input parameter
- Returns:
a quantum circuit of unitary that is the block encoding of
- Return type:
- block_encoding_matrix(signal_x)
generate a block encoding of
for verification- Parameters:
x – input parameter
- Returns:
a block encoding unitary of
- Return type:
Tensor