Hermitian and Unitary Almost-Companion Matrices of Polynomials on Demand

We introduce the concept of the almost-companion matrix (ACM) by relaxing the non-derogatory property of the standard companion matrix (CM). That is, we define an ACM as a matrix whose characteristic polynomial coincides with a given monic and generally complex polynomial. The greater flexibility inherent in the ACM concept, compared to CM, allows the construction of ACMs that have convenient matrix structures satisfying desired additional conditions, compatibly with specific properties of the polynomial coefficients. We demonstrate the construction of Hermitian and unitary ACMs starting from appropriate third-degree polynomials, with implications for their use in physical-mathematical problems, such as the parameterization of the Hamiltonian, density, or evolution matrix of a qutrit. We show that the ACM provides a means of identifying the properties of a given polynomial and finding its roots. For example, we describe the ACM-based solution of cubic complex algebraic equations without resorting to the use of the Cardano-Dal Ferro formulas. We also show the necessary and sufficient conditions on the coefficients of a polynomial for it to represent the characteristic polynomial of a unitary ACM. The presented approach can be generalized to complex polynomials of higher degrees.


Introduction
Given a complex and monic polynomial P n (z) (see Comment A1), it is always possible to define a matrix with a specified arrangement of the polynomial coefficients as its entries, such that P n (z) coincides with the characteristic polynomial of the matrix. The set S(P n (z)) of all these n × n matrices with complex entries, sharing the same characteristic polynomial P n (z), is infinite and can include both derogatory and non-derogatory matrices (see Comment A2). In fact, we observe that, by definition, the Frobenius Matrix [1] of the shared characteristic polynomial always belongs to S(P n (z)). A remarkable property of this matrix, which stems directly from its construction, is the coincidence between its characteristic and minimal polynomials, whatever P n (z). Therefore this matrix is classified as non-derogatory and, following Horn and Johnson [2], it is known as the Companion Matrix (CM) of its characteristic or minimal polynomial (see Comment A3).
Henceforth, we refer to the Frobenius Matrix as the Frobenius Companion matrix (FCM) of P n (z). When the algebraic multiplicity of each of the n eigenvalues of the FCM is 1, any matrix in S(P n (z)) is non-derogatory, since these n distinct eigenvalues are all necessarily roots of its minimal polynomial, which therefore has degree n [2]. We also remark that this condition guarantees that each matrix in the S(P n (z)) set is diagonalizable [2] and that, consequently, all matrices ∈ S(P n (z)) can be generated from the FCM ∈ S(P n (z)) by means of a similarity transformation. In this way, by definition and under the conditions established for the spectrum σ(FCM) of FMC, S(P n (z)) includes all and only the companion matrices of P n (z).
When, instead, the distinct roots of the common characteristic polynomial are p < n, S(P n (z)) includes infinite derogatory matrices, which cannot be structurally similar to the Frobenius matrix (see Comment A4) and to any non-derogatory matrix belonging to S(P n (z)). For example, consider that the set S(P n (z)) contains the diagonal matrices whose n entries are nothing but the p distinct roots of the characteristic polynomial repeated as many times as their multiplicities, whose sum is n. The degree of their characteristic polynomial is n, while the degree of their minimal polynomial is p < n [2]. Therefore, these matrices are derogatory, as are the infinite matrices generated from them by similarity.
The Frobenius matrix dates back to 1879 and was given in the form [1]: by the German mathematician Ferdinand Georg Frobenius [3]. Sometimes, in the literature it is presented in three other unitarily transformed forms, all parameterized in terms of the n coefficients of the polynomial P n (z) and with the same number of entries equal to 0 or 1 as in (1) [4]. When the n eigenvalues of the Frobenius matrix are distinct, the unitary matrix that yields the diagonal form of (1) is the Vandermont matrix of its n eigenvalues. This property, as well as other properties and some applications of the Frobenius matrix may be found in [4]. Despite the fact that the first CM was proposed more than 140 years ago, the generation of different CMs (with further properties) has attracted a great deal of applied research activity. CMs emerge naturally in mathematical methods for finding and characterizing the roots of polynomials [5][6][7][8][9][10] and can be applied as well in the determination of solutions of high-order scalar linear differential and difference equations [11]. CMs can give matrix representations of some fields [12] and are widely used in control theory, for example in writing the controllable canonical form associated with the transfer function of a system [13]. The product of CMs is also used in the study of random walks and Markov chains [14].
The original structure of the FCM shows a modest level of flexibility and, in fact, has stimulated the search and the emergence of generalizations leading to new proposals of CMs that pave the way to applications beyond the FCM. To this end, a successful strategy is based on a radical change of the basis in which the characteristic polynomial P n (z) of the FCM is represented. By definition, P n (z) is monic and is written as the sum of z n and a linear combination with coefficients in C of 1, z, z 2 , . . . , z n−1 . All these n + 1 powers of z constitute the monomial basis, which can be replaced by other polynomial bases. In this way, one can introduce new (still non-derogatory) CMs with nonvanishing elements on the main, sub, and super diagonals. For example, the Chebyshev basis, independently adopted by Specht [15,16] and Good [17], led to a new CM called the colleague matrix. This approach has been further generalized by Barnett [4], who considered a basis of orthogonal polynomials and named the newly emerged CMs comrade matrices. Subsequently, Barnett proposed to call confederate matrices the CMs arising from the use of a general polynomial basis [18].
The applications dedicated to the classic problem of finding the real zeros of a real coefficient polynomial of arbitrary degree deserve a special mention, because in this context the CMs have inspired a different approach, alongside exquisitely mathematical and computational investigations [19][20][21][22][23][24]. In the last decade, new quantum theory-based rootfinding algorithms exploiting the construction of Hermitian companion matrices [25][26][27][28][29][30] have also been proposed, thus increasing the interest in the study of CMs and related matrices in the rapidly growing research field of quantum computing. Furthermore, recent studies [31] have shown the opportunity of using CMs in mathematical constructions useful to the investigation of quantum entanglement, quantum state tomography, and quantum information in general.
The above is the general context for the main question addressed by this paper: is it possible to find a CM of a real or complex polynomial that is also hermitian/unitary, for example, or possesses some other prescribed special matrix structure? This question has so far been answered only partially.
In [32] the CM for a P n (z) with real coefficients and real zeros is constructed as a real symmetric tridiagonal Hermitian matrix. This provides a complete solution to a problem raised and partly solved by M. Fiedler in [33], which has rekindled the interest in the general structure of CMs. Note that the Frobenius matrix is itself a Fiedler matrix after a reverse permutation matrix similarity. In [34] all CMs are characterized in terms of combinatorial structure to generate new CMs. It is interesting to note that both the Frobenius and Fiedler CMs are sparse matrices, as they have 2n − 1 nonzero elements [35]. A new class of sparse CMs, also known as intercyclic CMs, was introduced in [34] and includes the Fiedler matrices as a special case. In [35] the non-sparse CMs are introduced noting that they are not connected with the sparse ones by a reverse permutation matrix similarity.
To the best of our knowledge, the question of whether the CM of a complex polynomial can be sought as unitary or Hermitian is still open.

