EvolutionSuperOperator#

Class representing evolution superoperator

This class represents evolution superoperator at discrete times.

Examples

Evolution superoperator can be

created from a known Hamiltonian and relaxation tensor

>>> import quantarhei as qr
>>> # We use the predefined Aggregate - dimer of two-level systems
>>> # with an environment
>>> tagg = qr.TestAggregate(name="dimer-2-env")
>>> tagg.set_coupling_by_dipole_dipole()
>>> tagg.build()
>>> # we get the existing predefined time axis for the calculations
>>> time = tagg.get_SystemBathInteraction().TimeAxis
>>> print(time.start, time.length, time.step)
0 1000 1.0

We create relaxation tensor and obtain renormalized Hamiltonian from standard Redfield theory (stR)

>>> RR, HH = tagg.get_RelaxationTensor(time, relaxation_theory="stR")

We initialize evolution superoperator

>>> eSO = EvolutionSuperOperator(time, ham=HH, relt=RR)
>>> eSO.calculate()

We create initial condition. Dimension of the problem is 3 (ground state and two excited states of the dimer)

>>> dim = HH.dim
>>> print(dim)
3
>>> rho = qr.ReducedDensityMatrix(dim=dim)
>>> rho.data[2,2] = 1.0

Now we calculate density matrix evolution using a propagator

>>> prop = tagg.get_ReducedDensityMatrixPropagator(time,
...                                                relaxation_theory="stR")
>>> rhot = prop.propagate(rho)

Comparing the results at one point can be done like this:

>>> rhot_eSO = eSO.apply(100.0, rho)
>>> dat_100_eSO = rhot_eSO.data
>>> dat_100     = rhot.data[100,:,:]
>>> numpy.allclose(dat_100_eSO, dat_100)
True

To see the full aggreement, we may plot all the times calculated with both methods. We plot the dynamics calculated using the evolution superoperator only every 20 fs using asterisks “*”

import quantarhei as qr import matplotlib.pyplot as plt import numpy

# We use the predefined Aggregate - dimer of two-level systems # with an environment tagg = qr.TestAggregate(name=”dimer-2-env”) tagg.set_coupling_by_dipole_dipole() tagg.build()

# we get the existing predefined time axis for the calculations time = tagg.get_SystemBathInteraction().TimeAxis

RR, HH = tagg.get_RelaxationTensor(time, relaxation_theory=”stR”)

eSO = qr.qm.EvolutionSuperOperator(time, ham=HH, relt=RR) eSO.calculate()

dim = HH.dim

rho = qr.ReducedDensityMatrix(dim=dim) rho.data[2,2] = 1.0

prop = tagg.get_ReducedDensityMatrixPropagator(time, relaxation_theory=”stR”) rhot = prop.propagate(rho)

rhot.plot(coherences=False, show=False)

time_skip = numpy.arange(0.0, 1000, 20.0) rhot_skip = numpy.zeros((50,3,3)) k = 0 for tm in time_skip: rhot_skip[k,:,:] = numpy.real(eSO.apply(tm, rho).data) k += 1

plt.plot(time_skip,numpy.real(rhot_skip[:,1,1]),”*g”) plt.plot(time_skip,numpy.real(rhot_skip[:,2,2]),”*g”)

plt.show()

We may want to calculate the evolution superoperator with a step larger than the one which we specified for evaluation of bath correlation functions (In this example we use predefined SystemBathInteraction object which holds this information). Our time axis is too dense for our needs. We specify a less dense one

>>> time2 = qr.TimeAxis(0.0, 1000, 50.0)

This one has the step of 50 fs. We define an evolution superoperator with this time:

>>> eSO2 = qr.qm.EvolutionSuperOperator(time2, HH, RR)

Now, to obtain the same results as before, we need to set a time step of the propagation to 1 fs as before. This is done by setting a “dense” time step with is N times shorter than the one specified in the time axis. In our case N = 50

>>> eSO2.set_dense_dt(50)
>>> eSO2.calculate()
>>> rhot_eSO = eSO.apply(100.0, rho)
>>> dat_100_eSO = rhot_eSO.data
>>> numpy.allclose(dat_100_eSO, dat_100)
True

We can calculate a similar picture as before, but now with an evolution superoperator calculated only every 50 fs.

import quantarhei as qr import matplotlib.pyplot as plt import numpy

# We use the predefined Aggregate - dimer of two-level systems # with an environment tagg = qr.TestAggregate(name=”dimer-2-env”) tagg.set_coupling_by_dipole_dipole() tagg.build()

# we get the existing predefined time axis for the calculations time = tagg.get_SystemBathInteraction().TimeAxis time2 = qr.TimeAxis(0.0, int(time.length/50), 50*time.step)

RR, HH = tagg.get_RelaxationTensor(time, relaxation_theory=”stR”)

