Skip to content

Qsvt

qsvt

qsvt(
    phase_seq: CArray[CReal],
    proj_cnot_1: QCallable[QArray[QBit], QBit],
    proj_cnot_2: QCallable[QArray[QBit], QBit],
    u: QCallable[QArray[QBit]],
    qvar: QArray[QBit],
    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 \(\phi_1, \phi_2, ..., \phi_{d+1}\) and 2 projector-controlled-not operands \(C_{\Pi}NOT,C_{\tilde{\Pi}}NOT\), the QSVT sequence is as follows: Given a unitary \(U\), a list of phase angles \(\phi_1, \phi_2, ..., \phi_{d+1}\) and 2 projector-controlled-not operands \(C_{\Pi}NOT,C_{\tilde{\Pi}}NOT\), the QSVT sequence is as follows:

\[ \tilde{\Pi}_{\phi_{d+1}}U \prod_{k=1}^{(d-1)/2} (\Pi_{\phi_{d-2k}} U^{\dagger}\tilde{\Pi}_{\phi_{d - (2k+1)}}U)\Pi_{\phi_{1}} \]

for odd \(d\), and:

\[ \prod_{k=1}^{d/2} (\Pi_{\phi_{d-(2k-1)}} U^{\dagger}\tilde{\Pi}_{\phi_{d-2k}}U)\Pi_{\phi_{1}} \]

for even \(d\).

Each of the \(\Pi\)s is a projector-controlled-phase unitary, according to the given projectors.

Parameters:

Name Type Description Default
phase_seq CArray[CReal]

A sequence of phase angles of length d+1.

required
proj_cnot_1 QCallable[QArray[QBit], QBit]

Projector-controlled-not unitary that locates the encoded matrix columns within U. Accepts a quantum variable of the same size as qvar, and a qubit that is set to |1> when the state is in the block.

required
proj_cnot_2 QCallable[QArray[QBit], QBit]

Projector-controlled-not unitary that locates the encoded matrix rows within U. Accepts a quantum variable of the same size as qvar, and a qubit that is set to |1> when the state is in the block.

required
u QCallable[QArray[QBit]]

A block encoded unitary matrix.

required
qvar QArray[QBit]

The quantum variable to which U is applied, which resides in the entire block encoding space.

required
aux QBit

A zero auxilliary qubit, used for the projector-controlled-phase rotations. Given as an inout so that qsvt can be used as a building-block in a larger algorithm.

required