Purpose and Contribution of this Study
CMs generally show relatively limited versatility due to their combinatorial structure. For example, the FCM is never Hermitian or unitary. Searching for CMs that satisfy additional constraints of this kind is important when a given class of parametric polynomials is designed to reach a reliable theoretical control of a quantum physical scenario. Finding exact flexible solutions to well-defined inverse problems of this kind is a target of the present study. We stress that, for application purposes, we often do not need to associate non-derogatory matrices to a given polynomial. To emphasize this particular aspect of our matrix construction, we introduce the term almost-companion matrix (ACM) to refer to matrices that have a given polynomial as their characteristic polynomial but can be derogatory. Clearly, every CM is also an ACM, i.e., the set of all ACMs is a superset of the set of all CMs of a given polynomial.
In short, in this study, we address the following inverse problem: given a real or complex polynomial of any kind (for example, it may belong to a special class of polynomials, which is reflected in some special condition satisfied by its coefficients), we find a parametric ACM (see Comment A5) that satisfies preassigned conditions (e.g., those required to be Hermitian or unitary) and whose characteristic polynomial coincides with the given one. For definiteness, our investigation is here limited to complex polynomials of the third degree (n = 3). The extension of the analysis to higher-degree polynomials is discussed.
The solution of the inverse problem outlined above for polynomials of order n = 3 is accompanied by some useful applications. The relaxed constraints that characterize an ACM, as compared with a CM, allow the freedom to search, from the outset, for a trial ACM of a given P n (z) that is a Hermitian, unitary, or positive matrix, for example. If our inverse problem can be solved systematically through an approach that finds such ACMs whatever the given P n (z), then we readily have at our disposal a good platform for successful applications to problems such as those mentioned below.

Physical Applications
Constructing an ACM of a given generally complex polynomial, in addition to being interesting in itself, also has considerable applications. In elementary algebra, for example, it could be a solution tool for counting the number of the real roots (and consequently that of the complex roots in the case of a complex polynomial) of a real or complex polynomial.
In addition, it may help determine a (or the only) real root of a real polynomial of odd degree. In quantum mechanics or quantum information, it could provide new parametric representations of the density operator or the evolution operator of a physical system living in a finite-dimensional Hilbert space.
The results found for a generic complex polynomial can be applied to the important particular case of a real polynomial. Investigating such a link is certainly of interest in physics. For example, in classical physics, cubic real polynomials appear when looking for the principal axes of symmetric Cartesian tensors of rank two, such as inertia or magnetic/electric dipolar tensors [36]. In quantum mechanics, they enter the scene as characteristic polynomials of any observable of a physical system that lives in a threedimensional Hilbert space, such as a three-level atom or a qutrit. Recipes for constructing an ACM of a cubic polynomial possessing real roots after the appropriate assignment of parametric real coefficients could provide an easy way to build, e.g., Hamiltonian qutrit models on demand for control purposes, or even the density operator describing a mixed state of a three-level atom.
The paper is organized as follows. In Section 2, we formulate the inverse problem consisting of the search of the ACM for a generic complex polynomial. In Section 3, we construct the ACMs for a generic cubic complex polynomial. Through these ACMs, we introduce a way to find the roots of the given polynomial without using the Cardano-Dal Ferro formulas. The case of the polynomial with real coefficients is also discussed in detail. In Section 4 we present an application in quantum mechanics, constructing on demand the density matrix of a qutrit system as an ACM. Section 5 shows the construction on demand of the unitary ACM of a qutrit. Possible extensions to higher-degree polynomials, as well as further possible applications, are discussed in Section 6.

