With the QuTiP time-evolution functions (for example qutip.mesolve
and qutip.mcsolve
), a state vector or density matrix can be evolved from an initial state at t0 to an arbitrary time t, ρ(t) = V(t, t0){ρ(t0)}, where V(t, t0) is the propagator defined by the equation of motion. The resulting density matrix can then be used to evaluate the expectation values of arbitrary combinations of same-time operators.
To calculate two-time correlation functions on the form
We therefore first calculate ρ(t) = V(t, 0){ρ(0)} using one of the QuTiP evolution solvers with ρ(0) as initial state, and then again use the same solver to calculate V(t + τ, t){Bρ(t)} using Bρ(t) as initial state.
Note that if the initial state is the steady state, then
which is independent of t, so that we only have one time coordinate τ.
QuTiP provides a family of functions that assists in the process of calculating two-time correlation functions. The available functions and their usage is shown in the table below. Each of these functions can use one of the following evolution solvers: Master-equation, Exponential series and the Monte-Carlo. The choice of solver is defined by the optional argument solver
.
table-striped
QuTiP function | Correlation function |
---|---|
qutip.correlation.correlation_2op_2t |
|
qutip.correlation.correlation_2op_1t |
|
qutip.correlation.correlation_3op_1t |
|
qutip.correlation.correlation_3op_2t |
|
The most common use-case is to calculate correlation functions of the kind qutip.correlation.correlation_2op_1t
function. These correlation function solvers return a vector or matrix (in general complex) with the correlations as a function of the delays times.
The following code demonstrates how to calculate the
times = np.linspace(0,10.0,200) a = destroy(10) x = a.dag() + a H = a.dag() * a
corr1 = correlation_2op_1t(H, None, times, [np.sqrt(0.5) * a], x, x) corr2 = correlation_2op_1t(H, None, times, [np.sqrt(1.0) * a], x, x) corr3 = correlation_2op_1t(H, None, times, [np.sqrt(2.0) * a], x, x)
plt.figure() plt.plot(times, np.real(corr1), times, np.real(corr2), times, np.real(corr3)) plt.legend(['0.5','1.0','2.0']) plt.xlabel(r'Time
Given a correlation function
In QuTiP, we can calculate S(ω) using either qutip.correlation.spectrum_ss
, which first calculates the correlation function using one of the time-dependent solvers and then performs the Fourier transform semi-analytically, or we can use the function qutip.correlation.spectrum_correlation_fft
to numerically calculate the Fourier transform of a given correlation data using FFT.
The following example demonstrates how these two functions can be used to obtain the emission power spectrum.
guide/scripts/spectrum_ex1.py
More generally, we can also calculate correlation functions of the kind qutip.correlation.correlation_2op_2t
. The default behavior of this function is to return a matrix with the correlations as a function of the two time coordinates (t1 and t2).
guide/scripts/correlation_ex2.py
However, in some cases we might be interested in the correlation functions on the form qutip.correlation.correlation_2op_2t
function, if we pass the density matrix at time t1 as second argument, and None as third argument. The qutip.correlation.correlation_2op_2t
function then returns a vector with the correlation values corresponding to the times in taulist (the fourth argument).
This example demonstrates how to calculate a correlation function on the form
guide/scripts/correlation_ex3.py
For convenience, the steps for calculating the first-order coherence function have been collected in the function qutip.correlation.coherence_function_g1
.
The second-order optical coherence function, with time-delay τ, is defined as
For a coherent state g(2)(τ) = 1, for a thermal state g(2)(τ = 0) = 2 and it decreases as a function of time (bunched photons, they tend to appear together), and for a Fock state with n photons g(2)(τ = 0) = n(n − 1)/n2 < 1 and it increases with time (anti-bunched photons, more likely to arrive separated in time).
To calculate this type of correlation function with QuTiP, we can use qutip.correlation.correlation_3op_1t
, which computes a correlation function on the form
The following code calculates and plots g(2)(τ) as a function of τ for a coherent, thermal and Fock state.
guide/scripts/correlation_ex4.py
For convenience, the steps for calculating the second-order coherence function have been collected in the function qutip.correlation.coherence_function_g2
.