Determining the ensemble N N -representability of Reduced Density Matrices Ofelia B. Oña, Gustavo E. Massaccesi, Pablo Capuzzi, Luis Lain, Alicia Torre, Juan E. Peralta, Diego R. Alcoba, Gustavo E. Scuseria Abstract The N N -representability problem for reduced density matrices remains a fundamental challenge in electronic structure theory. Following our previous work that employs a unitary-evolution algorithm based on an adaptive derivative-assembled pseudo‑Trotter variational quantum algorithm to probe pure-state N N -representability of reduced density matrices [J. Chem. Theory Comput. 2024, 20, 9968], in this work we propose a practical framework for determining the ensemble N N -representability of a p p -body matrix. This is accomplished using a purification strategy consisting of embedding an ensemble state into a pure state defined on an extended Hilbert space, such that the reduced density matrices of the purified state reproduce those of the original ensemble. By iteratively applying variational unitaries to an initial purified state, the proposed algorithm minimizes the Hilbert-Schmidt distance between its p p -body reduced density matrix and a specified target p p -body matrix, which serves as a measure of the N N -representability of the target. This methodology facilitates both error correction of defective ensemble reduced density matrices, and quantum-state reconstruction on a quantum computer, offering a route for density-matrix refinement. We validate the algorithm with numerical simulations on systems of two, three, and four electrons in both, simple models as well as molecular systems at finite temperature, demonstrating its robustness. keywords N -representability, ensemble state, reduced density matrix, variational approach, quantum algorithm † † affiliation: Instituto de Investigaciones Fisicoquímicas Teóricas y Aplicadas, Universidad Nacional de La Plata, Consejo Nacional de Investigaciones Científicas y Técnicas. Diag. 113 y 64 (S/N), Sucursal 4, CC 16, 1900 La Plata, Argentina † † affiliation: Departamento de Ciencias Exactas, Ciclo Básico Común, Universidad de Buenos Aires, Ciudad Universitaria, 1428 Buenos Aires, Argentina † † affiliation: Instituto de Investigaciones Matemáticas “Luis A. Santaló” (IMAS), Consejo Nacional de Investigaciones Científicas y Técnicas, Universidad de Buenos Aires. Ciudad Universitaria, 1428 Buenos Aires, Argentina † † affiliation: Universidad de Buenos Aires, Facultad de Ciencias Exactas y Naturales, Departamento de Física. Ciudad Universitaria, 1428 Buenos Aires, Argentina † † affiliation: CONICET - Universidad de Buenos Aires, Instituto de Física de Buenos Aires (IFIBA). Ciudad Universitaria, 1428 Buenos Aires, Argentina † † affiliation: Department of Physical Chemistry, Faculty of Science and Technology, University of the Basque Country. PO Box 644, E-48080 Bilbao, Spain † † affiliation: Department of Physical Chemistry, Faculty of Science and Technology, University of the Basque Country. PO Box 644, E-48080 Bilbao, Spain † † email: juan.peralta@cmich.edu † † affiliation: Department of Physics, Central Michigan University, Mount Pleasant, MI, 48859, USA † † email: dalcoba@df.uba.ar † † affiliation: Universidad de Buenos Aires, Facultad de Ciencias Exactas y Naturales, Departamento de Física. Ciudad Universitaria, 1428 Buenos Aires, Argentina † † affiliation: CONICET - Universidad de Buenos Aires, Instituto de Física de Buenos Aires (IFIBA). Ciudad Universitaria, 1428 Buenos Aires, Argentina † † email: guscus@rice.edu † † affiliation: Department of Chemistry, Rice University, Houston, TX 77005-1892 † † affiliation: Department of Physics and Astronomy, Rice University, Houston, TX 77005-1892 † † suppinfo: K 1 Introduction The significance of the N -representability problem in electronic structure theory is both foundational and far-reaching. 41 At the heart of this challenge lies the quest to determine the necessary and sufficient conditions that a p -body reduced density matrix ( p -RDM) must satisfy to be derivable from a N -electron wave function or mixed (ensemble) state. 39 ; 11 ; 12 ; 19 ; 29 ; 16 ; 15 ; 35 The special case of the 2-RDM is essential for the development of quantum chemistry computational methods. 11 ; 39 ; 14 Equally important, though often less emphasized, is the role of the 1-RDM in practical applications, such as in Hartree-Fock and density (matrix) functional theory, where the 1-RDM serves as a cornerstone for calculating observable properties. 28 ; 44 ; 45 Despite its theoretical interest, the N -representability problem presents formidable computational challenges. It belongs to the quantum Merlin-Arthur-complete class of problems: A quantum analog of the well-known nondeterministic polynomial-time complete class in classical complexity theory. 31 This classification implies that, in general, verifying whether a given p -RDM corresponds to a physical N -electron state is computationally intractable, especially as system size increases. Recent developments have led to sets of approximate N -representability conditions that, while not exhaustive, are sufficiently robust to enable meaningful calculations for strongly correlated electron systems, particularly in small to medium-sized molecules. 46 ; 2 ; 1 ; 3 ; 37 ; 38 ; 14 Moreover, Coleman 12 and Klyachko 27 ; 4 derived the necessary and sufficient N -representability conditions that must be fulfilled by the 1-RDM to be derivable from an ensemble or pure N -fermion quantum state, respectively. These conditions, which constrain the eigenvalues of the 1-RDM, offer a mathematically rigorous framework for identifying physically valid fermionic occupation numbers. 4 ; 39 ; 13 ; 47 ; 10 ; 56 ; 48 ; 50 ; 9 ; 5 ; 7 In recent work, we introduced an algorithm 33 designed to numerically determine whether a given p -body reduced density matrix ( p -RDM) is pure N -representable, or in other words, whether it can be obtained by tracing out (N-p) degrees of freedom from a pure N -body quantum state (i.e., a single wave function or pure-state density matrix). The proposed algorithm operates by guiding the unitary evolution of an ansatz wave function through its corresponding p -RDM towards a target matrix (alleged p -RDM), with the goal of minimizing their Hilbert-Schmidt distance (a measure of how close two matrices are in Hilbert space). The evolution (driven by stochastic sampling in that work) is inspired by the adaptive derivative-assembled pseudo-Trotter (ADAPT) framework, originally developed for the variational quantum eigensolver (VQE) problem, 20 and other approaches related to it, including the contracted quantum eigensolver. 49 ; 59 ; 61 ; 55 ; 30 ; 51 ; 62 ; 58 As such, the algorithm is suited for implementation on quantum devices. 20 ; 18 ; 8 We refer to this approach as pure ADAPT-VQA (Variational Quantum Algorithm), and its utility extends beyond mere classification. Not only can it determine whether a given matrix is a valid pure p -RDM, but it can also correct matrices that fail to meet the N -representability criteria. This dual capability makes the pure ADAPT-VQA a powerful tool for quantum simulations, offering a pathway to enforce physical constraints in quantum algorithms and potentially improve the accuracy of quantum chemical calculations. In this work, we address a critical extension of the N -representability problem, namely, its formulation for ensemble p -RDMs. 11 ; 39 While part of the existing literature focuses on pure-state representability, 4 ; 36 ; 39 ; 13 ; 47 ; 10 ; 56 ; 48 ; 50 ; 9 ; 5 ensemble states are equally important, especially in contexts involving thermal mixtures, open quantum systems, and statistical ensembles. 11 ; 39 To address this challenge, we employ a purification-based method in which the ensemble state is represented as a pure state within an expanded Hilbert space, 42 ; 24 which has been recently applied to finite temperature electronic systems through the thermofield theory. 21 ; 22 ; 23 This method ensures that the reduced density matrices of both the ensemble and its purified counterpart are identical, allowing us to leverage techniques developed for pure states. Specifically, we apply the pure ADAPT-VQA algorithm introduced in our previous work, 33 which enables the unitary evolution of the purified state to minimize the Hilbert-Schmidt distance between its p -RDM and a given target matrix. Building on this foundation, we introduce a new algorithm, the ensemble ADAPT-VQA, which extends the capabilities of its pure-state predecessor. This hybrid framework allows us not only to determine whether a p -body matrix is N -representable, but also to discern the nature of its origin: whether it arises from a pure quantum state or from an ensemble mixture of pure states. Such a distinction is crucial for interpreting quantum simulations and for enforcing physical constraints in variational algorithms. To validate the performance and versatility of ensemble ADAPT-VQA, we conduct numerical experiments on both model and molecular systems. Specifically, we test the algorithm on the 1-RDM and 2-RDM of four-electron systems at zero temperature, as well as on the \text{H}{\vphantom{\text{X}}}_{\smash[t]{\text{2}}} and \text{H}{\vphantom{\text{X}}}_{\smash[t]{\text{3}}} molecules at finite temperature. These examples demonstrate the ability of the algorithm to handle pure and thermal-state scenarios, highlighting its potential for broader applications in quantum chemistry and quantum information. 2 Theoretical Considerations Let us consider a quantum mixed (ensemble) state, \rho , defined on a finite-dimensional Hilbert space \mathscr{H}_{s} , which can be expressed as \rho=\sum_{i}p_{i}\ket{\phi_{i}}\bra{\phi_{i}}\,, (1) where \ket{\phi_{i}}\in\mathscr{H}_{s} are pure-state wave functions, and p_{i} probabilities satisfying p_{i}\geq 0 with \sum_{i}p_{i}=1 . According to the Schrödinger-Hughston-Jozsa-Wootters theorem, 26 any such mixed state \rho admits a purification: There exists an auxiliary finite-dimensional Hilbert space \mathscr{H}_{b} and a pure-state wave function \ket{\Psi_{sb}}\in\mathscr{H}_{sb} (with \mathscr{H}_{sb}=\mathscr{H}_{s}\otimes\mathscr{H}_{b} an extended Hilbert space), referred to as a purification of \rho , such that 42 \rho=\mathrm{Tr}_{b}\bigl(\ket{\Psi_{sb}}\bra{\Psi_{sb}}\bigr)\,, (2) where \mathrm{Tr}_{b} implies the complete trace over the degrees of freedom on the auxiliary Hilbert space \mathscr{H}_{b} . Moreover, every purification of \rho can be written in the form \ket{\Psi_{sb}}=\sum_{i}\sqrt{p_{i}}\,\ket{\phi_{i}}\otimes\ket{b_{i}}\,, (3) where \{\ket{b_{i}}\}_{i} is an orthonormal basis of \mathscr{H}_{b} . Thus, one can use this strategy to embed an ensemble state into a pure state defined in an extended Hilbert space, such that the p -RDMs of the purified ensemble are reproduced by those of the pure state. Eq. 3 provides a practical approach to numerically determine the ensemble N -representability of a p -RDM by unitarily evolving a pure state. This can be accomplished using an algorithm that has been recently introduced by us to deal with the pure N -representability problem. 33 Here we summarize the newly proposed algorithm employed for the ensemble case. The underlying idea is to find a sequence of unitary transformations that evolve an initial 2N -particle wave function \ket{\Psi_{0}} built according to Eq. 3 , e.g., \ket{\Psi_{0}}=\ket{\phi_{0}}\otimes\ket{\phi_{0}}\,, (4) with \ket{\phi_{0}} holding N particles. The evolution is such that the Hilbert-Schmidt distance \mathscr{D} between the p -RDM corresponding to the evolved state \ket{\Psi_{k}} , {}^{p}\rho_{k}=\,p!\binom{N}{p}\mathrm{Tr}_{N-p}\bigl(\mathrm{Tr}_{b}\bigl(\ket{\Psi_{k}}\bra{\Psi_{k}}\bigr)\bigr)\,, (5) and a given (possibly) ensemble N -representable target p -RDM, {}^{p}\rho_{\text{target}} , is minimized. The (squared) distance is calculated according to the Hilbert-Schmidt norm, \mathscr{D}_{k}=\|^{p}\rho_{k}-\,^{p}\rho_{{\text{target}}}\|_{2}^{2}\,. (6) At convergence, the ADAPT-VQA yields a minimum feasible distance for the problem at hand, \mathscr{D}_{\min} , and the state \ket{\Psi_{\min}} . Thus, if the algorithm evolves the distance \mathscr{D}_{k} to numerical zero, then {}^{p}\rho_{{\text{target}}} is ensemble N -representable. In general, \mathscr{D}_{\min} can be considered as a measure of the degree of ensemble N -representability of {}^{p}\rho_{\text{target}} , and the evolved {}^{p}\rho is an ensemble N -representable (physical) reduced state that is closest to {}^{p}\rho_{\text{target}} . Hence, the algorithm allows to correct the possible error associated with the lack of ensemble N -representability of {}^{p}\rho_{\text{target}} . The minimization algorithm employed in this work is schematized in Algorithm 1 . The procedure follows the schemes previously introduced by us to determine the N -representability of pure RDMs and transition RDMs. 33 ; 32 In the present work, we adopt the same gradient-based strategy utilized for transition RDMs, in combination with an antihermitian excitation-deexcitation operator pool \{\hat{O}\} suitable for fermions, 34 ; 43 ; 6 ; 17 \displaystyle\hat{O}_{ik} \displaystyle=\hat{a}_{i}^{\dagger}\hat{a}_{k}-\hat{a}_{k}^{\dagger}\hat{a}_{i},\;\; (7) and \displaystyle\hat{O}_{ijkl} \displaystyle=\hat{a}_{i}^{\dagger}\hat{a}_{j}^{\dagger}\hat{a}_{k}\hat{a}_{l}-\hat{a}_{k}^{\dagger}\hat{a}_{l}^{\dagger}\hat{a}_{i}\hat{a}_{j}\,, (8) for one- and two-particle excitations, respectively. In Eqs. 7 and 8 , \hat{a}^{\dagger} and \hat{a} are the usual fermionic creation and annihilation operators acting on an orthonormal finite single-particle basis associated to the extended Hilbert space \mathscr{H}_{sb} . Furthermore, since we opt to work on a canonical ensemble framework, the operator pool is restricted in such a way that no electronic transitions changing the number of particles in the system of interest nor in the auxiliary system are allowed. In practice, the operators in Eqs. 7 and 8 are represented as a combination of Pauli operators via the Jordan-Wigner transformation, 25 ensuring that the proposed algorithm is suitable for simulations on quantum computers. 57 Algorithm 1 Distance ( \mathscr{D} ) minimization algorithm Target {}^{p}\rho_{\text{target}} and initial state \ket{\Psi_{0}} defined over an extended Hilbert space \mathscr{H}_{sb} . \mathscr{D}_{\text{min}} , \ket{\Psi_{\text{min}}} . Prepare operator pool \{\hat{O}\} corresponding to \mathscr{H}_{sb} . procedure while k\delta do for \hat{O}\in\{\hat{O}\} do Minimize distance to the target {}^{p}\rho_{\text{target}} for \ket{\Psi}=e^{\theta\,\hat{O}}\ket{\Psi_{k-1}} with respect to \theta . end for Keep \hat{O}_{\text{min}} and the corresponding \theta_{\text{min}} that give the minimum distance \mathscr{D} . The new state is \ket{\Psi_{k}}=e^{\,\theta_{\text{min}}\,\hat{O}_{\text{min}}}\ket{\Psi_{k-1}} . \mathscr{D}_{k}\leftarrow\mathscr{D}_{\text{min}} , \ket{\Psi_{k}}\leftarrow\ket{\Psi_{\text{min}}} . k\leftarrow k+1 . end while end procedure 3 Computational Details The implementation of the algorithm described in the previous Section utilizes an in-house code written in Python that uses OpenFermion 40 for the Jordan–Wigner mapping and the OpenFermion module of PySCF 52 ; 53 for integral computation and manipulation. Computations reported in this work are carried out on a simulated noiseless quantum device. The original ensemble N -electron problem is embedded into a extended pure 2N -electron problem (Eq. 3 ). The former uses K spatial orbitals as single-particle basis, while the latter uses 2K orbitals. For the 4-electron model systems at zero temperature, we use K=3 and K=4 single-particle spatial orbitals, referred to as (4e,3o) and (4e,4o) hereafter, while for the \text{H}{\vphantom{\text{X}}}_{\smash[t]{\text{2}}} and \text{H}{\vphantom{\text{X}}}_{\smash[t]{\text{3}}} molecular systems at finite temperature we use STO-3G basis set ( K=2 and K=3 , respectively). This choice allows us to deal with 1- and 2-RDMs, which are commonly the most relevant for electronic structure problems, while keeping the computations tractable. This leads to a pool of 378 and 1196 operators for the (4e,3o) , (4e,4o) , respectively, while for the \text{H}{\vphantom{\text{X}}}_{\smash[t]{\text{2}}} and \text{H}{\vphantom{\text{X}}}_{\smash[t]{\text{3}}} molecular cases the number of operators in the pool is 72, and 378, respectively. The convergence threshold, \delta , in the iterative process (Algorithm 1 ) is varied within the range [5\times 10^{-9},3\times 10^{-5}] . A smaller \delta is used for stricter convergence requirements, such as for N -representable one-body targets, while \delta is increased for two-body targets and in cases of a stronger N -representability violation. Details of the number of iterations to reach convergence are available in the supporting information (SI). 4 Results and Discussion 4.1 Model systems at zero temperature Given a p -RDM, one can determine if it is pure N -representable utilizing the previously proposed pure ADAPT-VQA. If the p -RDM results non pure N -representable, one can utilize the ensemble ADAPT-VQA proposed in this work to determine its ensemble N -representability. Thus, the two algorithms serve to classify a p -RDM as pure or ensemble N -representable. We first test this idea to numerically determine if the 1 - and 2 -RDMs of two analytical model systems are pure or ensemble N -representable. To assess the validity of our numerical results, we make use of Klyachko’s N -representability inequalities (also known as generalized Pauli conditions), which provide a set of necessary and sufficient analytical constraints that pure 1 -RDMs must satisfy. 27 ; 4 For the (4e,3o) and (4e,4o) model systems, we construct target p -RDMs as {}^{p}\rho_{\text{target}}\,=\,p!\binom{N}{p}\mathrm{Tr}_{N-p}(\rho)\,, (9) where the state \rho is a convex linear combination of two pure states, \rho_{1} and \rho_{2} (shown in Table 1 ), \rho=w\;{\rho}_{1}+(1-w)\;{\rho}_{2}\qquad 0\leq w\leq 1\,. (10) The parameter w in Eq. 10 is set to a value of 0.0 or 0.5 for \rho representing either a pure, or mixed (ensemble) state, respectively. This choice is such that Klyachko’s conditions in the (4e,3o) model system are satisfied for both w=0.0 and w=0.5 , whereas in the (4e,4o) case, these conditions are satisfied only for w=0.0 (see Table S1 in the SI for the complete list of inequalities). Table 2 shows our results for the 1-RDM of the (4e,3o) and (4e,4o) model systems for w=0.0 and w=0.5 . In all cases, the initial state is taken as \rho_{1} for the pure case, or its purification for the ensemble case. For the (4e,3o) model system, the pure and ensemble ADAPT-VQA yield converged \mathscr{D}_{\min} that are numerically zero for both w values, indicating that there exists pure states that are compatible with the target 1-RDMs. This is consistent with the satisfaction of all Klyachko’s conditions, as shown in Table 2 . For the (4e,4o) model system, on the other hand, both the pure and ensemble ADAPT-VQAs yield converged \mathscr{D}_{\min}\approx 0 for w=0.0 , while for w=0.5 (for which Klyachko’s conditions are not fulfilled), \mathscr{D}_{\min} approaches zero only for the ensemble algorithm. This highlights the ability of the algorithms to discern the pure or ensemble N -representability nature of 1-RDMs. Table 2 also reports the number of Klyachko’s inequalities that are satisfied for each case. We note that all targets are identified as ensemble N -representable by the ensemble ADAPT-VQA, in agreement with the fulfillment of Coleman’s ensemble N -representability conditions (1-RDM eigenvalues between 0 and 1, and tracing to the number of electrons). 12 Table 1: States used to construct the target RDMs for the (4e,3o) and (4e,4o) model systems in Eq. 2 . State Model system \rho_{1} \rho_{2} ( 4e,3o ) |1^{\alpha}\;1^{\beta}\;2^{\alpha}\;2^{\beta}\rangle |1^{\alpha}\;1^{\beta}\;3^{\alpha}\;3^{\beta}\rangle ( 4e,4o ) |1^{\alpha}\;1^{\beta}\;2^{\alpha}\;2^{\beta}\rangle |1^{\alpha}\;1^{\beta}\;3^{\alpha}\;2^{\beta}\rangle Table 2: Converged \mathscr{D}_{\min} from the pure and ensemble ADAPT-VQA for 4-electron model systems for 1-RDMs, along with the 1-RDMs eigenvalues, and the number of Klyachko’s pure N -representability inequalities that is fulfilled in each case, N_{\text{ineq}} (out of a total of 15 for this model). 1-RDM eigenvalues Model system (4e,3o) (4e,4o) w=0.0 w=0.5 w=0.0 w=0.5 \lambda_{1} 1.000 1.000 1.000 1.000 \lambda_{2} 1.000 1.000 1.000 1.000 \lambda_{3} 1.000 0.500 1.000 1.000 \lambda_{4} 1.000 0.500 1.000 0.500 \lambda_{5} 0.000 0.500 0.000 0.500 \lambda_{6} 0.000 0.500 0.000 0.000 \lambda_{7} 0.000 0.000 \lambda_{8} 0.000 0.000 N_{\text{ineq}} 15 15 15 7 ADAPT-VQA \mathscr{D}_{\text{min}}{} pure 0.0 4.89\times 10^{-9} 0.0 1.25\times 10^{-1} ensemble 0.0 4.89\times 10^{-9} 0.0 2.45\times 10^{-9} Next, we extend the analysis to 2-RDMs. While a set of necessary pure N -representability conditions has been reported for 2-RDMs, 36 the complete set of necessary and sufficient pure N -representability conditions remains unknown. Our ADAPT-VQA can be used to numerically decide the pure or ensemble N -representability of 2-RDMs. To highlight this, we analyze the N -representability of 2-RDMs for the (4e,3o) and (4e,4o) model systems. Our results are summarized in Table 3 . For these model systems, the algorithm identifies all the 2-RDMs as ensemble N -representable, but only the cases corresponding to w=0.0 are identified as pure N -representable, as expected. This brings an interesting question: Can the method be used to detect if an ensemble N -representable p -RDM would contract to a pure N -representable q -RDM ( q