Sampling Quantum States with Inequality Constraints Authors: Weijun Li, Rui Han, Jiangwei Shang, Hui Khoon Ng, Berthold-Georg Englert Published: 2026 ABSTRACT Random samples of quantum states with specific properties are useful for various applications, such as Monte Carlo integration over the state space. In the high-dimensional situations that one already encounters when working with a few qubits, the quantum state space has a very complicated boundary, and it is challenging to incorporate the specific properties into the sampling algorithm. In this paper, we present the Sequentially Constrained Monte Carlo (SCMC) algorithm as a practical and versatile method for sampling quantum states in accordance with properties that can be stated as inequalities. We apply the SCMC algorithm to the generation of samples of bound entangled states; for example, we obtain nearly ten thousand bound, entangled, two-qutrit states in a few minutes, compared with less than ten such states per day from independence sampling in our implementation. In the second application, we draw samples of high-dimensional quantum states from a narrowly peaked target distribution and observe, for the system sizes investigated, that SCMC sampling remains computationally manageable as the dimensions grow. In yet another application, the SCMC algorithm produces uniformly distributed quantum states in regions bounded by values of the problem-specific target distribution; such samples are needed when estimating parameters from the probabilistic data acquired in quantum experiments. 1. Introduction Random samples of quantum states with specific probability distributions and/or governed by specific physical properties are very useful for many applications in quantum information science and other research areas. For instance, they play an important role in quantum state and parameter estimation [1,2,3], allowing one to test and verify properties for certain classes of quantum states [4,5,6] as well as to test quantum channels and processes, such as the random quantum circuits leading to Quantum Supremacy [7,8,9]. Similar to sampling classical systems, independent rejection sampling methods are often inapplicable to high-dimensional quantum systems as they suffer severely from the exponential growth of resource requirements, known as the “curse of dimensionality” [10]. The positivity boundaries of the quantum state spaces, moreover, are typically extremely complex to characterize for otherwise convenient parameterizations, causing quantum states to be more challenging to sample. Most existing methods for the direct sampling of the random density matrices, which represent the quantum states numerically, rely on either clever parameterization of the state space or various kinds of induced measures [11,12,13,14,15]. The major drawback is that the exact probability distributions for random states constructed this way are usually not known; one has to estimate approximate distributions, and achieving this reliably is a numerical challenge in itself. Thus, rejection sampling methods that proceed from known proposal distributions are often still favored for sampling from a desired target distribution. However, even if one can directly draw from a reliable reference distribution that mimics the target distribution well—for example, using a version of the complex Wishart distribution [16,17,18]—the exponential reduction of the acceptance rate as the dimensions increase makes it rather impractical to go beyond sampling small quantum systems (see, for example, Reference [19]); other rejection sampling-based methods, such as adaptive rejection sampling, suffer from this problem, too. Monte Carlo-based algorithms [20] can be much more resilient to this curse of dimensionality. The major difficulty encountered in using Monte Carlo (MC) methods comes from the incorporation of constraints into the parameter space. For instance, enforcing the positivity constraint needed for a physical state, which is intrinsic to quantum systems, can be extremely challenging. Algorithms that rely on clever random walks in the probability simplex, such as the Markov Chain Monte Carlo (MCMC), suffer from low acceptance rates because of this positivity constraint, and the Hamiltonian Monte Carlo (HMC) algorithm [21], whose random walk stays in the state space, depends on the evaluation of a Jacobian determinant and its derivatives, found to be numerically unreliable in high-dimensional quantum state spaces [22,23]. In this work, we investigate the use of Sequentially Constrained Monte Carlo (SCMC) samplers as a practical tool for sampling quantum states in accordance with a given distribution and/or certain physical properties, with particular emphasis on efficiently enforcing quantum constraints. SCMC samplers were first proposed by Golchi and Campbell in 2016 [24] to effectively impose constraints when sampling classical systems as an extension to the Sequential Monte Carlo (SMC) samplers proposed by Del Moral et al. a decade earlier [25]. SMC methods [26,27], which have been used extensively in the context of sequential Bayesian inference, are not new to the field of quantum information. For example, they have been well used in adaptive/online Bayesian Hamiltonian estimation [3,28,29]. In the context of sequential Bayesian inference, the sequence of distributions is constructed as more and more measurement data are taken into consideration. Unlike SMC methods in Bayesian inference, SMC samplers enable efficient sampling using MCMC algorithms through the introduction of a sequence of artificial intermediate distributions that bridge between an easy-to-sample initial distribution and the difficult-to-sample target distribution. One application of SMC samplers in quantum information science was recently presented in [30]. Here, we employ SMC samplers to sample quantum states, making use of SCMC samplers to better incorporate the constraints that naturally arise in quantum problems. We study the performance of SCMC samplers for sampling quantum states through three concrete examples, which are otherwise difficult, or even impractical, to achieve using the standard existing methods mentioned above. In the first example, we show how SCMC samplers can be applied to sample quantum states with bound entanglement through the imposition of soft constraints. Large samples of uncorrelated bound entangled bipartite systems with dimensions 3×3, 3×4, 4×4, and 3×5 are reported, and a curious property of the 2×4 system is observed. In this context, we note that the SCMC algorithm does not rely on a particular parameterization of the bound entangled state; see Section 3.1. The second example presents a generic approach to sampling quantum states from desired target distributions. The efficiency and reliability of our algorithm is demonstrated via sampling three-qubit and four-qubit states. Moreover, within the range of system sizes considered, the results are consistent with a computational cost that grows much more mildly than what is typically encountered in direct rejection sampling. In the last example, we sample uniformly distributed quantum states in regions bounded by the contours of the target distribution—uniform with respect to the volume elements induced by the Hilbert–Schmidt distance, that is. We improve on the implementation of the method recently introduced by Oh, Teo, and Jeong (OTJ) [31,32] and so confirm that the direct SCMC sampling from the target distribution is reliable. In addition, we observe that direct SCMC sampling is more efficient than the indirect OTJ method. Depending on one’s point of view, the last example can be regarded as benchmarking SCMC against OTJ or OTJ against SCMC. Some technical details are reported in the Appendix. Selected samples and codes can be fetched from a dedicated repository [33]. 2. SCMC Sampling The SMC samplers presented in Reference [25] enable one to sample x efficiently from its difficult-to-sample target distribution f(x) through a sequence of intermediate distributions. We choose an initial distribution g(x), which can be the prior or any appropriate reference distribution that is easy to sample from directly, and find a discrete sequence of Nτ density distributions hi(x)i=0Nτ that smoothly bridges between g(x) and f(x). One particular choice of hi(x) is to follow the geometric path [34,35],(1)hi(x)=f(x)τig(x)(1−τi), where τi runs from 0 to 1 in arithmetic progression, i.e., τi=i/Nτ as i goes from 0 to Nτ. Thus, h0(x)=g(x) and hNτ(x)=f(x). The utility of SMC samplers was extended by Golchi and Campbell [24] to SCMC samplers; in their approach the hard constraints on the parameter space are gradually incorporated into the intermediate distributions as soft probabilistic constraints. Here, soft constraints refer to relaxations that approach the hard constraint in the limit. For instance, when the desired hard constraint is κ(x)>0, with its indicator function being the step function Iκ(x)=ηκ(x), the intermediate indicator functions for the soft constraints can be smooth approximations of the Heaviside step function, such as(2)Iκ,i(x)=1+tanhaτiκ(x)2, where the tolerance a is an adjustable scale controlling the hardness aτi of the constraint. In this case, the indicator function Iκ,i(x) is incorporated into the SCMC sampler by taking(3)hi(x)→hi(x)Iκ,i(x), and, within the limit of aτi→∞, it converges to the hard constraint, i.e.,(4)Iκ,Nτ(x)→1κ(x)>0,0κ(x)<0. In practice, for a large but yet finite value of a, points with κ(x)≤0 (κ(x)>0) are rejected (accepted) with a higher and higher probability as τi→1; thus, sample points gradually move towards the region satisfying the constraint. At the final step of the SCMC algorithm, we impose the hard constraint instead of the probabilistic constraint and reject the sample points that violate the constraint. Between consecutive distribution steps, the sample is propagated by NMC MCMC iterations, while the effective sample size is monitored to determine whether resampling is needed. We set NMC sufficiently large, relative to the observed MCMC acceptance rate, so that each sample point is likely to move at least once between resampling events; once this condition is met, further increasing NMC mainly increases CPU time and reduces residual correlations without noticeably changing the final sample in our examples. Consult the Appendix for implementation details. The ability to enforce constraints via SCMC is very useful for sampling quantum states because the quantum Hilbert space intrinsically requires the physicality constraint, which usually means complicated constraints on the parameters (positivity of a large matrix) that are CPU expensive to check. Apart from the physicality constraint, many other interesting quantum constraints can also be extremely difficult to enforce as suitable parameterizations of the states are unavailable. For efficient sampling of quantum states, we need to identify the quantum constraints and find their corresponding indicator functions. Next, we show how well the SCMC sampler works for sampling quantum states in three distinct contexts. 3. Examples 3.1. Bound Entanglement A bound entangled state is a state with non-distillable entanglement. It has drawn a lot of attention in the quantum information community since the prediction of its existence in 1998 [36]; see [37] for a recent review. Random samples of bound entangled states are useful not only for the field of quantum information but also for mathematical interests. On the one hand, states with bound entanglement provide a testbed for studying the relationship between entanglement, steering, and Bell-type nonlocality [38,39]; on the other hand, bound entangled states enable the study of positive maps from a different perspective [40]. Moreover, despite being highly mixed, such states are potentially useful for quantum cryptography and quantum metrology [41,42]. While it is currently unknown if all bound entangled states have a positive partial transpose (PPT), we do know that all entangled PPT states are bound entangled [36], and a PPT state is surely entangled if the computable cross norm or realignment (CCNR) criterion is met [43]. Taken together, then, the two conditions(5)min{μPT}≥0and∑jσj(ρ˜)≡R>1 are sufficient to ensure bound entanglement. Here, {μPT} is the set of eigenvalues of the partial transpose of the density matrix ρ, and R is the sum of the singular values of the realigned matrix ρ˜; see Equation (5) in Reference [43]. Examples of bound entangled states are studied in the literature; see, for example, References [36,38,44,45,46,47,48,49,50]. They are often given as special constructions of states in some particular parameter families. A more general way of constructing bound entangled states which allows the generation of a random sample has also been presented in Reference [51], but it only works for bipartite systems with equal dimensions. The SCMC samplers are well suited for generating random samples of PPT bound entangled states with no restrictions on the states’ parameter family or on their dimensionality. They can be generated by imposing the two criteria in Equation (5) in the same way as one imposes the physicality constraint. The two indicator functions are in the form of Equation (2) with κ1(ρ)=min{μPT} and κ2(ρ)=R−1, respectively. The initial reference sample of dimension d can be drawn directly from a uniform distribution of physical states using the Wishart distribution Wd(Q)(d,1d), that is, they are generated from d×d normally distributed complex matrices with mean zero and covariance matrix 1d⊗1d (see Reference [19] for more details). Since the reference samples are physical initially, and we do not want to have unphysical sample points as the samples are processed, we impose hard physicality constraints during the Markov chain steps to ensure that the random walks do not move a quantum state beyond the physical boundary. Examples illustrating the generation of random samples of bound entangled states are shown in Figure 1, where the states in the initial reference sample are represented by red crosses and the sample states after SCMC and before the final rejection sampling are represented by blue dots. As is clearly visible from the plots, our SCMC sampler successfully moved the states toward the region around R=1 and min{μPT}=0 and produced bound entangled states. Table 1 lists the parameters used for the SCMC sampling together with the yield of bound entangled states and the CPU time consumed in each distribution step. As discussed in the previous section, the efficiency of SCMC depends on a number of parameters, including the tolerance ap for the PPT constraint, the tolerance ae for the CCNR entanglement constraint, and the number Nτ of the distribution steps. These tuning parameters are strongly problem dependent; their useful ranges vary with the dimension, target distribution and the particular constraints, as is also reflected by the wide ranges for ae and ap in Table 1. In this feasibility study, we therefore select them empirically, using the final rejection yield and the computational time as practical diagnostics rather than attempting a universal optimization rule. Rejection sampling is applied to impose the complete set of hard constraints at the end of the algorithm; thus, a good set of the parameters should result in a high yield of accepted sample points within reasonable CPU time. For the bipartite qutrit system of dimension d=3×3, a 99% yield of bound entangled states was obtained by setting Nτ=300 and ae=ap=5×104. On our standard desktop, it took a few minutes to find thousands of two-qutrit bound entangled states; CPU parallelization is possible and will speed up the computation. For comparison, we conducted independent sampling by drawing 1010 states from a uniform distribution of bipartite qutrit states. Only 24 out of the 1010 states obeyed the criteria of Equation (5), and this process took days even with CPU parallelization. Such a search for higher-dimensional systems (3×4, 3×5, or 4×4, say) is even more difficult. This illustrates a substantial practical improvement provided by the SCMC algorithm for this task. In Figure 1 and Figure 2, we show scatter plots of the min{μPT} and R values of samples obtained by SCMC for five systems with Hilbert-space dimensions between eight and sixteen (state space dimensions between 63 and 255). No exhaustive trials were conducted, and the performance can certainly be improved upon, as we did not optimize the parameters. Since we are imposing the constraints through the two inequalities in Equation (5), the states produced were clustered in the small corner near R=1 and min{μPT}=0 for the four systems in Figure 1, but not for the 2×4 system in Figure 2. For the cases of Figure 1, to explore other parts of the space for larger values of R and min{μPT}, we filtered the sample further through MCMC iterations with different kernels and acceptance criteria, such as “accept only if R is increased;” the samples obtained are shown in the the bottom row of Figure 1. This way of producing random samples of bound entangled states, without relying on special constructions of parameter families of states, will be very useful when studying general properties of bound entanglement; such investigations are, however, not the objective of this work. The 2×4 system of Figure 2 is particular—we could not find any states that satisfy both the PPT and the CCNR criterion in (5). When either one of the criteria is enforced, SCMC yields samples with min{μPT}≥0 or R>1, respectively. As the plot on the right in Figure 2 shows, first enforcing the PPT criterion, followed by SCMC steps toward enforcing the CCNR criterion, produces samples with R values that are sequentially closer to the R=1 threshold without, however, crossing it. We conjecture that 2×4 systems do not have bound entangled states that obey the sufficient double criterion of (5). There are, of course, bound entangled states that do not obey these criteria. Indeed, the families of bound entangled 2×4 states constructed by the authors of [44,47,48] are PPT with R≤1; their values are on the straight lines with endpoints (min{μPT},R)=(0,1) and (0,0.7866), (0,0.8727) and (0.0270,0.7572), or (0,1) and (0,0.8536), respectively. In Figure 2, they are all on, or very close to, the dashed vertical line at min{μPT}=0. These examples illustrate that the criteria (5) are not necessary—the pair is sufficient. It is possible, perhaps likely, that the final SCMC samples (blue dots in Figure 1 and Figure 2) contain bound entangled states outside the first quadrant, but the yields reported in Table 1 refer solely to the states that meet the double criterion. 3.2. Desired Target Distribution Random samples from a desired distribution are useful in various contexts in quantum information science such as studying properties of a quantum system, parameter optimization, or model testing. Owing to the notorious curse of dimensionality and/or quantum constraints, sampling methods that work well for low-dimensional systems fail to work in practice as the dimensions increase. (The curse refers to the dimensionality of the parameter space, not of the Hilbert space.) For example, the generation of a target sample from a uniform reference distribution of states through rejection sampling fails to work for three-qubit systems, as the acceptance rate is extremely low; one can increase the acceptance rate by orders of magnitude by replacing the uniform reference sample with an appropriate Wishart distribution of states. Nevertheless, the efficiency still suffers from an exponential decay with respect to dimensionality [19]. On the other hand, Markov chain algorithms suffer from instability and their unavoidable sample correlation [22,23]. In this section, we demonstrate that SCMC can be used for generating samples of a desired target distribution at high dimensions, impractical otherwise, and, for the system sizes investigated, the computational cost does not show the severe exponential deterioration characteristic of direct rejection sampling. To be specific, we consider the generic situation where the desired distribution is of the Dirichlet form(6)f(ρ)∝∏ktrΠkραk=∏kpkαk,ρ>0, which is central to quantum state estimation with a conjugate prior. The probability operators Πk have the usual properties, namely Πk≥0 and ∑kΠk=1, and the set Π={Πk} is an informationally complete measurement so that there is a one-to-one correspondence between the state ρ and the probabilities p={pk}=trΠρ. Note that a sample drawn from the Dirichlet distribution by one of the standard efficient algorithms, which draw from the probability simplex, has many unphysical entries (pk>0 while ρ≱0), and simply discarding them would results in a very poor yield. The SCMC procedure pushes most of the initially unphysical sample points into the physical state space. Similar remarks apply to samples drawn from a Dirichlet distribution centered at the state for which f(ρ) is largest, which is often a rank-deficient state. Note also that the Dirichlet distribution has a single very narrow peak when A=∑kαk is large, as is the typical situation in quantum state estimation scenarios. To apply SCMC, we first need a set of initial sample points that can be easily generated. Conventional MC methods often use samples generated in the probability simplex, such as the Dirichlet distribution, that do not respect the positivity constraints, but the rate of physical samples decreases exponentially with respect to the dimensions of the parameter space, which makes it impractical for high-dimensional systems (for example, the physical rate is less than 10−10 for a three-qubit system [19]). Therefore, for efficient sampling, it is expedient to use an initial reference sample that is physical. We mainly explore two types of initial reference sample distributions: the uniform distribution with respect to the Hilbert–Schmidt distance and the peaked Wishart distribution. The former rarely resembles any feature of the target distribution, but the intermediate distributions {hi(ρ)} are straightforward to evaluate for each sample point in the algorithm. The Wishart distribution for quantum states Wd(Q)(n,Σ) offers more freedom by adjusting the covariance matrix Σ in shaping the reference distribution towards a target while conforming to the physicality constraint. Its probability density for a d-dimensional system is [19](7)g(ρ)∝det(ρ)n−dtrΣ−1ρnd, where ρ=Z†Z/trZ†Z and the d×n random complex matrix Z, with n≥d, is drawn from a Gaussian distribution with zero mean and covariance matrix 1n⊗Σ; we get the uniform distribution for n=d and Σ=1d. We expect faster convergence using the Wishart distribution, as it is more similar to the target distribution. However, the apparent downside is that the numerical evaluation of its initial and resulting intermediate distributions takes longer. To test its performance, we run the SCMC algorithm for different numbers of intermediate distributions Nτ and different types of initial reference distributions. We assess the quality of the sample by a variant of the method described in Section 5 of Reference [19], for which we introduce the nested λ-regions with f(ρ)≥λF, where F=maxρf(ρ) is the peak value of f(ρ), and 0≤λ≤1. We have the full physical state space for λ=0 and only the peak location for λ=1. The fraction of the target distribution contained in a λ-region is its content cλ:(8)cλ=∫(dρ)f(ρ)ηf(ρ)−λF, where cλ=0=1 reflects the normalization of f(ρ) to unit integral. By counting how many sample points are inside a λ-region, we obtain an estimate for the respective cλ value. Note that, in the context of Bayesian estimation, cλ is the credibility of the region, if f(ρ) is the posterior distribution. We expect that this estimate is better (i) when more intermediate steps Nτ are used in the SCMC algorithm and (ii) when the sample size Ns is larger. Both expectations are confirmed by the data presented in Figure 3 for two examples, one for a three-qubit system and one for a four-qubit system. The two f(ρ)s are posterior distributions (for a uniform prior) for A=3000 randomly generated measurement clicks of product tetrahedron measurements. With this large A value, the distributions are squeezed into a tiny region in the immediate vicinity of the peak location of f(ρ) at or near the boundary of the state space, which makes them impractical for sampling with conventional methods. In the SCMC algorithm, besides imposing the sequence of intermediate distributions to approach the desired one gradually from the reference distribution, the physicality constraints also have to be imposed either strictly or gradually. When the initial sample points are guaranteed to be physical, such as the ones uniformly drawn from the state space, the hard physicality constraint is directly imposed during the MCMC iterations. Otherwise, when a portion of the initial sample distribution is unphysical, as in the case of the linearly shifted Wishart distribution [19] or the Dirichlet distributions, we impose the soft physicality constraint gradually along with the distribution steps. Note that, when the constraint is strictly imposed throughout, one could make use of a Cholesky decomposition to check for a semi-positive-definite and hermitian matrix; then, the positivity of the smallest eigenvalue of the matrix corresponding to ρ is used to impose the soft constraint via the indicator function. In the three-qubit example shown in Figure 3a, we find it sufficient to have Nτ=300 intermediate steps when the initial sample is drawn from an appropriate Wishart distribution, as the content barely changes by increasing Nτ further. When Nτ=100, the Dirichlet distribution centered at the peak of f(ρ) performs the best, and the uniform distribution performs the poorest. Their difference becomes less and less noticeable with increasing number of distribution steps. For example, no significant difference is shown in their performance when Nτ=150. Thus, it is evident that the SCMC algorithm tolerates flexibility in the choice of the initial reference distribution, although a reference distribution that better resembles the target can offer faster convergence. Figure 3b shows the content of the four-qubit samples generated starting from either a Wishart distribution or a uniform distribution. The Dirichlet distribution is impractical to use here because the random walk into the physical space—a tiny subspace within the 255-dimensional probability simplex—is extremely inefficient. For the same number of sample points, the Wishart distribution might appear to provide faster convergence than the uniform distribution in terms of Nτ. However, the overall performance using the uniform distribution is practically better. This is because the computation per sample point is about three to four times faster when using the uniform distribution than for the Wishart distribution. A larger sample size helps not only to reduce the statistical error in evaluating sample average quantities like the content; it also makes the random walk, which is set to propagate along the direction given by the covariance matrix of the current sample, more efficient, as the covariance matrix is more accurately estimated when the sample is larger. As a result, the time cost for using the Wishart distribution with {Ns=3×104,Nτ=3500} is about the same as using the uniform distribution with {Ns=105,Nτ=3500}, but the latter converges better, as is visible in Figure 3b. The computational time roughly scales as O(NτNs) with simple vectorization of the code in Python (version 3.5.7), provided that there is sufficient memory. For the examples shown in Figure 3, the sampling of 105 three-qubit states and Nτ=200 distribution steps took about 2×104 s using the Wishart distribution on a regular desktop with no CPU parallelization and 7×103 s using the uniform distribution. The sampling of 105 four-qubit states and Nτ=3500 distribution steps using the uniform distribution, which showed good convergence, took about 2.2×105 s (∼60 h, which is only about 30 times longer than sampling three-qubit states). We also ran the sampling algorithm for one-qubit and two-qubit states with reliable sample verification. Using the uniform distribution, the sampling of 105 one-qubit states and Nτ=10 takes about 260 s, and the sampling of 105 two-qubit states and Nτ=75 takes about 1.6×103 s. Similar scaling of running time was seen in other distributions we sampled. All sampling is conducted on a standard desktop with 8 GB RAM. In summary, for the SCMC sampling from the state spaces for one to four qubits, which have (3,15,63,255) parameters, the number of required distribution steps is (10,75,200,3500)≃32.1,151.6,631.3,2551.5, and the computational time is roughly 31.3,151.2,631.2,2551.5 minutes. The number of distribution steps required for convergence increases as the dimensionality increases, leading to longer computational time, and additional CPU cost is incurred by the multiplication of ever larger matrices. The number of distribution steps, Nτ, is a problem-dependent tuning parameter: Increasing Nτ makes the continuation between intermediate distributions more gradual and gives greater confidence in convergence, but it also increases the running time approximately linearly. In practice, we choose Nτ through short trial runs that balance the observed stabilization of the sample, such as the stabilization of the estimated content, against available computational resources. For the scaling of the running time, we observe exponents that are approximately independent of the dimension examined, and this suggests that—within this tested range—the SCMC algorithm does not exhibit the exponential increase in computation time with respect to dimension that hampers direct rejection sampling. Put differently, the SCMC sampler remains computationally practical as the dimensionality increases, at least for dimensions up to 255. Owing to limited time and computer memory, we did not sample larger quantum systems. However, a powerful work station running the CPU-parallelization version of the code should be able to not only produce a larger sample in a much shorter period of time but also sample quantum states in higher dimensions. These results indicate that further exploration of SCMC in higher-dimensional settings would be worthwhile. 3.3. The Oh–Teo–Jeong Method for Benchmarking The volume element (dρ) in Equation (8) is also the probability element of the uniform distribution, and (9)sλ=∫(dρ)ηf(ρ)−λF is the size of the λ-region, normalized such that sλ=0=1. The relation [52](10)cλ=λsλ+∫λ1dλ′sλ′∫01dλ′sλ′ can be used to obtain an estimate of cλ from an estimate of sλ. Owing to the very narrow peak of f(ρ), however, we cannot estimate sλ by counting how many points of a uniform sample are in the λ-region—there would be far too few sample points in the vicinity of the peak. The OTJ method introduced in [31,32] offers a clever solution to this problem based on their region-average computation lemma. It provides sλ by an integration,(11)sλ=sλ0gλ0gλexp−∫λ0λdλ′λ′gλ′, where gλ is the average value of lnf(ρ)/(λF) over the λ-region with respect to the uniform distribution. Although f(ρ) is very narrowly peaked, lnf(ρ) is not, and gλ can be estimated accurately by a sufficiently large sample drawn from the uniform distribution over the λ-region, not over the whole quantum state space. Accordingly, an implementation of the OTJ method requires an accurately known reference value sλ0 and a reliable procedure for generating a uniform sample for each λ-region. Both ingredients had problems in the implementation reported in [31,32]. Here, we implement the OTJ method by (i) finding sλ0 from a large uniform sample for λ0 small enough that, at minimum, a few percent of the sample points are in the λ0-region and (ii) generating large uniform samples from successive λ-regions using an SCMC algorithm that gradually imposes the constraint f(ρ)≥λF. For the computation of the λ′ integral in Equation (11), we discretize linearly in ln(λ′). Figure 4 illustrates aspects of the OTJ algorithm. At the top we see that the λ-regions are not of ellipsoidal shape—the “accelerated hit-and-run” algorithm used in [31,32] assumes that the λ-regions have ellipsoidal shape, which is only justified for λ≲1, no such assumptions enter the SCMC algorithm—and that one needs truly tiny positive λ values to enclose a sizable fraction of a uniform sample on the whole state space. The situation is that of a three-outcome measurement in which A=2420 events were observed; see p. 224 in Reference [53]. While this is not a lot of data for a one-qubit measurement, the Bayesian posterior (our target function here) is already peaked extremely narrowly. At the bottom in Figure 4, we show cλ for a three-qubit target distribution obtained from sampling directly from the distribution by SCMC (black curve) and by different runs of the OTJ algorithm (colored curves). Figure 4 (bottom) confirms that the SCMC sampling yields the correct cλ values, as the sequence of OTJ curves converges toward the SCMC curve. This convergence is from below, which tells us that the OTJ estimates of cλ have a negative bias. All SCMC runs of the OTJ method proceed from λ=1 when all sample points are at the peak location. By reducing λ in Nλ steps, we obtain uniform samples on the respective λ-regions. The “calibration runs” then use sλ0=0.024 for λ0=10−250, which we get from a large uniform sample on the whole state space, in Equation (11) and the resulting sλ in Equation (10). The “precision runs” use λ1=10−25 instead of λ0 in Equation (11), with sλ1≃10−24 obtained from the calibration runs, and Nλ′ intermediate λ values. The graphs for the final calibration run and the first precision run, marked by ∗ in Figure 4 (bottom), are indistinguishable. Regarding the computational effort, the comparison of the SCMC and the OTJ algorithms speaks strongly in favor of SCMC. The computation time scales roughly as O(Nλ+Nλ′)NτNs. Therefore, the final precision run takes about (2000+6000)50×103/(200106)≃102 times longer than the direct production of a target sample by SCMC to evaluate cλ, and the latter has higher accuracy. In summary, we can produce samples uniformly distributed in λ-regions by an SCMC implementation of the OTJ method and so evaluate the content cλ as a function of λ. Our numerical results not only confirm that the OTJ method is viable; they also demonstrate that, for a sharply peaked target distribution, it is more efficient to evaluate the content from the target sample produced directly by SCMC than to use the more involved OTJ method. Further, we observe that the content estimate obtained by the OTJ method has a negative bias. 4. Conclusions In conclusion, we presented an algorithmic study of the reliability and practical efficiency of the SCMC sampler for sampling quantum states through three explicit examples; yet another application of SCMC is reported in Reference [55]. In the first example, we produce samples of bound entangled states for dimensions 3×3, 3×4, 3×5, and 4×4. For some of these cases, no such samples were available before, and our method can also provide bound entangled states for higher dimensions. For example, we obtain nearly ten thousand two-qutrit bound entangled states in a few minutes through SCMC sampling, whereas several days of independent sampling yield 24 such states from 1010 candidates. We also observe that the 2×4 system is particular, as we could not find bound entangled states that obey the PPT-CCNR double criterion. Based on the numerical evidence, we conjecture that such states do not exist. In the second example, we use the SCMC method for sampling quantum states in accordance with given target distributions for three-qubit and four-qubit systems. For the cases studied, SCMC is substantially more efficient than the alternatives we considered, and its cost appears to grow only moderately over the tested range as the dimension increases. The third example is an SCMC implementation of the OTJ method for producing uniform samples on regions bounded by values of the target function (the λ-regions); the shortcomings of the original implementation are avoided. We find that, for the purpose of estimating the content of the λ-regions, direct SCMC sampling from the target distribution is much more efficient, and the values obtained by the OTJ method have a negative bias. The SCMC sampler can be applied to many other sampling problems of quantum systems as long as the constraints can be described by inequalities. For example, one could produce samples of states that violate an inequality of the Bell kind. Multiple constraints can be efficiently applied in parallel. Moreover, due to the well-known channel–state duality, SCMC sampling can also be used to sample channels. We invite the readers to apply the method to their specific sampling problems.