jfeist / QuantumAlgebra.jl

Quantum operator algebra in Julia
MIT License
60 stars 10 forks source link

General operator instead of ladder opertors #16

Closed oameye closed 1 year ago

oameye commented 1 year ago

I am trying to compute the Lindbladian for a quantum system using the QuantumAlegbra.jl package. The calculation requires me to compute commutators between the density matrix/operator and ladder operators. However, the package currently only provides the functionality to describe ladder operators, and not to compute commutators with them and the density matrix/operator.

I would be willing to help implement this functionality if it is not too difficult. Please let me know if this is something that can be added to the package.

jfeist commented 1 year ago

In principle, it would be possible to add a general operator as an abstract object that does not commute with anything else. However, this would probably require some changes in the logic (e.g., it would have to be ignored when considering whether an expression is normal ordered). Could you explain the use case in a bit more detail? If you "just" want to simplify the Lindbladian A ρ A^† - 1/2 {A^† A, ρ} for some given jump operator A that is a combination of several operators, you could just simplify A and A^† A separately.

oameye commented 1 year ago

My end goal is to compute the e.o.m. of the expectation value of the ladder operators of an open quantum system.

Suppose we have the system given by time evolution $\frac{d \rho}{dt}=-\frac{i}{\hbar}[H, \rho]+L\rho$. Here the Hamiltonian $H$ could be a simple driven harmonic oscillator given in the ladder operators $H=\Delta a^\dagger a+F(a^\dagger +a)$ which than dissipates linearly with the bath with the dissapator $L\rho =\kappa (2 a \rho a^\dagger - a^\dagger a \rho - \rho a^\dagger a)$.

To compute the e.o.m. of ladder operator we have to compute trace $\mathrm{Tr}(b\frac{d \rho}{dt})=\frac{d\mathrm{Tr}(b \rho)}{dt}=\frac{d\langle b\rangle}{dt}$. Using the cyclicity of the trace, the e.o.m. simplify.

So just implementing the concept of an general operator as an abstract object that does not commute with anything else will be enough. I guess the challenge will be to implement the simplification of the trace.

I managed to implement what I need in Mathematica with the NCAlgebra package.

jfeist commented 1 year ago

Ok thanks. I assumed that this might be the end goal. Calculating these equations of motion does not actually require definition of a general or density matrix operator, as you can directly obtain them from the equations of motion in the Heisenberg picture (see, e.g., https://en.wikipedia.org/wiki/Lindbladian#Heisenberg_picture). You should be able to evaluate these directly with QuantumAlgebra, but I might add a routine for this as it comes up many times. I'll keep the issue open until I've done so.

jfeist commented 1 year ago

The main branch (install with ]add QuantumAlgebra#main) now contains a function heisenberg_eom(A, H, Ls) that you can use to obtain the equations of motion for any operator A under Lindblad evolution with Hamiltonian H and dissipators defined by the Ls tuple. Ls must be a tuple of tuples, where each tuple can have several forms depending on the type of dissipators you want:

Quick example:

julia> using QuantumAlgebra
julia> QuantumAlgebra.auto_normal_form()
julia> H = Pr"ω"*adag()*a();
julia> Ls = ( (Pr"κ"*(1+Pr"n"), a()), (Pr"κ"*Pr"n", adag()) );

julia> heisenberg_eom(a(),H,Ls)
-1//2 κ a() - 1i ω a()

julia> heisenberg_eom(adag()a(),H,Ls)
n κ  - κ a†() a()
oameye commented 1 year ago

Wow, super cool! Thanks for following this up. This will sure be useful for later and enhances the capabilities of the package.