magnopy.solve_via_colpa#
- magnopy.solve_via_colpa(D, return_inverse=False)[source]#
Diagonalize grand-dynamical matrix following the method of Colpa (section 3, remark 1 of [1]).
Solves the Bogoliubov Hamiltonian of the form
\[\hat{H} = \sum_{r^{\prime}, r = 1}^m a_{r^{\prime}}^{\dagger}\boldsymbol{\Delta}_1^{r^{\prime}r}a_r + a_{r^{\prime}}^{\dagger}\boldsymbol{\Delta}_2^{r^{\prime}r}a_{m+r}^{\dagger} + a_{m+r^{\prime}}^{\dagger}\boldsymbol{\Delta}_3^{r^{\prime}r}a_r + a_{m+r^{\prime}}^{\dagger}\boldsymbol{\Delta}_4^{r^{\prime}r}a_{m+r}^{\dagger}\]ensuring the bosonic commutation relations.
In a matrix form the Hamiltonian can be written as
\[\hat{H} = \boldsymbol{\cal A}^{\dagger} \boldsymbol{D} \boldsymbol{\cal A}\]where
\[\begin{split}\boldsymbol{\cal A} = \begin{pmatrix} a_1 \\ \cdots \\ a_m \\ a_{m+1} \\ \cdots \\ a_{2m} \\ \end{pmatrix}\end{split}\]After diagonalization the Hamiltonian has the form
\[\hat{H} = \boldsymbol{\cal B}^{\dagger} \boldsymbol{\mathcal{E}} \boldsymbol{\cal B}\]where
\[\begin{split}\boldsymbol{\cal B} = \begin{pmatrix} b_1 \\ \cdots \\ b_m \\ b_{m+1} \\ \cdots \\ b_{2m} \\ \end{pmatrix}\end{split}\]- Parameters:
- D(2N, 2N) array-like
Grand dynamical matrix. If it is Hermitian and positive-defined, then obtained eigenvalues are positive and real.
\[\begin{split}\boldsymbol{\mathcal{D}} = \begin{pmatrix} \boldsymbol{\Delta_1} & \boldsymbol{\Delta_2} \\ \boldsymbol{\Delta_3} & \boldsymbol{\Delta_4} \end{pmatrix}\end{split}\]- return_inversebool, default False
Whether to return \((\boldsymbol{G}^{\dagger})^{-1}\) instead of \(\boldsymbol{G}^{\dagger}\).
- Returns:
- E(2N,) numpy.ndarray
The eigenvalues. It is an array of the diagonal elements of the diagonal matrix \(\boldsymbol{\mathcal{E}}\). First N elements correspond to the \(b^{\dagger}_1b_1, \dots, b^{\dagger}_mb_m\) and last N elements - to the \(b^{\dagger}_{m+1}b_{m+1}, \dots, b^{\dagger}_{2m}b_{2m}\).
Eigenvalues are sorted individually for the first N and the last N elements, based on the transformation matrix and not on the values of E itself.
\[\boldsymbol{\mathcal{E}} = (\boldsymbol{G}^{\dagger})^{-1} \boldsymbol{D} \boldsymbol{G}^{-1}\]- G(2N, 2N) numpy.ndarray
Transformation matrix, that changes the basis from the original set of bosonic operators \(\boldsymbol{a}\) to the set of new bosonic operators \(\boldsymbol{b}\) which diagonalize the Hamiltonian:
\[ \begin{align}\begin{aligned}\boldsymbol{\cal A} = \boldsymbol{G} \boldsymbol{\cal B}\\\boldsymbol{\cal B} = \boldsymbol{G}^{-1} \boldsymbol{\cal A}\end{aligned}\end{align} \]The rows are ordered in the same way as the eigenvalues.
If
return_inverse == False, then \(\boldsymbol{G}^{\dagger}\) is returned.If
return_inverse == True, then \((\boldsymbol{G}^{\dagger})^{-1}\) is returned.
- Raises:
- ColpaFailed
If the algorithm fails. Typically it means that the grand dynamical matrix \(\boldsymbol{D}\) is not positive-defined.
- ValueError
If the grand dynamical matrix is not square or its shape is not even.
References
[1]Colpa, J.H.P., 1978. Diagonalization of the quadratic boson hamiltonian. Physica A: Statistical Mechanics and its Applications, 93(3-4), pp.327-353.
Examples
For already diagonal matrix this function does not do much
>>> import magnopy >>> D = [[1, 0], [0, 2]] >>> E, G = magnopy.solve_via_colpa(D) >>> E array([1., 2.]) >>> G array([[ 1., -0.], [-0., 1.]])
>>> import magnopy >>> D = [[1, 1j], [-1j, 2]] >>> E, G = magnopy.solve_via_colpa(D) >>> E array([0.61803399+0.j, 1.61803399+0.j]) >>> G array([[ 1.08204454-0.j , 0. +0.41330424j], [-0. -0.41330424j, 1.08204454-0.j ]]) >>> E, G_inv = magnopy.solve_via_colpa(D, return_inverse=True) >>> E array([0.61803399+0.j, 1.61803399+0.j]) >>> G_inv array([[1.08204454+0.j , 0. -0.41330424j], [0. +0.41330424j, 1.08204454+0.j ]])