Skip to main content

View on GitHub

Open this notebook in GitHub to run it yourself
The Quantum Singlar Value Transformation (QSVT) [1] is an algorithmic framework, used to apply polynomial transformation on the singular values of a block encoded matrix. It has wide range of applications such as matrix inversion, amplitude amplification and hamiltonian simulation. Given a unitary UU, a list of phase angles ϕ1,ϕ2,...,ϕd+1\phi_1, \phi_2, ..., \phi_{d+1} and 2 projector-controlled-not operands CΠNOT,CΠ~NOTC_{\Pi}NOT,C_{\tilde{\Pi}}NOT , the QSVT sequence is as follows: Π~ϕd+1Uk=1(d1)/2(Πϕd2kUΠ~ϕd(2k+1)U)Πϕ1\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 dd, and: k=1d/2(Πϕd(2k1)UΠ~ϕd2kU)Πϕ1\prod_{k=1}^{d/2} (\Pi_{\phi_{d-(2k-1)}} U^{\dagger}\tilde{\Pi}_{\phi_{d-2k}}U)\Pi_{\phi_{1}} for even dd. Each of the projector-controlled-phase unitaries Π\Pi consists of a ZZ rotation of an auxilliary qubit wrapped by the CΠNOTC_{\Pi}NOTs, NOTing the auxilliary qubit: Πϕ=(CΠNOT)eiϕ2Z(CΠNOT)\Pi_{\phi} = (C_{\Pi}NOT) e^{-i\frac{\phi}{2}Z}(C_{\Pi}NOT) The transformation will result with a polynomial of order dd. Function: qsvt Arguments:
  • phase_seq: CArray[CReal] - a d+1d+1 sized sequence of phase angles.
  • proj_cnot_1: QCallable[QArray[QBit], QBit] - projector-controlled-not unitary that locates the encoded matrix columns within UU.
Accepts quantum variable of the size of qvar, and a qubit that is set to 1|1\rangle 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 UU.
Accepts quantum variable of the size of qvar, and a qubit that is set to 1|1\rangle when the state is in the block.
  • u: QCallable[QArray[QBit]] - UU a block encoding unitary of a matrix AA, such that A=Π~UΠA = \tilde{\Pi}U\Pi.
  • qvar: QArray[QBit] - the quantum variable on which UU applies, which resides in the entire block encoding space.
  • aux: QBit - a zero auxilliary qubit, used for the projector-controlled-phase rotations.
Given as an input so that qsvt can be used as a building-block in a larger algorithm.

Example: Polynomial Transformation on a (x)\sqrt(x) Block Encoding

The following example implements a random polynomial transformation on a given block, based on [2]. The unitary UU here is a square-root transformation: Uxn0n+1=xn(xψ0n0+1xψ1n1)U|x\rangle_n|0\rangle_{n+1} = |x\rangle_n(\sqrt{x}|\psi_0\rangle_{n}|0\rangle + \sqrt{1-x}|\psi_1\rangle_{n}|1\rangle) where xx is a fixed-point variable in the range [0,1)[0, 1). 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 (n+1)(n+1) variable, and the second is on the 1-qubits auxilliary in the image.
Output:
Output:
Output:
output

References

[1]: András Gilyén, Yuan Su, Guang Hao Low, and Nathan Wiebe. 2019. Quantum singular value transformation and beyond: exponential improvements for quantum matrix arithmetics. In Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of Computing (STOC 2019). Association for Computing Machinery, New York, NY, USA, 193-204 https://doi.org/10.1145/3313276.3316366. [2]: Stamatopoulos, Nikitas, and William J. Zeng. “Derivative pricing using quantum signal processing.” arXiv preprint arXiv:2307.14310 (2023).