eSO = qr.qm.EvolutionSuperOperator(time2, ham=HH, relt=RR) eSO.set_dense_dt(50) eSO.calculate()

dim = HH.dim

rho = qr.ReducedDensityMatrix(dim=dim) rho.data[2,2] = 1.0

prop = tagg.get_ReducedDensityMatrixPropagator(time, relaxation_theory=”stR”) rhot = prop.propagate(rho)

rhot.plot(coherences=False, show=False)

rhot_skip = numpy.zeros((time2.length,3,3)) k = 0 for tm in time2.data: rhot_skip[k,:,:] = numpy.real(eSO.apply(tm, rho).data) k += 1

plt.plot(time2.data,numpy.real(rhot_skip[:,1,1]),”*g”) plt.plot(time2.data,numpy.real(rhot_skip[:,2,2]),”*g”)

plt.show()

Class Details#

class quantarhei.qm.liouvillespace.evolutionsuperoperator.EvolutionSuperOperator(time: Any = None, ham: Any = None, relt: Any = None, pdeph: Any = None, mode: str = 'all', block: Any = None)[source]#

Bases: SuperOperator, TimeDependent, Saveable

Class representing evolution superoperator

Parameters:
  • time (TimeAxis) – TimeAxis obejct specifying the time points of the superoperator

  • ham (Hamiltonian) – Hamiltonian of the system

  • relt (relaxation tensor) – Relaxation tensor of the system

  • mode (str) – Mode of information storage. It can be “all” which means that all points of the evolution are stored, or it can be “jit” = just in (one) time. In the “jit” mode, only the “present” time of the evolution operator is stored.

  • block (tuple) – Evolution Superoperator is usually defined on the Liouville space derived from the complete system’s Hilbert space. We can specify a smaller block section of elements in the Liouville space, to limit the size of the calculation. Typical situation is calculate only the optical coherence block neede for the calculation of absorption spectra.

get_Hamiltonian() Any[source]#

Returns the Hamiltonian associated with thise evolution

set_dense_dt(Nt: int) None[source]#

Set a denser time axis for calculations between two points of the superoperator

Parameters:

Nt (int) – Number of steps between two points of the superoperator to be used for numerical propagation

update_dense_time(i: int) None[source]#

Update the start time of the dense_time

set_PureDephasing(pdeph: Any) None[source]#

Sets the PureDephasing object for the dynamic calculation

has_PureDephasing() bool[source]#

Return True if the EvolutionSuperOperator has pure dephasing

calculate(show_progress: bool = False) None[source]#

Calculates the data of the evolution superoperator

Parameters:

show_progress (bool) – When set True, reports on its progress and elapsed time

This function MUST NOT be called from within an eigenbasis_of context

calculate_next(save: bool = False) None[source]#

Calculates one point of data of the superopetor

at(time: float | None = None) SuperOperator[source]#

Retruns evolution superoperator tensor at a given time

Parameters:

time (float, None) – Time (in fs) at which the tensor should be returned. If time is None, the whole data object is returned

apply(oper: Any, target: Any = None, copy: bool = True) Any[source]#

Applies the evolution superoperator at a given time

Parameters:
  • oper (float, array (list, tupple) of floats or TimeAxis) – Time(s) at which the evolution superoperator should be applied

  • target (DensityMatrix, ReducedDensityMatrix) – Operator which the evolution superoperator should be applied

  • copy (bool) – If True, the target object is copied and new value is assigned to its data attribute. If False, we assign the new values to the target object itself and no copying occurs.

plot_element(elem: Any, part: str = 'REAL', show: bool = True) None[source]#

Plots a selected element of the evolution superoperator

Parameters:

elem (tuple) – A tuple of indices determing the element of the superoperator

get_element_fft(elem: Any, window: Any = None) Any[source]#

Returns a DFunction with the FFT of the element evolution

get_fft(window: Any = None, subtract_last: bool = True) tuple[source]#

Returns Fourier transform of the whole evolution superoperator

Parameters:
  • window (DFunction or numpy array) – Windowing function by which the data are multiplied

  • subtract_last (bool) – If True, the value at the last available time is subtracted from all times

convert_from_RWA(ham: Any = None, sgn: int = 1) None[source]#

Converts evolution superoperator from RWA to standard repre

Parameters:
  • ham (qr.Hamiltonian) – Hamiltonian with respect to which we construct RWA. If none is specified, internal Hamiltonian is used. This is the most natural use of this function.

  • sgn ({1, -1}) – Forward (1) or backward (-1) conversion. Default sgn=1 corresponds to the function name. Backward conversion sgn=-1 is called from the inverse routine.

convert_to_RWA(ham: Any) None[source]#

Converts evolution superoperator from standard repre to RWA

Parameters:

ham (qr.Hamiltonian) – Hamiltonian with respect to which we construct RWA