Interactive quantum computing
Quantum Singular Value Transformation
This laboratory computes an SVD and a unitary dilation, explores scalar QSP phase synthesis, and displays the target singular-value transformation. The scalar sequence uses the full complex upper-left entry. Feasibility checks and numerical fitting are reported separately; the displayed matrix transformation is calculated from the SVD, rather than from an assembled QSVT circuit.
Specification of the Input Matrix $A$
The framework supports any real matrix of dimensions $m\times n$ with $m,n\in\{2,3\}$, covering both square and rectangular cases.
Quantitative Summary of $A$
Stage I · Singular Value Decomposition: $A = U\,\Sigma\,V^{\dagger}$
The Singular Value Decomposition expresses an arbitrary $m\times n$ matrix as the composition of an input rotation, a diagonal stretch, and an output rotation. The SVD identifies the input and output singular directions. An odd singular-value transformation maps right singular vectors to left singular vectors; an even transformation acts within a chosen singular space, as shown in Stage IV.
Computational procedure (click to expand)
- Form the Gram matrix $M = A^{\dagger} A$, which is symmetric positive semidefinite of order $n$.
- Diagonalise $M$ via the cyclic Jacobi eigenvalue algorithm to obtain orthonormal eigenvectors and non-negative eigenvalues $\lambda_i$.
- Define the singular values $\sigma_i = \sqrt{\lambda_i}$ and assemble $V$ from the eigenvectors of $M$.
- Compute the columns of $U$ via $u_i = A v_i / \sigma_i$ for $\sigma_i > 0$, and complete the orthonormal basis by Gram–Schmidt where necessary.
- If $m < n$ the procedure is applied to $A^{\dagger}$ and the resulting factors are transposed accordingly.
Stage II · Block Encoding of $A$ within a Unitary Dilation
A non-unitary operator cannot be implemented directly on a quantum register. We therefore embed $A$, after sub-normalisation by a constant $\alpha \ge \lVert A\rVert_2$, as the upper-left block of a larger unitary operator $U_A$ acting on the system together with one or more ancillary qubits. The original matrix is recovered by projecting the ancilla onto $|0\rangle$: $$\bigl(\langle 0^{a}|\otimes I\bigr)\,U_A\,\bigl(|0^{a}\rangle\otimes I\bigr) \;=\; A/\alpha.$$ For an $m\times n$ block $B = A/\alpha$ with $\lVert B\rVert\le 1$, the canonical cosine–sine dilation is $$U_A=\begin{bmatrix} B & \sqrt{I_m - B B^{\dagger}}\\[2pt] \sqrt{I_n - B^{\dagger} B} & -B^{\dagger}\end{bmatrix}\in\mathbb{R}^{(m+n)\times(m+n)}.$$ This construction is exactly unitary whenever $\lVert B\rVert\le 1$.
Stage III · Quantum Signal Processing and the Phase Angles $\vec\phi$
Quantum Signal Processing realises a polynomial transformation of a scalar variable $x\in[-1,1]$ via an alternating sequence of two single-qubit rotations: $$U_{\vec\phi}(x)=S(\phi_0)\,W(x)\,S(\phi_1)\,W(x)\cdots W(x)\,S(\phi_d),$$ where
Signal rotation $W(x)$: encodes the parameter
$W(x) = e^{i\arccos(x)\,\sigma_x}$. The signal $x$ is the only non-tunable input; it will later play the role of a singular value $\sigma_i/\alpha$.
Phase shift $S(\phi)$: the tunable knob
$S(\phi) = e^{i\phi\sigma_z}$. The angles $\phi_0,\dots,\phi_d$ are the programmable degrees of freedom that determine which polynomial is realised.
Selection of the polynomial $P(x)$
Selected polynomial
QSP in the full-entry convention
This page fits $[U_{\vec\phi}(x)]_{1,1}=P(x)$ as a complex equality. For $d$ signal calls, exact synthesis exists if and only if there is a polynomial $Q$ with $\deg P\le d$, $\deg Q\le d-1$, respective parities $d$ and $d-1$, and $$|P(x)|^2+(1-x^2)|Q(x)|^2=1\quad(x\in[-1,1]).$$ For $d=0$, $Q=0$ and $P$ is a constant of modulus one.
Equivalently, the degree and parity requirements on $P$ must hold together with $|P(x)|\le1$ for $x\in[-1,1]$, $|P(x)|\ge1$ for real $|x|\ge1$, and, when $d$ is even, $|P(iy)|\ge1$ for every real $y$. These are global conditions. In particular, $|P(\pm1)|=1$, and even sequences also require $|P(0)|=1$. See Gilyén et al., Theorems 3–4.
For a real polynomial, degree, parity, and the bound on $[-1,1]$ are sufficient for a real-part construction, $\operatorname{Re}[U_{\vec\phi}(x)]_{1,1}=P(x)$. That construction can have a nonzero imaginary part and needs a suitable extraction circuit when used as a matrix block. It is a different target from the equality fitted here.
The checks below use exact rational arithmetic on the entered decimal coefficients to find obstructions. Passing a finite set of probes is not a proof of the global conditions. The Adam search is a numerical demonstration and may fail for a feasible target.
Phase-Angle Computation
The optimiser minimises the empirical $L^{2}$ loss $$\mathcal{L}(\vec\phi)\;=\;\frac{1}{N}\sum_{k=1}^{N}\Bigl|\;\bigl[U_{\vec\phi}(x_k)\bigr]_{1,1}\;-\;P(x_k)\Bigr|^{2}$$ on a uniform grid $\{x_k\}\subset[-1,1]$. The optimisation is performed entirely in the browser; click the button below to (re)run it.
Numerical Check of the QSP Product
For a numerical candidate, we construct $U_{\vec\phi}(x)$ at the selected point and compare its full complex entry with the target. A separate 257-point validation grid includes both endpoints. These checks report approximation error; they do not prove equality over a continuum.
Explicit product $U_{\vec\phi}(x)$ at the chosen $x$
The boxed entry is the complex $(1,1)$ position. Both its real and imaginary parts enter the error.
Comparison: $[U_{\vec\phi}(x)]_{1,1}$ vs. $P(x)$ across the interval
Stage IV · Quantum Singular Value Transformation
The scalar QSP structure can be lifted to a projected unitary encoding by alternating the encoding and its adjoint with phases on the appropriate input and output projectors. The phase convention must be converted consistently. For odd $P$, the target is $U P(\Sigma/\alpha)V^{\dagger}$, an $m\times n$ map. For even $P$, the right-space target is $V P(\Sigma_R/\alpha)V^{\dagger}$, an $n\times n$ operator, where $\Sigma_R$ includes zero singular values on the input kernel.
The matrix below is the target computed directly from the SVD. This page does not assemble or verify the lifted QSVT circuit. Its value remains a target calculation when Stage III diagnoses an impossible full-entry target or fails to find phases.
Numerical Verification
Three structural invariants are checked on every refresh: orthogonality of $U$ and $V$, non-negativity of $\sigma_i$, and the unitarity of the dilation $U_A$.