View on GitHub
Open this notebook in GitHub to run it yourself
qsvt
Arguments:
phase_seq: CArray[CReal]- a sized sequence of phase angles.proj_cnot_1: QCallable[QArray[QBit], QBit]- projector-controlled-not unitary that locates the encoded matrix columns within .
qvar, and a qubit that is set to when the state is in the block.
proj_cnot_2: QCallable[QArray[QBit], QBit]- projector-controlled-not unitary that locates the encoded matrix rows within .
qvar, and a qubit that is set to when the state is in the block.
u: QCallable[QArray[QBit]]- a block encoding unitary of a matrix , such that .qvar: QArray[QBit]- the quantum variable on which applies, which resides in the entire block encoding space.aux: QBit- a zero auxilliary qubit, used for the projector-controlled-phase rotations.
Example: polynomial transformation on a block encoding
The following example implements a random polynomial transformation on a given block, based on [2]. The unitary here is a square-root transformation: where is a fixed-point variable in the range . The example samples a random odd-polynomial, calculates the necessary phase sequence, then applies the qsvt and verifies the results. There are 2 distinct projector-controlled-not unitaries - one is applying on the entire variable, and the second is on the 1-qubits auxilliary in the image.Output:
Output:
