Functions:
qsvt_step
qsvt_step(
phase1: CReal,
phase2: CReal,
proj_cnot_1: QCallable[QBit],
proj_cnot_2: QCallable[QBit],
u: QCallable,
aux: QBit
) -> None
[Qmod Classiq-library function]
Applies a single QSVT step, composed of 2 projector-controlled-phase rotations, and applications of the block encoding unitary u and its inverse:
Πϕ2U†Π~ϕ1U
Parameters:
qsvt
qsvt(
phase_seq: CArray[CReal],
proj_cnot_1: QCallable[QBit],
proj_cnot_2: QCallable[QBit],
u: QCallable,
aux: QBit
) -> None
[Qmod Classiq-library function]
Implements the Quantum Singular Value Transformation (QSVT) - an algorithmic framework, used to apply polynomial transformations of degree d on the singular values of a block encoded matrix, given as the unitary u. Given a unitary U, a list of phase angles ϕ1,ϕ2,...,ϕ{d+1} and 2 projector-controlled-not operands C{Π}NOT,C{{~Π}}NOT, the QSVT sequence is as follows:
Given a unitary U, a list of phase angles ϕ1,ϕ2,...,ϕ{d+1} and 2 projector-controlled-not operands C{Π}NOT,C{{~Π}}NOT, the QSVT sequence is as follows:
Π~ϕd+1Uk=1∏(d−1)/2(Πϕd−2kU†Π~ϕd−(2k+1)U)Πϕ1
for odd d, and:
k=1∏d/2(Πϕd−(2k−1)U†Π~ϕd−2kU)Πϕ1
for even d.
Each of the Πs is a projector-controlled-phase unitary, according to the given projectors.
Parameters:
projector_controlled_phase
projector_controlled_phase(
phase: CReal,
proj_cnot: QCallable[QBit],
aux: QBit
) -> None
[Qmod Classiq-library function]
Assigns a phase to the entire subspace determined by the given projector. Corresponds to the operation:
\Pi_{\phi} = (C_{\Pi}NOT) e^{-irac{\phi}{2}Z}(C_{\Pi}NOT)
Parameters:
qsvt_inversion
qsvt_inversion(
phase_seq: CArray[CReal],
block_encoding_cnot: QCallable[QBit],
u: QCallable,
aux: QBit
) -> None
[Qmod Classiq-library function]
Implements matrix inversion on a given block-encoding of a square matrix, using the QSVT framework. Applies a polynomial approximation
of the inverse of the singular values of the matrix encoded in u. The phases for the polynomial should be pre-calculated and passed into the function.
Parameters:
projector_controlled_double_phase
projector_controlled_double_phase(
phase_even: CReal,
phase_odd: CReal,
proj_cnot: QCallable[QBit],
aux: QBit,
lcu: QBit
) -> None
[Qmod Classiq-library function]
Assigns 2 phases to the entire subspace determined by the given projector, each one is controlled differentely on a given lcu qvar.
Used in the context of the qsvt_lcu function. Corresponds to the operation:
Πϕodd,ϕeven=(CΠNOT)(Clcu=1e−i2ϕevenZ)(Clcu=0e−i2ϕoddZ)(CΠNOT)
Parameters:
qsvt_lcu_step
qsvt_lcu_step(
phases_even: CArray[CReal],
phases_odd: CArray[CReal],
proj_cnot_1: QCallable[QBit],
proj_cnot_2: QCallable[QBit],
u: QCallable,
aux: QBit,
lcu: QBit
) -> None
[Qmod Classiq-library function]
Applies a single QSVT-lcu step, composed of 2 double phase projector-controlled-phase rotations, and applications of the block encoding unitary u and its inverse:
(Clcu=1Πϕ2even)(Clcu=0Πϕ2odd)U†(Clcu=1Π~ϕ1even)(Clcu=0Π~ϕ1odd)U
Parameters:
qsvt_lcu
qsvt_lcu(
phase_seq_even: CArray[CReal],
phase_seq_odd: CArray[CReal],
proj_cnot_1: QCallable[QBit],
proj_cnot_2: QCallable[QBit],
u: QCallable,
aux: QBit,
lcu: QBit
) -> None
[Qmod Classiq-library function]
Implements the Quantum Singular Value Transformation (QSVT) for a linear combination of odd and even polynomials, so that
it is possible to encode a polynomial of indefinite parity, such as approximation to exp(i*A) or exp(A). Should work
for Hermitian block encodings.
The function is equivalent to applying the qsvt function for odd and even polynomials with a LCU function, but
is more efficient as the two polynomials share the same applications of the given unitary.
The function is intended to be called within a context of LCU, where it is called as the SELECT operator, and wrapped
with initialization of the lcu qubit to get the desired combination coefficients.
The even polynomial corresponds to the case where the lcu=∣0⟩, while the odd to lcu=∣1⟩.
Note: the two polynomials should have the same degree up to a difference of 1.
Parameters:
gqsp
gqsp(
u: QCallable,
aux: QBit,
phases: CArray[CArray[CReal, Literal[3]]],
negative_power: CInt
) -> None
Implements Generalized Quantum Signal Processing (GQSP), which realizes a
(Laurent) polynomial transformation of degree d on the eigenvalues of the given
signal unitary u. The protocol is according to https://arxiv.org/abs/2308.01501
Fig.2.
Notes:
- The user is encouraged to use the function
gqsp_phases to find phases that
correspond to the wanted polynomial transformation.
- Feasibility: the target polynomial must satisfy ∣P(e{i∗theta})∣ <= 1 for all
theta in [0,2∗pi). This ensures a unitary completion exists.
- Using
negative_power = m (m >= 0) you can realize Laurent polynomials with
negative exponents: the implemented transform is equivalent to applying
z{−m}∗P(z) (i.e., shift the minimal degree to -m).
For ordinary (non-Laurent) polynomials, set negative_power = 0.
Parameters: