Closed oameye closed 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.
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.
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.
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:
(O,)
gives a Lindblad dissipator with operator O
. (Pr"k",O)
gives a Lindblad dissipator with rate Pr"k"
and operator O
(i.e., corresponds to k (O ρ O^† - 1/2 {O^† O,ρ})
). (Note that since formal square roots are not supported, we cannot just do c = sqrt(Pr"k") O
and use that in the previous version).((:i,:j),Pr"k_i,j",a(:i,:j))
gives a formal sum over dissipators, ∑ᵢⱼ kᵢⱼ (aᵢⱼ ρ aᵢⱼ^† - 1/2 {aᵢⱼ^† aᵢⱼ,ρ})
.(Pr"k",(a(),b())
corresponds to k/2 (a ρ b^† + b ρ a^† - 1/2 {b^† a,ρ} - 1/2 {a^† b,ρ})
(note that this automatically symmetrizes the two-operator terms to ensure that the master equation maintains ρ Hermitian).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()
Wow, super cool! Thanks for following this up. This will sure be useful for later and enhances the capabilities of the package.
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.