Formulation of the Inverse Problem
Consider a matrix A ∈ M n , where M n is the set of all n × n matrices over the complex field C. Denoting I n ∈ M n the identity matrix, the monic polynomial in the complex variable z det (zI n − A) = z n + c 1 z n−1 + · · · c n−1 z + c n is, by definition, the characteristic polynomial of A and belongs to the set P n [C] of all complex monic polynomials of degree n. It is well known that its n coefficients c k , k = 1, 2 . . . , n contain information about the elements of A that is invariant under arbitrary similarity transformations (see Comment A6). In fact, (−1) k c k is the sum of all the principal minors of order k of A. In particular, c 1 = −TrA and c n = (−1) n det A. The profound interrelationship between a matrix and its characteristic polynomial becomes even more surprising considering the Cayley-Hamilton theorem (see Comment A7) [2] and/or Newton's identities [37], which reveal the existence of finite algebraic expressions for the coefficients of the characteristic polynomial of a matrix in terms of traces of powers (up to n) of the matrix. [38,39].
The function C : M n → P n [C] is surjective but not injective and, hence, it cannot be inverted. In fact, it is easy to convince oneself that, for any element P n (z) ∈ P n [C], C −1 (P n (z)) is indeed an infinite subset of M n , since by definition it consists of all and only the matrices belonging to M n whose characteristic polynomial is P n (z).
Thus, while the direct or forward problem of finding the characteristic polynomial of a given n × n matrix is certainly well-posed according to Hadamard [40], conversely, the problem of finding a matrix A ∈ M n generating a given complex polynomial P n (z) is an ill-posed inverse problem [41,42], as it manifestly violates Hadamard's uniqueness requirement, considering that every element ∈ C −1 (P n (z)) is a solution to the problem.
It is possible to overcome such an ill-posedness by introducing a restriction C [C] n of the function C to a subset [C] n of M n , which is injectively and surjectively valued on P n [C]. To this end, let us first observe that the function C is surjective and, by definition, P n (z) is the characteristic polynomial of all and only the matrices belonging to C −1 (P n (z)) ⊂ M n . Moreover, C −1 (P n (z)) ∩ C −1 (P n (z)) = ∅ when P n (z) = P n (z). Therefore, the infinite subsets C −1 (P n (z)) of M n corresponding to the infinite n-degree polynomials P n (z) represent a partition of M n . We can say equivalently that we are introducing in M n the equivalence relation A ∼ B consisting in the condition that A ∈ M n and B ∈ M n share the characteristic polynomial and thus belong to a given equivalence class C −1 (P n (z)). At this point, we define the subset [C] n by choosing one element from each equivalence class. According to Zermelo's postulate, [C] n = ∅ can always be constructed (in infinitely many ways in the present case, since each equivalence class is infinite), and the cardinality of its intersection with C −1 (P n (z)) is precisely one for any P n (z) by construction. Therefore, every one-to-one We remark that different legitimate choices of the subset [C] n lead to different inverse problems, all well-posed in the fixed domain P n [C], and the corresponding solutions (3) differ in the generally non-similar images of one or more polynomials P n (z).
We also point out that any derogatory matrix D cannot be classified as a companion matrix of its characteristic polynomial P D (z) ≡ det(zI n − D), since D annihilates a polynomial having a degree lower than that of P D [2].
In this paper, a matrix whose characteristic polynomial coincides with a given polynomial P n (z) is called an almost-companion matrix of P n (z). Clearly, any CM of P n (z) is an ACM too. A derogatory matrix D such that P D (z) = P n (z) is an ACM. In addition, a matrix similar to an ACM is still an ACM. The converse of this statement is generally false: two ACMs of the same given polynomial are not necessarily similar [43]. The set of all the ACMs of P n (z) cannot be generated by similarity transformations starting from an assigned ACM, since this set always includes both derogatory and non-derogatory matrices.

Almost-Companion Matrices of a Cubic Complex Polynomial
In this section, we focus on the search for an ACM of the third-degree polynomial which is the canonical form of obtained by the translation The generally complex numbers p and q in (4) are related to the coefficients of P 3 (z) as follows: We denote Q 3c the ACM of P 3c (η) defined by which means that is the simple recipe to obtain the corresponding ACM Q 3 of P 3 (z) from Q 3c . This analysis sheds light on the advantage of first deriving Q 3c for the simpler canonical form of a given polynomial and then finding Q 3c from the straightforward relation (9). Next, we formulate a trial ACM Q 3c of (4). To this end, we observe that, in accordance with the Vieta-Girard formula for the sum of the roots of (4) [44], the absence of the quadratic term in P 3c (η) implies that tr(Q 3c ) = 0. Moreover, every matrix with elements in C is unitarily equivalent to a matrix with equal main diagonal elements [2]. Thus, it is legitimate to set the diagonal elements of our trial Q 3c equal to zero. In constructing an ACM of (4), we aim to write its non-diagonal elements in such a way that, in the particular case of a real cubic P 3 and, hence, P 3c , the trial matrix Q 3c becomes structurally Hermitian provided that p and q in (4) satisfy specific conditions, which will also be derived from our approach. The feasibility of this approach will highlight the greater flexibility of the ACMs compared to that of the CMs.
Following this strategy, we propose the following trial Q 3c : where the minus sign was introduced for convenience, considering the form of the characteristic polynomial. In Equation (10), ρ is real and positive, ϕ is real, whereas ϕ 13 is, in general, a complex number. It is readily seen that, when ϕ = 0 or π and ϕ 13 is real, the matrix Q 3c (ρ, ϕ, ϕ 13 ) is Hermitian, consistent with our search strategy. It is useful to note that the complex conjugate of e iϕ 13 is e −iϕ 13 , where ϕ 13 denotes the conjugate of ϕ 13 . The characteristic polynomial of Q 3c (ρ, ϕ, ϕ 13 ) is Then, identifying polynomial (4) with (11) yields: Given p, the first Equation (12) allows us to fix ρ and select ϕ (in an infinite set) as follows: Defining, for p = 0, the complex parameter the second Equation (12) becomes an elementary trigonometric equation in C: which admits infinitely many solutions for any χ; in fact, similarly to the cosine function of a real variable, the complex cosine function is even and periodic with period 2π.
Using Euler's formula, Equation (15) is easily transformed into a quadratic equation in the variable e iϕ 13 , whose solution leads to Due to the presence of the multi-valued complex function arg(χ 2 − 1), expression (16) represents the set of infinite images of χ generated by the inverse of the non-injective cosine function over C. Therefore, strictly speaking, the expression found for ϕ 13 cannot be introduced as it is in the matrix Q 3c (ρ, ϕ, ϕ 13 ). In fact, the three parameters appearing in the trial ACM (11) of (4) must be single-valued functions of the complex coefficients p and q. For our purposes, therefore, we now need to extract a specific single-valued complex function from the multi-valued function ϕ 13 . The single-valued complex function that we use here is the principal value Φ 13 of ϕ 13 , which is obtained from (16) by substituting the multi-valued functions arg and ln with their principal values, denoted Arg and Ln, respectively. This choice amounts, by definition, to constructing the principal value Arccos (χ) of function arccos(χ), which is mostly used in the literature [45,46]. It is worth noting that equation (16) can also be written in terms of χ 2 − 1, but then the use of the principal value in the resulting expression for ϕ 13 would have some drawbacks, as is discussed in detail in [47].
We determined all of the ingredients for constructing the trial ACM of (4) when p = 0. In accordance with (17), this ACM is a generally non-Hermitian matrix that can be written as follows: where Thus, based on (9), the ACM of (5) has the form We can find an ACM of (4) for p = 0 through the same kind of approach, beginning with a matrix different from (10). Our solution, denoted by Q 3c (q), can be cast as follows: For completeness, we also write Q 3c (p, 0) (χ = 0): since Φ 13 (0) = π/2 from (17). It is not difficult to see that the eigenvalues of (22) are 0 and ±|p| 1 2 e iϕp 2 . Above, we formulated and solved the inverse problem of finding ACMs of generic cubic complex polynomials. Next, by exploiting these ACMs, we will present a way to find the roots of the given polynomial without resorting to the Cardano-Dal Ferro formulas, and then we will delve into the implications of having a polynomial with real coefficients on the form of the ACM and its roots.

Roots Characterization
Next, we assume that p = 0. Then, the eigenvalues of Q 3c (p, q) are the roots of (4) and, hence, the roots of the characteristic polynomial of the matrix appearing in the righthand side of (18), each multiplied by the pre-factor |p| 3 e i ϕp 2 . This characteristic polynomial P 3c (η) in the unknownη has the form The cosine representation of the free term in polynomial (23) is remarkable because it allows one to guess, at first glance, one of its three roots and then to exactly construct the other two by simply reducing the cubic polynomialP 3c (η) to a quadratic polynomial. In fact, without resorting to the well-known Cardano-Dal Ferro formulas [48], and using instead the elementary triplication formula for the cosine function cos(3z) = 4 cos 3 (z) − 3 cos(z), which also holds in the complex field, it is immediate to see that the generally complex expression (see Comment A8)η is a root of (23), whatever the complex coefficients p = 0 and q. The algebraic representation (17) of Φ 13 (χ) is the key to explicitly write the pand q-dependencies of the real and imaginary components of the algebraic expression forη 1 , which are obtained using Euler's formula as where Re(Φ 13 ) and Im(Φ 13 ) are defined in (17). The other two roots are easily found to be [49] Equations (24) and (27) express the roots ofP 3c (η) as functions of parameter Φ 13 , which appears in the first and last anti-diagonal terms of matrices (18) and (20). We, thus, conclude that our procedure to construct the ACM also yields the roots of the (generally complex) characteristic polynomial. It is interesting to highlight the conditions for a complex polynomial to admit real roots (note that the roots can never be all real, however, if the imaginary part of at least one of the polynomial coefficients is nonzero). To this end, it is convenient to start from the polynomial form (5). We write the three coefficients of (5) as c j ≡ x j + iy j , with j = 1, 2, 3. If a real root r of (5) exists, it must satisfy the equation y 1 r 2 + y 2 r + y 3 = 0, which results from equating to zero the imaginary part of the polynomial. δ = (y 2 ) 2 − 4y 1 y 3 ≥ 0 is clearly a necessary condition for the existence of the root r, and the two only possible . Then, any of these two expressions is indeed a root of (5) only if it satisfies the additional condition r 3 + x 1 r 2 + x 2 r = −x 3 , which results from the real part of the polynomial. We can thus state that the cubic polynomial (5) has at least one real root if and only if the inequality δ ≥ 0 and the last condition are both met. In particular, when δ = 0, r is a double root. Finally, we examine the case y 1 = 0 (and y 2 = 0, since otherwise no real root exists for a complex polynomial). Applying the same procedure, one finds that a real root r = − y 3 y 2 of (5) exists if and only if the condition r 3 + x 1 r 2 + x 2 r = −x 3 holds. It is easy to convince oneself that this real root has multiplicity two, being a real root of the first derivative of (5).

Real Polynomial Case
We now investigate the special form of Q 3c (p, q) in the case in which the three coefficients of (5) are real, with the aim of establishing properties of the polynomial roots based on its almost-companion representation built above.
In this case, (7) implies that p and q are real, and thus (4) is also a real polynomial over C. Moreover, since Θ p can only be 0 (p > 0) or π (p < 0), the parameter χ defined in (14) is purely imaginary or real, respectively, and, therefore, its square is real for any p. As a consequence, using (17) it is not difficult to prove that, if and only if (see also Comment A9) (which implies p < 0, i.e., Θ p = π, and |χ| ≤ 1), the imaginary part of Φ 13 (χ) given in Equation (17) vanishes, while its real part assumes the simple expression where we used the identity Arccos(x) = π − Arccos(−x) valid for any real x such that |x| ≤ 1. It is worth noting that in the present case (27) takes the simpler form (30) shows that Φ 13 ∈ [0, π]. Under condition (29) and considering that ϕ p = Θ p + π = 2π, the specialization of (18) to the case under scrutiny produces the Hermitian ACM of (4) as where the real angle Φ 13 is given by Equation (30). The Hermitian nature of the ACM built assures that (4), as well as (5), has three real roots. These roots are distinct when ∆(p, q) < 0, while two of them are coincident if ∆(p, q) = 0 [50]. We can write the real roots x k (k = 1, 2, 3) of (5) as follows: whereη k are the three (real) roots of (23). Equations (24) and (27), together with (30), yield It is possible to check that this formula gives the well-known trigonometric and translated forms of the three roots of (5) when they are real (see [51]). When ∆(p, q) > 0, only one of the three roots of Equation (4) or (5) (with real polynomial coefficients) is real, while the other two roots are complex conjugates. In particular, the real root corresponds toη 3 for p > 0 and toη 1 for p < 0. In more detail, the three roots are and with for p > 0, and where with for p < 0 (see derivation in Appendix A.1). A more elaborate derivation of the roots leading to their formulation in terms of trigonometric functions can be found in [50].

Almost-Companion Density Matrices of a Qutrit on Demand
A quantum system living in the Hilbert space H spanned by three orthonormal states |1 , |2 , and |3 is called a qutrit [52]. A pure state of the qutrit can always be represented as a normalized linear combination of these three states. To describe an arbitrary pure or mixed state of the qutrit with the same formalism, one uses instead a linear operatorρ called the density operator [53]. It acts on H and, by definition, is positive semi-definite with trace 1: tr(ρ) = 1. It is well known that any positive semi-definite operator is Hermitian since its skew-Hermitian part vanishes [2,54]. As a consequence, any positive semi-definite operator is diagonalizable, and it is possible to show that its eigenvalues are real non-negative numbers. In particular, any density operatorρ is Hermitian. The three eigenvalues of the operatorρ describing the state of a qutrit are the populations of the three eigenstates ofρ. The 3 × 3 basis-dependent matrix representation ofρ, called density matrix and denoted by ρ, is also positive semi-definite and, hence, Hermitian. We observe incidentally that, conversely, any Hermitian matrix with non-negative eigenvalues is positive semi-definite and, if its trace is 1, it is a density matrix.
The purpose of this section is to demonstrate that our recipe for constructing the Hermitian ACM of a generic third-degree polynomial admitting three real roots provides an effective tool for writing density matrices of a qutrit on demand. It is worth noting that our approach itself does not require the support of a vector space, while the relationship to a basis of physical states appears in this application to a qutrit.
The aforementioned definition of density matrix results in unambiguous properties of the real coefficients of its characteristic polynomial. First of all, writing this polynomial in the canonical form the condition stemming from Equation (29) ensures that Φ 13 (p, q) is real, so that the ACM (31) of (44) is Hermitian and, hence, has real eigenvalues. Then, turning to form (5) of the monic polynomial through the translation (6), the Vieta-Girard formula for the sum of the roots [55] implies that the coefficient of the quadratic term is −1. Moreover, Descartes's sign rule [56] requires that the four coefficients of polynomial (5) have alternate signs in order to have three positive roots. Therefore, the characteristic polynomial of an arbitrary density matrix of a qutrit is necessarily a third-degree real and monic polynomial of the form where a and b are real numbers that satisfy condition (45) after translation (6). One or two roots are zero if a = 0, b = 0 or a = 0, b = 0, respectively, while the inequality (45) is never satisfied for a = 0 and b = 0.
In conclusion, under conditions (45) and (46), Q 3 (p, q) = Q 3c (p, q) − c 1 3 I 3 , with Q 3c (p, q) given by Equation (31), is a density matrix. Incidentally, we point out that our inverse problem admits infinitely many non-Hermitian solutions, i.e., non-Hermitian ACMs of (44) or (46), such as, for example, the corresponding Frobenius companion matrix. Therefore, the explicit construction of the Hermitian ACM of (46) and, more generally, of any real third-degree polynomial with only real roots is a successful outcome of our search strategy (10). This recipe, in turn, forms the basis of the application presented below.
Let us introduce the set D of all density matrices of a qutrit in a given basis {|n , n = 1, 2, 3} of H. E be the binary relation in D defined as follows: ρ 1 ∈ D and ρ 2 ∈ D are in the relation E if they are ACMs of the same polynomial p 3 (x) defined in (46). This relation, expressed by writing ρ 1 E ρ 2 , is an equivalence relation as it is manifestly reflexive, symmetric, and transitive. D is thus partitioned by E . The quotient set D/E consists of all equivalence classes of D with respect to E . Each equivalence class, which comprises all density matrices with the same characteristic polynomial, is represented by one (arbitrarily chosen) of its elements, ρ, and is commonly denoted by [ρ]. This is where our result (31) enters the scene, providing an easy way to parameterize the quotient set of D.
It is always possible to use the matrix Q 3 (p, q) = Q 3c (p, q) − c 1 3 I 3 as the representative element of the equivalence class consisting of all elements of D sharing the characteristic polynomial (46), which, in turn, is uniquely associated with its canonical form (44). In this way, we establish a one-to-one correspondence between D/E and the set P of polynomials (44). This correspondence amounts to parameterizing the quotient set of D in terms of p and q. The most ambitious target of parameterizing set D is discussed in a recent topical issue [57]. It is worth emphasizing that a density matrix ρ belongs to the class of equivalence Q 3c (p, q) − c 1 3 I 3 if and only if it can be unitarily generated from Q 3c (p, q) − c 1 3 I 3 , since its characteristic polynomial, trace, and Hermiticity are unitarily invariant, thus implying the invariance of the positive semi-definiteness. Therefore, while two similar matrices are ACMs of the same polynomial, a similarity transformation of a density matrix does not generate, in general, a density matrix [2].
Our parameterization of D/E in terms of the coefficients of its characteristic polynomial written in canonical form provides the theoretical basis for constructing, on demand and in a prefixed basis of H, almost-companion density matrices of any assigned polynomial p 3 (x) fulfilling the condition ∆ ≤ 0. We illustrate the concrete applicability of our recipe by constructing an almost-companion density matrix starting from the polynomial The translation: so that, in this case, p = − 1 36 while q vanishes. Exploiting Equation (30), we easily have: We have, thus, obtained the few ingredients necessary to build an almost-companion density matrix of the given polynomial (47) as the sum Q 3 of the representative element of the corresponding equivalence class and the matrix 1 3 I 3 , in accordance with the realization (20) of (9). That is, the density matrix has the form Note that, while in this case it is easy to find the roots of (48) directly, and then those of (47), in general the roots of the polynomial p 3c (η) corresponding to a given p 3 (x) can be found using (33). We stress that any matrix equivalent to (50) through a unitary transformationV is an almost-companion density matrix of (47) and vice versa. For a given basis, each density matrix thus obtained describes a different (generally mixed) state of the qutrit. If, instead, the unitary transformation is interpreted as the generator of a change in the basis {|n >, n = 1, 2, 3}, the matrix obtained represents the same density operator in the new basis (V|n >, n = 1, 2, 3).

Unitary Matrices (Operators) on Demand
The effective construction of density matrices on demand in Section 4, results from the application of our procedure for constructing ACMs to third-degree polynomials that belong to the set P and satisfy, a priori, necessary and sufficient conditions for the existence of positive semi-definite ACMs of trace 1. By comparison, the construction of almost-companion unitary matrices on demand (that is, starting from a given appropriate third-degree polynomial) requires addressing two hurdles. The first one is to establish with certainty whether the given polynomial can be the characteristic polynomial of a unitary matrix without knowing its zeros a priori. The second difficulty lies in the fact that the trial ACM of a complex arbitrary polynomial, as given by the main Equations (9) and (10) of our procedure, is never unitary by construction. In this regard, it is important to note that the possibility of finding a non-unitary ACM of a given polynomial is not incompatible with the existence of a unitary almost-companion matrix for the given polynomial. In fact, different ACMs of a given polynomial are generally not unitarily equivalent.
In light of these considerations, we want to first identify possible structural properties shared by the coefficients of all the characteristic polynomials of a unitary matrix. Then, according to our general procedure, we will introduce a class of trial unitary matrices sufficiently representative to allow us to find a unique ACM for an assigned polynomial whose three roots are unknown but certainly have modulus 1.

Properties of the Characteristic Polynomial of a Unitary Matrix
It is easy to prove the following necessary and sufficient conditions concerning the characteristic polynomial of a unitary ACM: Theorem 1. Let D m (z) be any complex polynomial of degree m, with 1 ≤ m ≤ n, dividing an arbitrarily given complex polynomial P n (z). Then P n (z) admits a unitary ACM if and only if any D m (z) does.
Proof. Necessity: if P n (z) admits a unitary ACM, then all its roots have modulus one. This property is obviously transferred to each D m (z) dividing P n (z), which, in turn, implies the existence of a diagonal unitary ACM of D m (z).
Sufficiency: Since P n (z) can be represented as the product of n monic binomials whose free terms are complex numbers of modulus one by hypothesis, then a diagonal ACM of P n (z) with entries having modulus one exists. This ACM is unitary [2].
When n = 2, it is easy to convince oneself that Theorem 2. A monic complex, second-degree polynomial is the characteristic polynomial of a unitary matrix of order 2, if and only if it has the structure with r 2 ∈ [0, 2] and ϑ ∈ (−π, π]. Proof. To demonstrate this double statement it is sufficient to explicitly find the two roots of (51) for the necessity and to use simple geometric arguments (or exploit Theorem 1) for the sufficiency.
We additionally remark that, for r 2 > 2 , the principal arguments of the two roots of (51) coincide with χ, and the product of their modules, both different from unity, is still one.
When the order of the unitary matrix is greater than 2, it is still possible to find peculiar properties possessed by the coefficients of the corresponding characteristic polynomial. However, there are polynomials of degrees higher than 2 and structures similar to (51), which also have roots with moduli different from 1. We prove here the following useful necessary condition on the structure of the characteristic polynomial of a 3 × 3 unitary matrix Theorem 3. The complex third-degree characteristic polynomial of any unitary matrix of order 3 has necessarily the structure: where r ∈ [0, 3], θ 1 ∈ (−π, π] and θ ∈ (−π, π].
Proof. Given any three real numbers α, β, and γ, it is always possible to find three real numbers r, θ 1 , and θ that satisfy the following relations: e iα e iβ e iγ = e iθ .
Similar to Theorem 1, Theorem 3 can be extended to a generic degree n. We emphasize that the polynomial form (52) and its roots have some remarkable properties. For example, the passage from z to the auxiliary variable u = ze iψ leads, up to a global phase factor, to a polynomial with the same structure (52) after the angle shifts θ 1 = θ 1 + ψ and θ = θ + 3ψ (these shifts are unimportant for what concerns the polynomial structure since the angles θ 1 and θ can take the same range of values as θ 1 and θ ). Therefore, the three roots of the new polynomial have the same modules and relative principal arguments as the roots of the original polynomial (52). Another interesting property resulting from Equation (54) is that, if (52) admits one root with modulus one, the other two roots must have reciprocal modules (including the case in which they also have modulus one).
Note that Theorem 3 only expresses a necessary condition and, therefore, there exist polynomials with structure (52) that do not admit unitary ACM. Algebraic relations among the three parameters in the expression of P 3 (z) not implied by the structure of the polynomial itself can ensure that P 3 (z) admits a unitary ACM (vide infra).
Consider, for example, the case r = 3. The polynomial z 3 − 3z 2 + 3e iπ z − e iπ has the form (52), from which it is obtained by (arbitrarily) choosing θ 1 = 0 and θ = π. This is not the characteristic polynomial of a unitary 3 × 3 matrix, since its roots are −1 and 2 ± √ 3; accordingly, θ = π = Arg e i(3θ 1 ) = 0. The relation θ = 3θ 1 guarantees, instead, the existence of three roots of modulus 1 when r = 3, as is easily seen geometrically or from the fact that in this case P 3 (z) = (z − e iθ 1 ) 3 . As another example, for r = 1, (52) admits a unitary ACM for any θ 1 ∈ (−π, π] and θ ∈ (−π, π], as the roots of the polynomial are e iθ 1 and e i θ−θ 1 ±π 2 . The analysis in the next section will provide expressions for the coefficients of polynomial (52), making it the characteristic polynomial of a unitary ACM.

Construction of a Trial Unitary ACM
In Section 3, it was convenient to search for an ACM of a generic monic complex polynomial (5) of the third degree in the unknown z by resorting to the canonical form (4) of the polynomial through a translation of the complex variable z. There are two advantages to using polynomial (4) in the translated variable η: the number of parameters appearing in the polynomial expression is reduced from 3 to 2 (namely, p and q instead of c 1 ,c 2 , and c 3 ), and the very simple recipe (9) allows one to obtain the ACM of the given polynomial from the ACM of its canonical form (4).
It is clearly possible to pass from P 3 (z) to its canonical form through the appropriate translation of z. Unfortunately, such a strategy is not convenient in this case, since the canonical polynomial generally does not admit a unitary ACM, and thus the further mathematical step complicates the achievement of our goal. Therefore, we propose a different approach that combines geometrical and analytical considerations.
Exploiting Theorems 1 and 2, we can represent each element P 3 (z) of the set [P 3 (z)] of all and only the third-degree polynomials that admit a unitary ACM and share the root 1 as follows: (56) where r 2 ∈ [0, 2] and ϑ ∈ (−π, π]. Each polynomial (56) possesses, by construction, a unitary ACM and, vice versa, the characteristic polynomial of any 3 × 3 unitary matrix with a unit eigenvalue is a particular realization of (56).
The last equality is based on the following identity [58], which gives the principal argument of a generic complex number (x + iy) ∈ Ω, where Ω coincides with the complex plane cut along the negative x-axis: Arg(x + iy) = 2 Arctan y x + x 2 + y 2 .
As expected, this formula leaves the argument of a complex number of null modulus undefined and, for any fixed negative x, implies lim y−→0 ± Arg(x + iy) = ±π.
The above equations clearly show that [P 3 (z)] is obtained as a subset of [P 3 (z)] by introducing the relations (57)-(59) among the parameters r, θ 1 , and θ, which are arbitrary in their ranges of definition in the polynomial expression (52). In particular, θ is compatible with (56) only if where r 2 ∈ [0, 2] and θ ∈ (−π, π]. Note that the range of r 2 values is dictated by Theorem 2, and the corresponding range of r values resulting from Equation (58) for any given θ 1 is a subset of the interval [0, 3] in Equation (52), in accordance with the fact that [P 3 (z)] is a subset of [P 3 (z)]. On the other hand, since ϑ ∈ (−π, π], Equation (62) implies that θ ∈ (−2π, 2π], which can be clearly reduced to the principal interval [−π, π]. We emphasize that requiring (52) to be the characteristic polynomial of a unitary matrix with a real positive eigenvalue (that is, 1) entailed relations between the three parameters in Equation (52), thus leading to the dependence of polynomial (63) on only two parameters, r 2 and θ.
At this point, we can construct an ACM for a polynomial of the kind (63). The polynomial factorization in Equation (56) enables a block diagonal form for the ACM, with the one-dimensional block simply equal to 1. The diagonal elements of the 2 × 2 block can be set equal [2] and are immediately obtained from Vieta's formula for the sum of the roots of polynomial (51). Then, simple algebraic considerations lead to the following ACM of polynomial (63): It is easy to verify that the characteristic polynomial of (64) coincides with (63) for all the allowed values of the parameters r 2 and θ. The three columns of W 3 are normalized and mutually orthogonal, and these properties imply the unitarity of matrix W 3 . If r 2 > 2, and thus it is out of the range given in Theorem 4, the first two columns of the matrix are not orthogonal for any θ, and then W 3 is no longer unitary. It is worth noting that (64) can be seen as the result of a partial diagonalization of another unitary matrix with the same eigenvalues and that all the other ACMs of a polynomial (63) can be obtained by unitary transformation of (64).
Once an ACM is constructed for any polynomial (63), the subset of [P 3 (z)] that contains all and only the polynomials (52) admitting a unitary ACM can be generated by rotating the roots of each polynomial (63) by an angle ∈ (−π, π]. This amounts to changing the complex variable z to u = ze i inP 3 (z). Then, up to a global phase factor e 3i , the polynomialP 3 (u) =P 3 (ze i ) is equal to The root 1 ofP 3 (z) corresponds to a general complex root of modulus one, e i , of P 3 (z).
[P 3 (z)] includes all and only the polynomials P 3 (z), which, by construction, admit a unitary ACM and, therefore, also satisfy the necessary condition expressed by Theorem 4.
We have thus proved that Theorem 5. A complex monic polynomial of the third degree is the characteristic polynomial of a unitary matrix of order 3 if and only if it has the structure (65), with r 2 ∈ [0, 2], θ ∈ (−π, π], and ∈ (−π, π]. Next, we accomplish the main objective of this section by constructing an ACM W 3 of P 3 (z). To this end, in analogy with recipe (9), we use the transformation z = ue −i to generate W 3 from the matrix W 3 in Equation (9) by proceeding as follows: where W 3 ≡ e −i W 3 . In light of our previous arguments, the characteristic polynomial of the matrix is polynomial (65). The unitary matrix (67) fully meets our goal. To reach this objective, we first characterized the class [P 3 (z)] of all and only the polynomials that admit a unitary ACM, thus removing the difficulties related to the lack of sufficiency of polynomial (52). Then, exploiting recipe (66), we established the form W 3 of a unitary ACM for any polynomial belonging to [P 3 (z)].
In the following, we illustrate our approach through some applications.

