#### Abstract

Coherence vectors and correlation matrices are important functions frequently used in physics. The numerical calculation of these functions directly from their definitions, which involves Kronecker products and matrix multiplications, may seem to be a reasonable option. Notwithstanding, as we demonstrate in this paper, some algebraic manipulations before programming can reduce considerably their computational complexity. Besides, we provide Fortran code to generate generalized Gell-Mann matrices and to compute the optimized and unoptimized versions of associated Bloch’s vectors and correlation matrix in the case of bipartite quantum systems. As a code test and application example, we consider the calculation of Hilbert-Schmidt quantum discords.

#### 1. Introduction

Correlation functions are fundamental objects for statistical analysis and are thus ubiquitous in most kinds of scientific inquiries and their applications [1, 2]. In physics, correlation functions have an important role for research in areas such as quantum optics and open systems [3, 4], phase transitions and condensed matter physics [5, 6], and quantum field theory and nuclear and particle physics [7]. Another area in which correlation functions are omnipresent is quantum information science (QIS), an interdisciplinary field that extends the applicability of the classical theories of information, computation, and computational complexity [8–10].

Investigations about the quantum correlations in physical systems have been one of the main catalyzers for developments in QIS [11–15]. There are several guises of quantum correlations, and quantum discord stands among the most promising quantum resources for fueling the quantum advantage [16–26]. When computing or witnessing quantum discord, or other kinds of correlation or quantumness quantifiers, we are frequently faced with the need for calculating coherence vectors and correlation matrices [27–41]. And it is the main aim of this paper to provide formulas for these functions which are amenable for more efficient numerical calculations when compared with the direct implementation of their definitions.

In order to define coherence vectors and correlation matrices, let us consider a composite bipartite system with Hilbert space . Hereafter, the corresponding dimensions are denoted by for . In addition, let , withbeing a basis for the special unitary group . Any density operator describing the state of the system can be written in the local basis as follows:whereand is the identity operator in . One can readily verify that the components of the coherence (or Bloch’s) vectors and and of the correlation matrix are given byIt is worth mentioning that the mean value of* any observable* in , for , can be obtained using these quantities.

In https://github.com/jonasmaziero/LibForQ.git, we provide Fortran code to compute the coherence vectors, correlation matrices, and quantum discord quantifiers we deal with here. Besides these functions, there are other tools therein that may be of interest to the reader. The instructions on how to use the software are provided in the readme file. Related to the content of this section, the subroutine bloch_vector_gellmann_unopt(, , ) returns the coherence vectors or and the subroutine corrmat_gellmann_unopt(, , , ) computes the correlation matrix . Now, let us notice that if calculated directly from the equations above, for , the computational complexity (CC) to obtain the coherence vectors and or the correlation matrix is

The remainder of this paper is structured as follows. In Section 2, we obtain formulas for , , and which are amenable for more efficient numerical computations. In Section 3, we test these formulas by applying them in the calculation of Hilbert-Schmidt quantum discords. In Section 4, we make some final remarks about the usefulness and possible applications of the results reported here.

#### 2. Computing Coherence Vectors and Correlation Matrices

The partial trace function [42] can be used in order to obtain the reduced states and and to write the components of Bloch’s vectors in the formThus, when computing the coherence vectors of the parties and , we shall solve a similar problem; so let us consider it separately. That is to say, we shall regard a generic density operator written aswhere .

Now, and for the remainder of this paper, we assume that the matrix elements of regarded density operator in the standard computational basis are given. We want to compute* Bloch’s vector* [43]: . For the sake of doing that, a particular basis must be chosen. Here we pick the generalized Gell-Mann matrices, which are presented as follows in three groups [44]:which are named the diagonal, symmetric, and antisymmetric groups, respectively. The last two groups possess generators each. Any one of these matrices can be obtained by calling the subroutine gellmann(, , , , ). For the first group, , we make and, in this case, one can set to any integer.

It is straightforward seeing that, for the generators above, the corresponding components of Bloch’s vector can be expressed directly in terms of the matrix elements of the density operator as follows:

These expressions were implemented in the Fortran subroutine bloch_vector_gellmann(, , ). With this subroutine and the partial trace function [42], we can compute the coherence vectors and .

We observe that after these simple algebraic manipulations the computational complexity of Bloch’s vector turns out to be basically the CC for the partial trace function. Hence, from [42], we have that, for ,

One detail we should keep in mind when making use of the codes linked to this paper is the convention we apply to the indexes of the components of . For the first group of generators, , naturally, . We continue with the second group of generators, , by setting , , . The same convention is used for the third group of generators, , but here we begin with .

Next we address the computation of the* correlation matrix *, which is a matrix that we write in the following form:with the submatrices given as shown below. For convenience, we define the auxiliary variables:

The matrix elements of , whose dimension is , correspond to the diagonal generators for and diagonal generators for :

