1

I'm trying to solve a system of first order differential equations that looks like this:

import numpy as np
from sympy import *

tR1201 = Rational(1,2)
tR1212 = Rational(1,2)
tB12 = Rational(1,2)
tB01 = Rational(1,2)
Gamma = Rational(1,4)
delta = Rational(1,10)
hbar = 1 

t = Symbol('t')
p1 = Function('p1')(t)
p2 = Function('p2')(t)
p3 = Function('p3')(t)
p4 = Function('p4')(t)
Psi = Matrix([[p1],[p2],[p3],[p4]])
Coupling = Matrix([[0,tB01,tR1201,0],[tB01,0,0,tR1212],[tR1201,0,delta +(-I*Gamma),tB12],[0,tR1212,tB12,delta +(-I*Gamma)]])
diffeq = I*hbar * diff(Psi, t) - Coupling*Psi
solution = dsolve(diffeq,[p1,p2,p3,p4])

When I run it I get this error:

line 1122, in eigenvals raise MatrixError("Could not compute 
eigenvalues for {}".format(self))

MatrixError: Could not compute eigenvalues for Matrix([[0, 1/2, 1/2, 0], [1/2, 0, 0, 1/2], [1/2, 0, 1/10 - I/4, 1/2], [0, 1/2, 1/2, 1/10 - I/4]])

Part of dsolve involves finding eigenvalues, and this error suggests it's not possible to compute eigenvalues for the matrix Coupling. However, I've found the eigenvalues with another method and they are complex. Are complex eigenvalues an issue for Sympy?

I've found similar questions asked (like this one: Computation of symbolic eigenvalues with sympy) but the answers to these other questions did not help in this case.

ADag
  • 11
  • 1
  • SymPy 1.1.1 fails to find `Coupling.eigenvals()`. The current dev version does that, but fails if there is also a factor of I. So, at present SymPy cannot solve this system. I raised an [issue](https://github.com/sympy/sympy/issues/14517). –  Mar 16 '18 at 07:25

0 Answers0