Examples
• Given the parameter σ = ±1, consider the subclass of polynomials (65) with = In Equation (68) we exploited the identity e −i (1−σ)π 2 = σ. It is easy to verify that P 3σ (σ) = 0, which means that (68) is the most general polynomial with the real root σ and an ACM which, in view of (67), can be written on demand as • Consider the polynomial obtained by setting r 2 = 0, = −θ 1 , and θ = θ − 3θ 1 in Equation (65). With these choices, using (67) we immediately find that polynomial (70) admits the ACM When r = 1, the polynomial (70) coincides with polynomial (52) up to a trivial change of notation (θ is substituted with θ ). This polynomial is then the characteristic polynomial of a unitary matrix for any θ and θ 1 , as we observed in Section 5.1, with eigenvalues that are now immediately derived from the matrix (71) as e iθ 1 and e i θ −θ 1 ±π 2 .
• For r = 0, (52) yields the polynomial z 3 − e iθ = 0 and, whatever the value, Equations (57) and (62) imply that r 2 = 1, and θ = 2π in Equation (65). The corresponding ACM, with structure (67), takes the form Apart from the cases r = 1 or r = 0 examined above, for a generic r Equation ( which is of the form (52) with r = 2, θ 1 = − + π and θ = 2π − 3 . It is easy to see that this polynomial coincides with which has the form (65) with θ = 2π, except for the fact that r 2 / ∈ [0, 2], as is instead required in Theorem 5 because of Theorem 2. As a consequence, the polynomial (74) or, equivalently, (73) cannot be the characteristic polynomial of a unitary 3 × 3 matrix. • Polynomial (73) obviously admits an ACM of the form (20), which is obtained using the general protocol in Section 3. Moreover, the insertion of r 2 = 3 and θ = 2π in matrix (67) leads to another ACM of polynomial (73) of the form which is manifestly non-unitary. In general, W 3nu and the ACM of the form (20) are not similar. A sufficient condition for their similarity is that their three common complex eigenvalues are distinct. In this case, in fact, both matrices are surely diagonalizable [2] and, therefore, traceable (in general, not unitarily) to the same diagonal matrix.

Discussion and Conclusions
Finding a matrix with an assigned characteristic polynomial is a classic inverse problem solved by Frobenius a long time ago. In Section 2 we observed that there are infinitely many other solutions, generally not equivalent to the one found by Frobenius. The exhaustive description of the set S(P n (z)) of all complex matrices sharing the same characteristic polynomial is still an open problem. Among the reasons for the missing solution to this problem, it is useful to consider that, even if S(P n (z)) is invariant under similarity transformations, it includes non-similar (and in general not even equivalent) matrices. Another problem is that the structure of the non-empty subset of non-sparse CMs belonging to S(P n (z)), unlike the set of sparse CMs [35], has not yet been fully characterized.
A related inverse problem, stimulated by applications of current interest to both physicists and mathematicians, is the search for ACMs constrained to possess prescribed structural properties, such as, for example, unitarity, positive semi-definiteness, or Hermiticity.
The first focus of this study is the construction of a new ACM of a generic monic and complex third-degree polynomial P 3 (z), characterized by versatility for applications. This objective is pursued by parameterizing the elements of the ACM in such a way that they lend themselves to additional constraints dictated by specific problems (of which only the structural properties are exploited). To the best of our knowledge, our investigation of inverse problems of this kind opens a new fruitful chapter in this research area whose central goal is the proposal of new ACMs which, in particular, can be CMs. We address the three above-mentioned constrained inverse problems, providing methodology and results that aim for broad applicability and are potentially transferable to solving analogous problems involving higher-degree polynomials. The adopted step-by-step approach builds new specific classes of unconstrained or constrained matrices as ACMs of suitably given polynomials, relaxing from the outset any condition on the degree of the minimal polynomial. In particular, the strategy implemented, as well as the mathematical tools used, is not influenced by any FCM-based or FCM-inspired technique.
The elements of the ACM that we construct as a solution to the general inverse problem are single-valued complex functions of the coefficients of the given generic polynomial. Exploiting the structural properties of this ACM, we find the algebraic expressions for the three, generally complex, roots of its complex characteristic polynomial.
It is remarkable that, when the polynomial becomes real, the associated general ACM smoothly becomes Hermitian under easy-to-find necessary and sufficient conditions on the coefficients of the polynomial described by (45). Using simply the fact that the ACM becomes Hermitian if and only if ∆ ≤ 0, we are able to extend the trigonometric representation of the three roots of the real polynomial to all possible cases, that is, even when (29) does not hold. This representation is obtained without resorting to the wellknown Cardano-Del Ferro formulas.
We emphasize that the FCM of a characteristic polynomial does not undergo any structural change when the coefficients of the complex polynomial become real, thus providing no additional information on the polynomial roots. For this reason, we claim that the FCM has a lower flexibility than our ACM. We show how to use this flexibility to obtain an ACM of a prescribed characteristic polynomial on demand, applying our procedure to the important problem of finding a density matrix, particularly that of a qutrit.
A second, novel constrained inverse problem addressed here consists in finding a unitary ACM of a generic polynomial with three roots of modulus one. Excluding the trivial case in which the unitary ACM can be directly given in diagonal form, we first reach the intermediate goal (interesting in itself) of parameterizing c 1 , c 2 , and c 3 in the polynomial (5) so as to set the necessary conditions on the structure of a polynomial to admit an ACM. By setting appropriate relations between the parameters through coupled geometric and analytical considerations, we further constrain the polynomial structure in such a way as to identify the set [P 3 (z)] of all and only the third-degree polynomials that admit a unitary ACM. Then, we conclude our analysis by constructing the associated ACM.
The results of this study can be further explored and usefully applied to physical and mathematical contexts, including, at their intersection, the research area of quantum computing. For example, for time-dependent parameters, the prescription of a time-dependent characteristic polynomial of [P 3 (z)] or [P 3 (z)] leads to a unitary time-dependent matrix, hence to the pertinent time-dependent Hamiltonian that generates the time evolution of a qutrit, whose properties can thus be traced back to the prescription of P 3 [z]. In mathematical contexts, the analysis developed in this study can be extended to polynomials of a higher degree. For example, in the case of a fifth-degree polynomial, our protocol may provide conditions on the coefficients of the polynomial such that its roots are real. The rich analysis enabled by the use of third-degree polynomials in this study sets a clearer basis to conceive the extension of the analysis to higher-degree polynomials. Considering that AB = 1 and using Equation (27), after some lengthy algebra one obtains Choosing the root in the last expression in accordance with Equation (27), we thus havẽ from which the root expressions (35) and (36) immediately result. Consider, for example, the polynomial z 3 + 4z − 7 √ 3 = 0, which is directly given in canonical form, so that c 1 = 0, c 2 = p, and c 3 = q. In this case, u = −7 9 16 , whence A = 2, B = 1 2 and, therefore, X = 5 2 , Y = − √ 3 2 . Equations (34)-(36) thus give z 1 = 1 2 (− √ 3 + 5i),z 2 = − 1 2 ( √ 3 + 5i), and z 3 = √ 3, which are readily verified to be the roots of the above polynomial.

Appendix A.2. Comments
Comment A1. A monic polynomial is a univariate polynomial in which the leading coefficient is equal to 1.

Comment A2.
A square matrix is called derogatory (non-derogatory) when the degree of its minimal polynomial is less than (equal to) the order n of the matrix. The term derogatory has been coined by Sylvester in the early years following 1880. Etymologically, it probably originates from the Latin verb "derogare", in its particular meaning of "decrease", to underline that the degree of the minimal polynomial of the matrix is less than n.
Comment A3. As reported by Hawkins [3], the term companion matrix was coined by Loewy in 1917 [59]. In 1946, MacDuffee introduced the term "companion matrix" as a translation from the German "Begleitmatrix".
Comment A4. We point out that, in this case, the Frobenius matrix is no longer diagonalizable, since, being non-derogatory by construction, it necessarily has at least one eigenvalue with geometric multiplicity smaller than the (algebraic) multiplicity.
Comment A5. By parametric we mean that the entries of the ACM can be functions of the polynomial coefficients.
Comment A6. That is, under any transformation of the form A −→ P −1 AP, where P is a non-singular matrix.
Comment A7. The Cayley-Hamilton theorem states that every square matrix over a commutative ring (such as the real or complex numbers, or the integers) satisfies its own characteristic equation.
Comment A8. An equivalent solution was obtained in [49], using an angle offset by −π with respect to Φ 13 . Solutions in the trigonometric form of the canonical (or depressed) cubic equation equivalent to those presented here and in [49] were obtained by François Viète (1540-1603) for the case in which the polynomial in Equation (4) is real.