The matrix elements of , whose dimension is , correspond to the diagonal generators for and symmetric generators for :

The matrix elements of , whose dimension is , correspond to the diagonal generators for and antisymmetric generators for :

The matrix elements of , whose dimension is , correspond to the symmetric generators for and diagonal generators for :

The matrix elements of , whose dimension is , correspond to the symmetric generators for and symmetric generators for :

The matrix elements of , whose dimension is , correspond to the symmetric generators for and antisymmetric generators for :

The matrix elements of , whose dimension is , correspond to the antisymmetric generators for and diagonal generators for :

The matrix elements of , whose dimension is , correspond to the antisymmetric generators for and symmetric generators for :

The matrix elements of , whose dimension is , correspond to antisymmetric generators for and antisymmetric generators for :

We remark that when implementing these expressions numerically, for the sake of mapping the local to the global computational basis, we utilize, for example,

The subroutine corrmat_gellmann(, , , ) returns the correlation matrix , as written in (11), associated with the bipartite density operator and computed using the Gell-Mann basis, as described in this section. The convention for the indexes of the matrix elements is defined in the same way as for the coherence vectors. The computational complexity for , computed via the optimized expressions obtained in this section, is, for ,By generating some random density matrices [45], we checked that the expressions and the corresponding code for the unoptimized and optimized versions of , , and agree. Additional tests shall be presented in the next section, where we calculate some quantum discord quantifiers.

#### 3. Computing Hilbert-Schmidt Quantum Discords

The calculation of quantum discord functions (QD) usually involves hard optimization problems [46, 47]. In the last few years, a large amount of effort has been dedicated towards computing QD analytically, with success being obtained mostly for low-dimensional quantum systems [48–65]. Although not meeting all the required properties for a* bona fide* QD quantifier [66], the Hilbert-Schmidt discord (HSD) [67],is drawing much attention due to its amenability for analytical computations when compared with most other QD measures. In the last equation, the minimization is performed over the classical-quantum states:with being a probability distribution, being an orthonormal basis for , being generic density operators defined in , and being the Hilbert-Schmidt norm of the linear operator , with being the transpose conjugate of .

In this paper, as a basic test for the Fortran code provided to obtain coherence vectors and correlation matrices, we shall compute the following lower bound for the HSD [68]:where are the eigenvalues, sorted in nonincreasing order, of the matrix:In the above equation, stands for the transpose of a vector or matrix. We observe that the other version of the HSD, , can be obtained from the above equations simply by exchanging and and using instead of .

It is interesting that, as was proved in [69], a bipartite state , with polarization vectors and and correlation matrix , is classical-quantum if and only if there exists a -dimensional projector in the space such thatBased on this fact, an ameliorated version for the Hilbert-Schmidt quantum discord (AHSD) was proposed [69]: with the matrix defined aswhere and are arbitrary functions of . Then, by setting and using the purity,to address the problem of noncontractivity of the Hilbert-Schmidt distance, the following analytical formula was presented [69]:

Thus both discord quantifiers and are, at the end of the day, obtained from the eigenvalues . And the computation of these eigenvalues requires the knowledge of the coherence vector (or ) and of the correlation matrix . These QD measures were implemented in the Fortran functions discord_hs(ssys, , , ) and discord_hsa(ssys, , , ), where ssys = ”s”, with , specifies which version of the quantum discord is to be computed. As an example, let us use the formulas provided in this paper and the associated code to compute the HSD and AHSD of Werner states in (with ): where and The reduced states of are , whose purity is . The results for the HSD and AHSD of are presented in Figure 1.

#### 4. Concluding Remarks

In this paper, we addressed the problem of computing coherence vectors and correlations matrices. We obtained formulas for these functions which make possible considerably more efficient numerical implementation when compared with the direct use of their definitions. We provided Fortran code to calculate all the quantities regarded in this paper. As a test for our formulas and code, we computed Hilbert-Schmidt quantum discords of Werner states. It is important to observe that although our focus here was in quantum information science, the tools provided can find application in other areas, such as the calculation of order parameters and correlations functions for the study of phase transitions in discrete quantum or classical systems.

#### Competing Interests

The author declares that there are no competing interests regarding the publication of this paper.

#### Acknowledgments

This work was supported by the following Brazilian funding agencies: Conselho Nacional de Desenvolvimento Científico e Tecnológico (CNPq) (Processes 441875/2014-9 and 303496/2014-2), Instituto Nacional de Ciência e Tecnologia de Informação Quântica (INCT-IQ) (Process 2008/57856-6), and Coordenação de Desenvolvimento de Pessoal de Nível Superior (CAPES) (Process 6531/2014-08). The author gratefully acknowledges the hospitality of the Physics Institute and Laser Spectroscopy Group at Universidad de la República, Uruguay.