An Overview of the Eseries Class¶
Exponential-series representation of time-dependent quantum objects¶
The eseries object in QuTiP is a representation of an exponential-series expansion of time-dependent quantum objects (a concept borrowed from the quantum optics toolbox).
An exponential series is parameterized by its amplitude coefficients \(c_i\) and rates \(r_i\), so that the series takes the form \(E(t) = \sum_i c_i e^{r_it}\). The coefficients are typically quantum objects (type Qobj: states, operators, etc.), so that the value of the eseries also is a quantum object, and the rates can be either real or complex numbers (describing decay rates and oscillation frequencies, respectively). Note that all amplitude coefficients in an exponential series must be of the same dimensions and composition.
In QuTiP, an exponential series object is constructed by creating an instance of the class qutip.eseries
:
In [1]: es1 = eseries(sigmax(), 1j)
where the first argument is the amplitude coefficient (here, the sigma-X operator), and the second argument is the rate. The eseries in this example represents the time-dependent operator \(\sigma_x e^{i t}\).
To add more terms to an qutip.eseries
object we simply add objects using the +
operator:
In [2]: omega=1.0
In [3]: es2 = (eseries(0.5 * sigmax(), 1j * omega) +
...: eseries(0.5 * sigmax(), -1j * omega))
...:
The qutip.eseries
in this example represents the operator \(0.5 \sigma_x e^{i\omega t} + 0.5 \sigma_x e^{-i\omega t}\), which is the exponential series representation of \(\sigma_x \cos(\omega t)\). Alternatively, we can also specify a list of amplitudes and rates when the qutip.eseries
is created:
In [4]: es2 = eseries([0.5 * sigmax(), 0.5 * sigmax()], [1j * omega, -1j * omega])
We can inspect the structure of an qutip.eseries
object by printing it to the standard output console:
In [5]: es2
Out[5]:
ESERIES object: 2 terms
Hilbert space dimensions: [[2], [2]]
Exponent #0 = -1j
Quantum object: dims = [[2], [2]], shape = (2, 2), type = oper, isherm = True
Qobj data =
[[ 0. 0.5]
[ 0.5 0. ]]
Exponent #1 = 1j
Quantum object: dims = [[2], [2]], shape = (2, 2), type = oper, isherm = True
Qobj data =
[[ 0. 0.5]
[ 0.5 0. ]]
and we can evaluate it at time t by using the qutip.eseries.esval
function:
In [6]: esval(es2, 0.0) # equivalent to es2.value(0.0)
Out[6]:
Quantum object: dims = [[2], [2]], shape = (2, 2), type = oper, isherm = True
Qobj data =
[[ 0. 1.]
[ 1. 0.]]
or for a list of times [0.0, 1.0 * pi, 2.0 * pi]
:
In [7]: times = [0.0, 1.0 * pi, 2.0 * pi]
In [8]: esval(es2, times) # equivalent to es2.value(times)
Out[8]:
array([ Quantum object: dims = [[2], [2]], shape = (2, 2), type = oper, isherm = True
Qobj data =
[[ 0. 1.]
[ 1. 0.]],
Quantum object: dims = [[2], [2]], shape = (2, 2), type = oper, isherm = True
Qobj data =
[[ 0. -1.]
[-1. 0.]],
Quantum object: dims = [[2], [2]], shape = (2, 2), type = oper, isherm = True
Qobj data =
[[ 0. 1.]
[ 1. 0.]]], dtype=object)
To calculate the expectation value of an time-dependent operator represented by an qutip.eseries
, we use the qutip.expect
function. For example, consider the operator \(\sigma_x \cos(\omega t) + \sigma_z\sin(\omega t)\), and say we would like to know the expectation value of this operator for a spin in its excited state (rho = fock_dm(2,1)
produce this state):
In [9]: es3 = (eseries([0.5*sigmaz(), 0.5*sigmaz()], [1j, -1j]) +
...: eseries([-0.5j*sigmax(), 0.5j*sigmax()], [1j, -1j]))
...:
In [10]: rho = fock_dm(2, 1)
In [11]: es3_expect = expect(rho, es3)
In [12]: es3_expect
Out[12]:
ESERIES object: 2 terms
Hilbert space dimensions: [[1, 1]]
Exponent #0 = (-0-1j)
(-0.5+0j)
Exponent #1 = 1j
(-0.5+0j)
In [13]: es3_expect.value([0.0, pi/2])