Upon solving equation using sympy, the real variable is giving complex solution. I don’t understand what I am doing wrong.
One more thing, when solving for sig (which is sig1+sp.I*sig2), the solution contains sig1 and sig2, they should be only on left hand side as sig.
Following is the code I write in Google Colab
import sympy as sp
chi, alpha = sp.symbols('chi alpha')
pop, delta,T1, T2, sig1, sig2, E1, E2, dip1, dip2, hbar, pop_eq, omega, c, N = sp.symbols('pop delta T1 T2 sig1 sig2 E1 E2 dip1 dip2 hbar pop_eq omega c N', real='True')
dip = dip1+sp.I*dip2
dipc = sp.conjugate(dip)
E = E1+sp.I*E2
Ec = sp.conjugate(E)
sig = sig1+sp.I*sig2
sigc = sp.conjugate(sig)
eq1=sp.Eq(((sp.I*delta-1/T2) * sigc) - (sp.I/hbar) * (dip*E*pop),0)
eq2=sp.Eq(-(pop+1)/T1 + (2*sp.I/hbar) * (dipc*Ec*sig-dip*E*sigc),0)
result = sp.solve([eq1, eq2],(pop, sig))
Problem 1. pop can not be a complex number, but solution gives complex
Problem 2. sig (sig1+sp.I*sig2) should be only on left side only
Problem 3. Sometimes it gives trivial solution, how to omit trivial solution?
Purple Monkey is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.