Several algorithms have been proposed to calculate the spatial entanglement spectrum from high order Renyi entropies. In this work we present an alternative approach for computing the entanglement spectrum with quantum Monte Carlo for both continuum and lattice Hamiltonians. This method provides direct access to the matrix elements of the spatially reduced density matrix and we determine an estimator that can be used in variational Monte Carlo as well as other Monte Carlo methods. The algorithm is based on using a generalization of the Swap operator, which can be extended to calculate a general class of density matrices that can include combinations of spin, space, particle and even momentum coordinates. We demonstrate the method by applying it to the Hydrogen and Nitrogen molecules and describe for the first time how the spatial entanglement spectrum encodes a covalent bond that includes all the many body correlations.Density matrices traced out in real space are becoming a fundamental tool in characterizing different states of matter in condensed matter systems [1][2][3][4][5][6][7]. While the interest in spatial reduced density matrices (RDM) is quite recent, the use of density matrices in general is quite ubiquitous [8]. The calculation and usage of particle RDMs in quantum Monte Carlo (QMC) simulations are quite extensive and many techniques have been developed to calculate such density matrices [9][10][11].Recent QMC entanglement studies have focused on determining the Renyi entropies [12,13]. Calculations of spatial Renyi entanglement with QMC include lattice calculations of topological systems [14] and continuum calculations of Fermi liquids [15,16] and molecules [17]. The Renyi entropies calculated in these works are generally determined with the Swap operator which can be applied to interacting systems. In the community of ab initio research, there has also been much recent work on using QMC to make highly accurate calculations of the momentum distribution of realistic materials [10]. It turns out the estimators used to calculate the momentum distribution can be seen as a form of the Swap operator. In this work we use the best techniques that have been developed from both of these communities to introduce a generalization of the Swap operator, making it an efficient tool to calculate the entanglement spectrum of spatial RDMs.The spatial entanglement spectrum is derived from a density matrix ρ A in which a system is split into two regions (A and B), and the degrees of freedom in region B are traced out. The matrix elements of such a density matrix can be expanded in any basis that is complete in region A. However, in our numerical calculations we in general can only consider a finite number of basis elements. Therefore practical calculations of the entanglement spectrum are basis dependent, and a carefully selected basis is required. The algorithm presented here is different from recent proposals [18][19][20][21] for calculating the entanglement spectrum in several ways. First, there is no calculation o...