用 Odeint 求解复矩阵微分方程

Solve complex matrix differential equation with Odeint

我想解一个矩阵微分方程,like this one:

import numpy as np
from scipy.integrate import odeint


def deriv(A, t, Ab):
    return np.dot(Ab, A)


Ab = np.array([[-0.25,    0,    0],
               [ 0.25, -0.2,    0],
               [    0,  0.2, -0.1]])

time = np.linspace(0, 25, 101)
A0 = np.array([10, 20, 30])

MA = odeint(deriv, A0, time, args=(Ab,))

但是,这在具有复杂矩阵元素的情况下不起作用。我正在寻找类似于 scipy.integrate.complex_odeodeint 的东西。如果这不可能,我应该使用什么其他库来执行集成?感谢您的帮助!

odeintw odeint 的包装器必须以与问题中相同的方式使用。但是,初始值A0必须是复值向量。