Calculate inverse of an operator

233 views
Skip to first unread message

M Cotrufo

unread,
Dec 10, 2016, 2:53:01 PM12/10/16
to QuTiP: Quantum Toolbox in Python
Hi all,
Is there any function in QuTIP to calculate the inverse of an hermitian operator?
I checked both in the docs and in this group but I didnt find anything about it...

Paul Nation

unread,
Dec 10, 2016, 2:57:37 PM12/10/16
to QuTiP Group
Nope.  But you most likely do not need to calculate the actual inverse.  Often times you are looking at an equation of the form A^-1 * x = y, which can be recast as A * y = x.  Thus you just need to do a linear solve.

-P

--
You received this message because you are subscribed to the Google Groups "QuTiP: Quantum Toolbox in Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qutip+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

M Cotrufo

unread,
Dec 10, 2016, 3:07:17 PM12/10/16
to QuTiP: Quantum Toolbox in Python
Hi Paul,
thanks for your very quick answer (as usual!)
Unfortunately for this specific case I probably need to explicit calculate the inverse. In case you have access to PRL, what I'm trying to do is to costruct the operator Q_j defined in eq. 9 of this paper http://journals.aps.org/prl/abstract/10.1103/PhysRevLett.76.1055 , which means that I need to calculate the operator 1/sqrt(a.dag()* a) , where a is the annihilation operator of a harmonic oscillator.

I was wondering: is there a way to convert an operator to a regular matrix, and then to convert a matrix to an operator? In this way, I could just calculate the inverse of the matrix and then convert it to an operator.

Michele

M Cotrufo

unread,
Dec 10, 2016, 3:17:41 PM12/10/16
to QuTiP: Quantum Toolbox in Python
Ok, I found the method "full()" to get the matrix corresponding to an operator, and I see that you can create an operator by just passsing the numerical values. I will try and see if it works!

Paul Nation

unread,
Dec 10, 2016, 3:23:47 PM12/10/16
to QuTiP Group
Yes, that returns a dense array.  Or, you can access the sparse matrix using Q.data.  In your case, I think the full() method is probably better as the inverse is likely dense anyway.  Note however that by converting to a dense matrix, your Hilbert space dimensions will be quite restricted.

-P
Reply all
Reply to author
Forward
0 new messages