Quantum Circuit for Non-Unitary Linear Transformation of Basis Sets Guorui Zhu, Joel Bierman, Jianfeng Lu, Yingzhou Li Abstract This paper introduces a novel approach to implementing non-unitary linear transformations of basis on quantum computational platforms, a significant leap beyond the conventional unitary methods. By integrating Singular Value Decomposition (SVD) into the process, the method achieves an operational depth of O ⁡ ( n ) O(n) with about n n ancilla qubits, enhancing the computational capabilities for analyzing fermionic systems. The non-unitarity of the transformation allows us to transform a wave function from one basis to another, which can span different spaces. By this trick, we can calculate the overlap of two wavefunctions that live in different (but non-distinct Hilbert subspaces) with different basis representations. This provides the opportunity to use state specific ansatzes to calculate different energy eigenstates under orbital-optimized settings and may improve the accuracy when computing the energies of multiple eigenstates simultaneously in VQE or other framework. It allows for a deeper exploration of complex quantum states and phenomena, expanding the practical applications of quantum computing in physics and chemistry. I Introduction Solving many-body Schrödinger equation is one of the most promising applications on quantum computers, especially in the era of noisy intermediate-scale and early fault-tolerant quantum computing. Quantum algorithms that could be applied to solve the many-body Schrödinger equation include but not limited to variational quantum algorithms (VQAs) [ 1 , 2 , 3 , 4 ] , quantum phase estimation (QPE) [ 5 , 6 , 7 , 8 ] , quantum simulation [ 9 ] , etc. On digital quantum computers, the many-body Schrödinger equation first needs to be discretized on a basis set, and then the discretized operator and wavefunction need to be represented by quantum circuits and a quantum state, respectively. Throughout the computation, when a change of basis set is performed, i.e., a linear transformation of the basis set, we could either recalculate coefficients on classical computer and restart the quantum algorithm, or carry out the linear transformation via a quantum circuit. Implementing quantum circuit for the linear transformation is mandatory under various scenarios, e.g., calculating the inner product between two many-body wavefunctions discretized by different basis sets. When two basis sets are unitary linear transformations of each other, the corresponding linear transformation is unitary and the quantum circuit has been studied in [ 10 , 11 , 12 ] . When two basis sets are not unitary linear transformations of each other, the corresponding linear transformation is non-unitary, for which the quantum circuit implementation is proposed by this paper. Unitary linear transformation of basis set plays an important role in quantum physics and chemistry. Hartree-Fock method [ 13 , 14 , 15 , 16 , 17 , 18 , 19 ] looks for the optimal unitary linear transformation of basis set such that the single Slater determinant minimizes the energy of the many-body Hamiltonian operator. Unitary linear transformations of basis set are also used widely in basis set optimization methods, e.g., natural orbital rotation [ 15 , 16 , 17 , 18 , 19 ] , complete active space self-consistent field method (CASSCF) [ 20 , 21 , 22 , 23 , 24 , 25 , 26 , 27 , 28 , 29 , 30 , 31 , 32 , 33 , 34 ] , optimal orbital full configuration interaction (OptOrbFCI) [ 35 ] , etc. Such unitary linear transformations of basis sets are combined with quantum algorithms for ground state calculation [ 36 , 37 , 38 , 39 ] to boost the power of quantum computer and pursuing the infinite basis set limit. The unitary linear basis transformation can also be adopted in quantum algorithms for excited states calculation [ 37 , 38 , 40 ] as long as they use the same basis set to represent both ground state and low-lying excited states of the system. Several prior works studied the quantum circuit implementation of the unitary linear transformation of basis set. The unitary coupled cluster (UCC) method [ 41 , 42 , 43 , 44 , 45 ] , particularly with single excitation operators, is widely used as parameterized ansatz circuits for wavefunctions. UCC is achieved by employing an operator e^{\hat{T}} , where \hat{T} is anti-Hermitian and represented as \sum_{i0\} be the rank of the nonunitary matrix u . Then we have \sigma_{i}>0 for i=1,\dots,r and \sigma_{i}=0 for i=r+1,\dots,n . Noting that \boldsymbol{\nu}_{j} with \sigma_{j}=0 is the projection that projects qubit q_{j} onto \ket{0} state. Thus, the composition of operators \prod_{i=r+1}^{n}\boldsymbol{\nu}_{i} is the projection that projects qubits indexed from r+1 to n to \ket{0 \cdots 0} . It can be implemented as a X gate combined with a multi-open-controlled Toffoli gate. More specifically, given an ancilla qubit at state \ket{0} and working qubits q_{r+1},\dots,q_{n} , we first flip the ancilla qubit to state \ket{1} via an X gate. Then targeting the ancilla qubit, we apply a multi-open-controlled Toffoli gate controlled from all working qubits q_{r+1},\dots,q_{n} . Open-controlled gate means that the gate is applied only if the controlling qubits are in state \ket{0 \cdots 0} . After these two gates, the quantum state will be linear combination of \ket{0}\ket{0\cdots 0}\quad\text{and}\quad\ket{1}\ket{0\cdots 0}_{\perp}, where the first qubit is ancilla, the rest are working qubits q_{r+1},\dots,q_{n} , and \ket{0 \cdots 0}_{\perp} is a state perpendicular to \ket{0 \cdots 0} . Hence, applying a measurement with selected result, i.e., projecting the ancilla qubit to \ket{0} , will turn all working qubits q_{r+1},\dots,q_{n} to state \ket{0} . Thus, such a quantum circuit is the block encoding as we need. This scheme reduces the number of ancilla qubits down to one for low-rank linear transformations u . However, the actual quantum circuit depth in implementing the multi-open-controlled Toffoli gate depends on the underlying quantum computer hardware, which is beyond the scope of this paper. Figure 4 illustrates the detailed quantum circuit for the case \sigma=0 . \tilde{\sigma}_{1}=1,q_{1} J_{\psi}U(R;\psi)J_{\psi}^{-1} J_{\psi}U(R;\psi)J_{\psi}^{-1} J_{\psi}U(L;\psi)J_{\psi}^{-1} J_{\psi}U(L;\psi)J_{\psi}^{-1} \tilde{\sigma}_{2}=1,q_{2} 0<\tilde{\sigma}_{3}<1,q_{3} 0<\tilde{\sigma}_{4}<1,q_{4} 0<\tilde{\sigma}_{5}<1,q_{5} \tilde{\sigma}_{6}=0,q_{6} \tilde{\sigma}_{7}=0,q_{7} \tilde{\sigma}_{8}=0,q_{8} a_{3}=\ket{0} RY(\theta_{3}) RY(\theta_{3}) A A \ket{0} \ket{0} a_{4}=\ket{0} RY(\theta_{4}) RY(\theta_{4}) A A \ket{0} \ket{0} a_{5}=\ket{0} RY(\theta_{5}) RY(\theta_{5}) A A \ket{0} \ket{0} a_{6}=\ket{0} X X X X A A \ket{0} \ket{0} Figure 5: An example for a nonunitary matrix u of dimension 8 with approximated singular values \tilde{\sigma}_{1}=\tilde{\sigma}_{2}=1 , 1>\tilde{\sigma}_{3}\geq\tilde{\sigma}_{4}\geq\tilde{\sigma}_{5}>0 , and \tilde{\sigma}_{6}=\tilde{\sigma}_{7}=\tilde{\sigma}_{8}=0 . This quantum circuit is the approximated block encoding of \wedge\boldsymbol{u} . As discussed above, both cases \sigma=1 and \sigma=0 lead to more quantum resource efficient circuit implementation than that of case 0<\sigma<1 . Hence, naturally, we consider rounding up some large singular values to one and truncating some small singular values to zero. Although both rounding up and truncating reduce the quantum resource cost, both of them would introduce approximation errors. Denote the modification on the j -th singular values as \epsilon_{j} . The approximation error introduced by both the rounding-up and truncating could be bounded as, \displaystyle\norm{\otimes_{j = 1}^n \begin{pmatrix} 1 & 0\\ 0 & \sigma_j + \epsilon_j \end{pmatrix} - \otimes_{j = 1}^n \begin{pmatrix} 1 & 0\\ 0 & \sigma_j \end{pmatrix}}\leq\sum_{j=1}^{n}\epsilon_{j}, where the matrix 2-norm is used. Let \tilde{u} denote the matrix that shares the same singular vectors as u , but has rounded up or truncated singular values, i.e., \tilde{u}_{ij}=\sum_{k=1}^{n}\tilde{\sigma}_{k}L_{ik}R_{kj}=\sum_{k=1}^{n}(\sigma_{k}+\epsilon_{k})L_{ik}R_{kj} . In this context, the error of approximated wedge operator can be bounded more concisely as, \norm{\wedge\bu- \wedge\tilde{\bu}}\leq\sum_{j=1}^{n}\epsilon_{j}. (22) Therefore, the overall approximation error could be well-controlled if all \epsilon_{j} s are small. Finally, we assemble all above techniques together and propose the quantum circuit construction of a non-unitary linear transformation \wedge\boldsymbol{u} . To incorporate the rounding-up and truncating techniques, we introduce a threshold \varepsilon . The quantum circuit for the non-unitary linear transformation \wedge\boldsymbol{u} can be approximately implemented as follows. 1. Calculate the SVD of u , i.e., u_{ij}=\sum_{k=1}^{n}\sigma_{k}L_{ik}R_{kj} , with singular values \sigma_{i} s in non-increasing ordering. 2. Round up large singular values of u and truncate small singular values of u , i.e., \tilde{\sigma}_{i}=\begin{cases}1&\sigma_{i}\geq 1-\varepsilon\\ \sigma_{i}&\varepsilon<\sigma_{i}<1-\varepsilon\\ 0&\sigma_{i}\leq\varepsilon\\ \end{cases}. Let the number of \tilde{\sigma}_{i}=1 be s and the rank after truncation be r . 3. Prepare r-s+1 ancilla qubits to state \ket{0} , denote them as a_{s+1},a_{s+1},\dots,a_{r+1} . 4. Apply the unitary operator J_{\psi}U(R;\psi)J_{\psi}^{-1} to the n working qubits following the circuit construction in Section II . 5. Apply controlled-RY gates controlling from q_{i} targeting a_{i} for i=s+1,\dots,r . 6. Apply an X gate to flip ancilla qubit a_{r+1} and then apply a multi-open-controlled Toffoli gate controlling from q_{r+1},\dots,q_{n} targeting a_{r+1} . 7. Apply the unitary operator J_{\psi}U(L;\psi)J_{\psi}^{-1} to the n working qubits following the circuit construction in Section II . 8. Project all ancilla qubits to \ket{0} state via measurement and post-selection. In Fig. 5 , we provide the quantum circuit for a non-unitary matrix u of dimension 8 . After the rounding-up and truncating, the approximated non-unitary matrix has 2 singular values equal to 1 and of rank 5 . Remark. If we remove step 8 and stop at step 7 , we actually obtain the quantum circuit corresponding to the block encoding of \wedge\boldsymbol{u} . Block-encoding is a standard framework used to embed non-unitary matrices into unitary matrices, allowing them to be implemented as quantum circuits along with some measurements [ 68 ] . In the next section, we will discuss how to use the block-encoding we provided here in the context of calculating inner products. The quantum circuit depth and the number of gates can be estimated based on the matrix dimension n , approximated number of ones s and approximated rank r . The dimension of L and R are both n . And the numbers of gates, as in Section II for the unitary case, are bounded by \frac{n^{2}}{2}+O(n) rotation gates ( 18 ) and n^{2}+O(n) phase gates. When qubits are assumed to be linearly connected, the circuit depths for L and R are bounded by O(n) times the rotation gate depth. The number of gates for the \prod_{k=1}^{n}\boldsymbol{\nu}_{k} part depends on the gate counting of the multi-open-controlled Toffoli gate. The quantum circuit for the singular value part costs r-s+2 simple gates and one multi-open-controlled Toffoli gate. The circuit depth is bounded by that of the multi-open-controlled Toffoli gate. Applying the standard decomposition as in [ 8 ] , an additional ancilla qubit is used, and the quantum circuit depth is O((n-r)^{2}) for n-r being the number of controlling qubits. Overall, the total quantum circuit depth is bounded by O({(n-r)}^{2}+n) . IV Inner product: An application We consider two sets of one-body bases, \{\ket{\psi_i}\}_{i=1}^{n} and \{\ket{\phi_j}\}_{j=1}^{n} . The inner products between all pairs of bases \ket{\psi_i} and \ket{\phi_j} are available and denoted as u_{ij} , i.e., u_{ij}=\innerproduct{\psi_i}{\phi_j} , for 1\leq i,j\leq n . For the sake of notation, we assume two bases are of the same dimension n . Our proposed algorithm could be easily extended to two bases of different dimensions. Two many-body states are denoted as \ket{\Psi} and \ket{\Phi} , i.e., \displaystyle\ket{\Psi} \displaystyle=\sum_{1\leq i_{1}