Random samples of quantum states: Online resources

Jiangwei Shang, Yi-Lin Seah, Boyu Wang, Hui Khoon Ng, David John Nott and Berthold-Georg Englert



This is the documentation for generating random samples from the quantum state space in accordance with a specified distribution. Ready-made samples (each with at least a million points) from various distributions [1, 2, 3] are available for download, or one can generate one's own samples from a chosen distribution using the provided source codes. The sampling relies on the Hamiltonian Monte Carlo algorithm as described in Ref. [3]. The random samples are reposited in the hope that they would be useful for a variety of tasks in quantum information and quantum computation. Constructing credible regions for tomographic data, optimizing a function over the quantum state space with a complicated landscape, testing the typicality of entanglement among states from a multipartite quantum system, or computing the average of some quantity of interest over a subset of quantum states are but some exemplary applications among many.


License Agreement


Copyright © 2016 J. Shang, Y.-L. Seah, B. Wang, H. K. Ng, D. J. Nott and B.-G. Englert, Centre for Quantum Technologies at the National University of Singapore. The source codes are free: You can redistribute and/or modify them under the terms of the GNU General Public License version 3 (or any later version) as published by the Free Software Foundation. The files of random samples including the source codes are distributed in the hope that they would be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of FITNESS or MERCHANTABILITY FOR PARTICULAR PURPOSE. Please refer to the GNU General Public License at http://www.gnu.org/licenses/ for details


Use of the samples


There are two different formats for the sample files, namely, .mat and .txt. The .mat files are workspace files that can be directly loaded into MATLAB. The .txt files store the real and imaginary parts (as two separate files) of the generated quantum states. Each row in the .txt files corresponds to one state, which can be easily formatted to a d by d matrix row after row. Different sets of POVMs define the same probability space if they are linearly related, so that the Jacobian for the transformation between the corresponding probabilities is a numerical value. Therefore, if the target distribution is the primitive prior (i.e., uniform over the physical probability space), it does not matter which POVM we choose for the sampling. The two-qubit quantum states generated with NIC POVMs carry different weights (corresponding files with suffix "_range"), because of the NIC nature of the POVMs used. For more details, please see Ref. [3]. In addition, we also provide the files of random samples with weights already integrated into the distribution by re-sampling the samples with respect to their weights. These files carry the suffix "_w".


Generate your own samples


The samples are generated by the corresponding source codes, namely the "hmc_" files. To generate your own samples in accordance with any distribution of choice, refer to the source codes "hmc.m" and "spect.m". Note that the current HMC code may yield inaccurate results beyond d = 5. While the HMC method works, in principle, for any dimension, numerical issues with the current MATLAB implementation—due to the extreme small size of the Jacobian used in the code when d gets large—have been observed to occur for dimensions d = 6 and up when the code is run on a standard desktop machine.




Source codes: hmc.m , spect.m

Single qubit (d = 2): 1qb

Qutrit (d = 3): qutrit

Two qubits (d = 4): 2qb

Three qubits (d = 8) and four qubits (d = 16): 3qb4qb

Documentation: QSampling


Note: The compressed .7z files can be opened with the free archiver "7-Zip" in Windows and Linus/Unix machines. For Mac OS, we suggest "Unarchiver".


How to cite


If you are using the random samples or the source codes for your research, please consider citing: J. Shang et. al., eprint arXiv:1612.05180 [quant-ph] (2016). QSampling project: https://www.quantumlah.org/page/page.php?key=qsampling




[1] J. Shang, H. K. Ng, A. Sehrawat, X. Li, and B.-G. Englert, New J. Phys. 15, 123026 (2013).

[2] J. Shang, Y.-L. Seah, H. K. Ng, D. J. Nott, and B.-G. Englert, New J. Phys. 17, 043017 (2015).

[3] Y.-L. Seah, J. Shang, H. K. Ng, D. J. Nott, and B.-G. Englert, New J. Phys. 17, 043018 (2015).