From 410ee2e4b014220999f01f2bd8c830178bd97ca6 Mon Sep 17 00:00:00 2001 From: cailixun Date: Tue, 17 Jun 2025 20:00:52 +0800 Subject: [PATCH 01/17] the introduction and derivation section --- .../users_guide/time_evolution/brmesolve.md | 147 ++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 docs/src/users_guide/time_evolution/brmesolve.md diff --git a/docs/src/users_guide/time_evolution/brmesolve.md b/docs/src/users_guide/time_evolution/brmesolve.md new file mode 100644 index 000000000..b732f64eb --- /dev/null +++ b/docs/src/users_guide/time_evolution/brmesolve.md @@ -0,0 +1,147 @@ +# [Bloch-Redfield master equation](@id doc-TE:Bloch-Redfield-master-equation) + +## Introduction + +The Lindblad master equation introduced earlier is constructed so that it describes a physical evolution of the density matrix (i.e., trace and positivity preserving), but it does not provide a connection to any underlying microscopic physical model. +The Lindblad operators (collapse operators) describe phenomenological processes, such as for example dephasing and spin flips, and the rates of these processes are arbitrary parameters in the model. +In many situations the collapse operators and their corresponding rates have clear physical interpretation, such as dephasing and relaxation rates, and in those cases the Lindblad master equation is usually the method of choice. + +However, in some cases, for example systems with varying energy biases and eigenstates and that couple to an environment in some well-defined manner (through a physically motivated system-environment interaction operator), it is often desirable to derive the master equation from more fundamental physical principles, and relate it to for example the noise-power spectrum of the environment. + +The Bloch-Redfield formalism is one such approach to derive a master equation from a microscopic system. +It starts from a combined system-environment perspective, and derives a perturbative master equation for the system alone, under the assumption of weak system-environment coupling. +One advantage of this approach is that the dissipation processes and rates are obtained directly from the properties of the environment. +On the downside, it does not intrinsically guarantee that the resulting master equation unconditionally preserves the physical properties of the density matrix (because it is a perturbative method). +The Bloch-Redfield master equation must therefore be used with care, and the assumptions made in the derivation must be honored. +(The Lindblad master equation is in a sense more robust -- it always results in a physical density matrix -- although some collapse operators might not be physically justified). +For a full derivation of the Bloch Redfield master equation, see e.g. [Coh92]() or [Bre02](). +Here we present only a brief version of the derivation, with the intention of introducing the notation and how it relates to the implementation in `QuantumToolbox.jl`. + + +## Brief Derivation and Definitions + +The starting point of the Bloch-Redfield formalism is the total Hamiltonian for the system and the environment (bath): $H = H_{\rm S} + H_{\rm B} + H_{\rm I}$, where $H$ is the total system+bath Hamiltonian, $H_{\rm S}$ and $H_{\rm B}$ are the system and bath Hamiltonians, respectively, and $H_{\rm I}$ is the interaction Hamiltonian. + +The most general form of a master equation for the system dynamics is obtained by tracing out the bath from the von-Neumann equation of motion for the combined system ($\dot\rho = -i\hbar^{-1}[H, \rho]$). In the interaction picture the result is + +$$ + + \frac{d}{dt}\rho_S(t) = - \hbar^{-2}\int_0^t d\tau\; {\rm Tr}_B [H_I(t), [H_I(\tau), \rho_S(\tau)\otimes\rho_B]], +$$ + +where the additional assumption that the total system-bath density matrix can be factorized as $\rho(t) \approx \rho_S(t) \otimes \rho_B$. +This assumption is known as the Born approximation, and it implies that there never is any entanglement between the system and the bath, neither in the initial state nor at any time during the evolution. +*It is justified for weak system-bath interaction.* + +The master equation above is non-Markovian, i.e., the change in the density matrix at a time $t$ depends on states at all times $\tau < t$, making it intractable to solve both theoretically and numerically. +To make progress towards a manageable master equation, we now introduce the Markovian approximation, in which $\rho_S(\tau)$ is replaced by $\rho_S(t)$. +The result is the Redfield equation + +$$ + \frac{d}{dt}\rho_S(t) = - \hbar^{-2}\int_0^t d\tau\; {\rm Tr}_B [H_I(t), [H_I(\tau), \rho_S(t)\otimes\rho_B]], +$$ +which is local in time with respect the density matrix, but still not Markovian since it contains an implicit dependence on the initial state. By extending the integration to infinity and substituting $\tau \rightarrow t-\tau$, a fully Markovian master equation is obtained: + +$$ + \frac{d}{dt}\rho_S(t) = - \hbar^{-2}\int_0^\infty d\tau\; {\rm Tr}_B [H_I(t), [H_I(t-\tau), \rho_S(t)\otimes\rho_B]]. +$$ + +The two Markovian approximations introduced above are valid if the time-scale with which the system dynamics changes is large compared to the time-scale with which correlations in the bath decays (corresponding to a "short-memory" bath, which results in Markovian system dynamics). + +The Markovian master equation above is still on a too general form to be suitable for numerical implementation. We therefore assume that the system-bath interaction takes the form $H_I = \sum_\alpha A_\alpha \otimes B_\alpha$ and where $A_\alpha$ are system operators and $B_\alpha$ are bath operators. +This allows us to write master equation in terms of system operators and bath correlation functions: + +$$ + + \frac{d}{dt}\rho_S(t) = + -\hbar^{-2} + \sum_{\alpha\beta} + \int_0^\infty d\tau\; + \left\{ + g_{\alpha\beta}(\tau) \left[A_\alpha(t)A_\beta(t-\tau)\rho_S(t) - A_\beta(t-\tau)\rho_S(t)A_\alpha(t)\right] + \right. \nonumber\\ + \left. + g_{\alpha\beta}(-\tau) \left[\rho_S(t)A_\alpha(t-\tau)A_\beta(t) - A_\beta(t)\rho_S(t)A_\beta(t-\alpha)\right] + \right\}, +$$ +where $g_{\alpha\beta}(\tau) = {\rm Tr}_B\left[B_\alpha(t)B_\beta(t-\tau)\rho_B\right] = \left$, +since the bath state $\rho_B$ is a steady state. + +In the eigenbasis of the system Hamiltonian, where $A_{mn}(t) = A_{mn} e^{i\omega_{mn}t}$, +$\omega_{mn} = \omega_m - \omega_n$ and $\omega_m$ are the eigenfrequencies +corresponding the eigenstate $\left|m\right>$, we obtain in matrix form in the Schrödinger picture + +$$ +\begin{aligned} + \frac{d}{dt} \rho_{ab}(t) = & -i\omega_{ab}\rho_{ab}(t)\\ + &-\hbar^{-2} \sum_{\alpha,\beta} \sum_{c,d}^{\rm sec} \int_0^\infty d\tau\; + \left\{ + g_{\alpha\beta}(\tau) + \left[\delta_{bd}\sum_nA^\alpha_{an}A^\beta_{nc}e^{i\omega_{cn}\tau} + - + A^\beta_{ac} A^\alpha_{db} e^{i\omega_{ca}\tau} + \right] + \right. \\ + &+ + \left. + g_{\alpha\beta}(-\tau) + \left[\delta_{ac}\sum_n A^\alpha_{dn}A^\beta_{nb} e^{i\omega_{nd}\tau} + - + A^\beta_{ac}A^\alpha_{db}e^{i\omega_{bd}\tau} + \right] + \right\} \rho_{cd}(t), +\end{aligned} +$$ +where the "sec" above the summation symbol indicate summation of the secular terms which satisfy $|\omega_{ab}-\omega_{cd}| \ll \tau_ {\rm decay}$. +This is an almost-useful form of the master equation. The final step before arriving at the form of the Bloch-Redfield master equation that is implemented in QuTiP, involves rewriting the bath correlation function $g(\tau)$ in terms of the noise-power spectrum of the environment $S(\omega) = \int_{-\infty}^\infty d\tau e^{i\omega\tau} g(\tau)$: + +$$ + \int_0^\infty d\tau\; g_{\alpha\beta}(\tau) e^{i\omega\tau} = \frac{1}{2}S_{\alpha\beta}(\omega) + i\lambda_{\alpha\beta}(\omega), +$$ +where $\lambda_{ab}(\omega)$ is an energy shift that is neglected here. The final form of the Bloch-Redfield master equation is + + +$$ + \frac{d}{dt}\rho_{ab}(t) + = + -i\omega_{ab}\rho_{ab}(t) + + + \sum_{c,d}^{\rm sec}R_{abcd}\rho_{cd}(t), +$$ +where + +$$ + R_{abcd} = -\frac{\hbar^{-2}}{2} \sum_{\alpha,\beta} + \left\{ + \delta_{bd}\sum_nA^\alpha_{an}A^\beta_{nc}S_{\alpha\beta}(\omega_{cn}) + - + A^\beta_{ac} A^\alpha_{db} S_{\alpha\beta}(\omega_{ca}) + \right. \nonumber\\ + + + \left. + \delta_{ac}\sum_n A^\alpha_{dn}A^\beta_{nb} S_{\alpha\beta}(\omega_{dn}) + - + A^\beta_{ac}A^\alpha_{db} S_{\alpha\beta}(\omega_{db}) + \right\}, +$$ +is the Bloch-Redfield tensor. + +The Bloch-Redfield master equation in this form is suitable for numerical implementation. The input parameters are the system Hamiltonian $H$, the system operators through which the environment couples to the system $A_\alpha$, and the noise-power spectrum $S_{\alpha\beta}(\omega)$ associated with each system-environment interaction term. + +To simplify the numerical implementation we often assume that $A_\alpha$ are Hermitian and that cross-correlations between different environment operators vanish, resulting in + +$$ + R_{abcd} = -\frac{\hbar^{-2}}{2} \sum_{\alpha} + \left\{ + \delta_{bd}\sum_nA^\alpha_{an}A^\alpha_{nc}S_{\alpha}(\omega_{cn}) + - + A^\alpha_{ac} A^\alpha_{db} S_{\alpha}(\omega_{ca}) + \right. \nonumber\\ + + + \left. + \delta_{ac}\sum_n A^\alpha_{dn}A^\alpha_{nb} S_{\alpha}(\omega_{dn}) + - + A^\alpha_{ac}A^\alpha_{db} S_{\alpha}(\omega_{db}) + \right\}. +$$ + From 0b5537b0f226c1719cd0735c4da91a78f5141e4e Mon Sep 17 00:00:00 2001 From: cailixun Date: Tue, 17 Jun 2025 20:15:31 +0800 Subject: [PATCH 02/17] change math mode enclosure --- .../users_guide/time_evolution/brmesolve.md | 81 ++++++++++--------- 1 file changed, 44 insertions(+), 37 deletions(-) diff --git a/docs/src/users_guide/time_evolution/brmesolve.md b/docs/src/users_guide/time_evolution/brmesolve.md index b732f64eb..5d38b3332 100644 --- a/docs/src/users_guide/time_evolution/brmesolve.md +++ b/docs/src/users_guide/time_evolution/brmesolve.md @@ -20,39 +20,38 @@ Here we present only a brief version of the derivation, with the intention of in ## Brief Derivation and Definitions -The starting point of the Bloch-Redfield formalism is the total Hamiltonian for the system and the environment (bath): $H = H_{\rm S} + H_{\rm B} + H_{\rm I}$, where $H$ is the total system+bath Hamiltonian, $H_{\rm S}$ and $H_{\rm B}$ are the system and bath Hamiltonians, respectively, and $H_{\rm I}$ is the interaction Hamiltonian. +The starting point of the Bloch-Redfield formalism is the total Hamiltonian for the system and the environment (bath): ``H = H_{\rm S} + H_{\rm B} + H_{\rm I}``, where ``H`` is the total system+bath Hamiltonian, ``H_{\rm S}`` and ``H_{\rm B}`` are the system and bath Hamiltonians, respectively, and ``H_{\rm I}`` is the interaction Hamiltonian. -The most general form of a master equation for the system dynamics is obtained by tracing out the bath from the von-Neumann equation of motion for the combined system ($\dot\rho = -i\hbar^{-1}[H, \rho]$). In the interaction picture the result is - -$$ +The most general form of a master equation for the system dynamics is obtained by tracing out the bath from the von-Neumann equation of motion for the combined system (``\dot\rho = -i\hbar^{-1}[H, \rho]``). In the interaction picture the result is +```math \frac{d}{dt}\rho_S(t) = - \hbar^{-2}\int_0^t d\tau\; {\rm Tr}_B [H_I(t), [H_I(\tau), \rho_S(\tau)\otimes\rho_B]], -$$ +``` -where the additional assumption that the total system-bath density matrix can be factorized as $\rho(t) \approx \rho_S(t) \otimes \rho_B$. +where the additional assumption that the total system-bath density matrix can be factorized as ``\rho(t) \approx \rho_S(t) \otimes \rho_B``. This assumption is known as the Born approximation, and it implies that there never is any entanglement between the system and the bath, neither in the initial state nor at any time during the evolution. *It is justified for weak system-bath interaction.* -The master equation above is non-Markovian, i.e., the change in the density matrix at a time $t$ depends on states at all times $\tau < t$, making it intractable to solve both theoretically and numerically. -To make progress towards a manageable master equation, we now introduce the Markovian approximation, in which $\rho_S(\tau)$ is replaced by $\rho_S(t)$. +The master equation above is non-Markovian, i.e., the change in the density matrix at a time ``t`` depends on states at all times ``\tau < t``, making it intractable to solve both theoretically and numerically. +To make progress towards a manageable master equation, we now introduce the Markovian approximation, in which ``\rho_S(\tau)`` is replaced by ``\rho_S(t)``. The result is the Redfield equation -$$ +```math \frac{d}{dt}\rho_S(t) = - \hbar^{-2}\int_0^t d\tau\; {\rm Tr}_B [H_I(t), [H_I(\tau), \rho_S(t)\otimes\rho_B]], -$$ -which is local in time with respect the density matrix, but still not Markovian since it contains an implicit dependence on the initial state. By extending the integration to infinity and substituting $\tau \rightarrow t-\tau$, a fully Markovian master equation is obtained: +``` + +which is local in time with respect the density matrix, but still not Markovian since it contains an implicit dependence on the initial state. By extending the integration to infinity and substituting ``\tau \rightarrow t-\tau``, a fully Markovian master equation is obtained: -$$ +```math \frac{d}{dt}\rho_S(t) = - \hbar^{-2}\int_0^\infty d\tau\; {\rm Tr}_B [H_I(t), [H_I(t-\tau), \rho_S(t)\otimes\rho_B]]. -$$ +``` The two Markovian approximations introduced above are valid if the time-scale with which the system dynamics changes is large compared to the time-scale with which correlations in the bath decays (corresponding to a "short-memory" bath, which results in Markovian system dynamics). -The Markovian master equation above is still on a too general form to be suitable for numerical implementation. We therefore assume that the system-bath interaction takes the form $H_I = \sum_\alpha A_\alpha \otimes B_\alpha$ and where $A_\alpha$ are system operators and $B_\alpha$ are bath operators. +The Markovian master equation above is still on a too general form to be suitable for numerical implementation. We therefore assume that the system-bath interaction takes the form ``H_I = \sum_\alpha A_\alpha \otimes B_\alpha`` and where ``A_\alpha`` are system operators and ``B_\alpha`` are bath operators. This allows us to write master equation in terms of system operators and bath correlation functions: -$$ - +```math \frac{d}{dt}\rho_S(t) = -\hbar^{-2} \sum_{\alpha\beta} @@ -63,15 +62,16 @@ $$ \left. g_{\alpha\beta}(-\tau) \left[\rho_S(t)A_\alpha(t-\tau)A_\beta(t) - A_\beta(t)\rho_S(t)A_\beta(t-\alpha)\right] \right\}, -$$ -where $g_{\alpha\beta}(\tau) = {\rm Tr}_B\left[B_\alpha(t)B_\beta(t-\tau)\rho_B\right] = \left$, -since the bath state $\rho_B$ is a steady state. +``` -In the eigenbasis of the system Hamiltonian, where $A_{mn}(t) = A_{mn} e^{i\omega_{mn}t}$, -$\omega_{mn} = \omega_m - \omega_n$ and $\omega_m$ are the eigenfrequencies -corresponding the eigenstate $\left|m\right>$, we obtain in matrix form in the Schrödinger picture +where ``g_{\alpha\beta}(\tau) = {\rm Tr}_B\left[B_\alpha(t)B_\beta(t-\tau)\rho_B\right] = \left``, +since the bath state ``\rho_B`` is a steady state. -$$ +In the eigenbasis of the system Hamiltonian, where ``A_{mn}(t) = A_{mn} e^{i\omega_{mn}t}``, +``\omega_{mn} = \omega_m - \omega_n`` and ``\omega_m`` are the eigenfrequencies +corresponding the eigenstate ``\left|m\right>``, we obtain in matrix form in the Schrödinger picture + +```math \begin{aligned} \frac{d}{dt} \rho_{ab}(t) = & -i\omega_{ab}\rho_{ab}(t)\\ &-\hbar^{-2} \sum_{\alpha,\beta} \sum_{c,d}^{\rm sec} \int_0^\infty d\tau\; @@ -91,26 +91,29 @@ $$ \right] \right\} \rho_{cd}(t), \end{aligned} -$$ -where the "sec" above the summation symbol indicate summation of the secular terms which satisfy $|\omega_{ab}-\omega_{cd}| \ll \tau_ {\rm decay}$. -This is an almost-useful form of the master equation. The final step before arriving at the form of the Bloch-Redfield master equation that is implemented in QuTiP, involves rewriting the bath correlation function $g(\tau)$ in terms of the noise-power spectrum of the environment $S(\omega) = \int_{-\infty}^\infty d\tau e^{i\omega\tau} g(\tau)$: +``` + +where the "sec" above the summation symbol indicate summation of the secular terms which satisfy ``|\omega_{ab}-\omega_{cd}| \ll \tau_ {\rm decay}``. +This is an almost-useful form of the master equation. The final step before arriving at the form of the Bloch-Redfield master equation that is implemented in QuTiP, involves rewriting the bath correlation function ``g(\tau)`` in terms of the noise-power spectrum of the environment ``S(\omega) = \int_{-\infty}^\infty d\tau e^{i\omega\tau} g(\tau)``: -$$ +```math \int_0^\infty d\tau\; g_{\alpha\beta}(\tau) e^{i\omega\tau} = \frac{1}{2}S_{\alpha\beta}(\omega) + i\lambda_{\alpha\beta}(\omega), -$$ -where $\lambda_{ab}(\omega)$ is an energy shift that is neglected here. The final form of the Bloch-Redfield master equation is +``` +where ``\lambda_{ab}(\omega)`` is an energy shift that is neglected here. The final form of the Bloch-Redfield master equation is -$$ + +```math \frac{d}{dt}\rho_{ab}(t) = -i\omega_{ab}\rho_{ab}(t) + \sum_{c,d}^{\rm sec}R_{abcd}\rho_{cd}(t), -$$ +``` + where -$$ +```math R_{abcd} = -\frac{\hbar^{-2}}{2} \sum_{\alpha,\beta} \left\{ \delta_{bd}\sum_nA^\alpha_{an}A^\beta_{nc}S_{\alpha\beta}(\omega_{cn}) @@ -123,14 +126,15 @@ $$ - A^\beta_{ac}A^\alpha_{db} S_{\alpha\beta}(\omega_{db}) \right\}, -$$ +``` + is the Bloch-Redfield tensor. -The Bloch-Redfield master equation in this form is suitable for numerical implementation. The input parameters are the system Hamiltonian $H$, the system operators through which the environment couples to the system $A_\alpha$, and the noise-power spectrum $S_{\alpha\beta}(\omega)$ associated with each system-environment interaction term. +The Bloch-Redfield master equation in this form is suitable for numerical implementation. The input parameters are the system Hamiltonian ``H``, the system operators through which the environment couples to the system ``A_\alpha``, and the noise-power spectrum ``S_{\alpha\beta}(\omega)`` associated with each system-environment interaction term. -To simplify the numerical implementation we often assume that $A_\alpha$ are Hermitian and that cross-correlations between different environment operators vanish, resulting in +To simplify the numerical implementation we often assume that ``A_\alpha`` are Hermitian and that cross-correlations between different environment operators vanish, resulting in -$$ +```math R_{abcd} = -\frac{\hbar^{-2}}{2} \sum_{\alpha} \left\{ \delta_{bd}\sum_nA^\alpha_{an}A^\alpha_{nc}S_{\alpha}(\omega_{cn}) @@ -143,5 +147,8 @@ $$ - A^\alpha_{ac}A^\alpha_{db} S_{\alpha}(\omega_{db}) \right\}. -$$ +``` + +## Bloch-Redfield master equation in `QuantumToolbox.jl` + From fc23e5d1e42a184490d765113c0e029db2afd4dc Mon Sep 17 00:00:00 2001 From: cailixun Date: Tue, 17 Jun 2025 21:11:40 +0800 Subject: [PATCH 03/17] add code examples --- .../users_guide/time_evolution/brmesolve.md | 87 ++++++++++++++++++- 1 file changed, 86 insertions(+), 1 deletion(-) diff --git a/docs/src/users_guide/time_evolution/brmesolve.md b/docs/src/users_guide/time_evolution/brmesolve.md index 5d38b3332..0e551769d 100644 --- a/docs/src/users_guide/time_evolution/brmesolve.md +++ b/docs/src/users_guide/time_evolution/brmesolve.md @@ -14,7 +14,7 @@ One advantage of this approach is that the dissipation processes and rates are o On the downside, it does not intrinsically guarantee that the resulting master equation unconditionally preserves the physical properties of the density matrix (because it is a perturbative method). The Bloch-Redfield master equation must therefore be used with care, and the assumptions made in the derivation must be honored. (The Lindblad master equation is in a sense more robust -- it always results in a physical density matrix -- although some collapse operators might not be physically justified). -For a full derivation of the Bloch Redfield master equation, see e.g. [Coh92]() or [Bre02](). +For a full derivation of the Bloch Redfield master equation, see e.g. [C. Cohen-Tannoudji, 1992]() or [H.-P. Breuer, 2002](). Here we present only a brief version of the derivation, with the intention of introducing the notation and how it relates to the implementation in `QuantumToolbox.jl`. @@ -151,4 +151,89 @@ To simplify the numerical implementation we often assume that ``A_\alpha`` are H ## Bloch-Redfield master equation in `QuantumToolbox.jl` +### Preparing the Bloch-Redfield tensor +In `QuantumToolbox.jl`, the Bloch-redfield master equation can be calculated using the function [`bloch_redfield_tensor`](@ref). +It takes two mandatory arguments: The system Hamiltonian ``H`` and a nested list `a_ops` consist of tuples as `(A, spec)` +with `A::QuantumObject{Operator}` being the operator ``A_\alpha`` and `spec::Function` being the spectral density functions ``S_\alpha(\omega)``. + +It is possible to also get the term for a bath `\alpha` directly using [`brterm`](@ref). This function takes only one hermitian coupling operator ``A_\alpha`` and spectral response function ``S_\alpha(\omega)``. + +To illustrate how to calculate the Bloch-Redfield tensor, let's consider a two-level atom + +```math + H = -\frac{1}{2}\Delta\sigma_x - \frac{1}{2}\varepsilon_0\sigma_z +``` + +```@example brmesolve +Δ = 0.2 * 2π +ε0 = 1.0 * 2π +γ1 = 0.5 + +H = -Δ/2.0 * sigmax() - ε0/2 * sigmaz() + +function ohmic_spectrum(ω) + if ω == 0. # dephasing noise + return γ1 + elseif ω > 0 # relaxing noise + return γ1 / 2 * ω / (2π) + else + return o + end +end + +R, U = bloch_redfield_tensor(H, [(sigmax(), ohmic_spectrum)]) + +R +``` + +Note that it is also possible to add Lindblad dissipation superoperators in the +Bloch-Refield tensor by passing the operators via the third argument `c_ops` +like you would in the [`mesolve`](@ref) or [`mcsolve`](@ref) functions. +For convenience, when the keyword argument `fock_basis = false`, the function [`bloch_redfield_tensor`](@ref) also returns the basis +transformation operator `U`, the eigen vector matrix, since they are calculated in the +process of calculating the Bloch-Redfield tensor `R`, and the `U` are usually +needed again later when transforming operators between the laboratory basis and the eigen basis. +The tensor can be obtained in the laboratory basis by setting `fock_basis = true`, +in that case, the transformation operator is not returned. + +### Time evolution + +The evolution of a wave function or density matrix, according to the Bloch-Redfield +master equation, can be calculated using the function [`mesolve`](@ref) +using Bloch-Refield tensor in the laboratory basis instead of a liouvillian. +For example, to evaluate the expectation values of the ``\sigma_x``, +``\sigma_y``, and ``\sigma_z`` operators for the example above, we can use the following code: + +```@example brmesolve +Δ = 0.2 * 2 * π +ϵ0 = 1.0 * 2 * π +γ1 = 0.5 + +H = - Δ/2.0 * sigmax() - ϵ0/2.0 * sigmaz() + +ohmic_spectrum(ω) = (ω == 0.0) ? γ1 : γ1 / 2 * (ω / (2 * π)) * (ω > 0.0) + +a_ops = ((sigmax(), ohmic_spectrum),) +e_ops = [sigmax(), sigmay(), sigmaz()] + +# same initial random ket state in QuTiP doc +ψ0 = Qobj([ + 0.05014193+0.66000276im, + 0.67231376+0.33147603im +]) + +tlist = LinRange(0, 15.0, 1000) +sol = brmesolve(H, ψ0, tlist, a_ops, e_ops=e_ops) +expt_list = real(sol.expect) + +# plot the evolution of state on Bloch sphere +sphere = Bloch() +add_points!(sphere, [expt_list[1,:], expt_list[2,:], expt_list[3,:]]) +sphere.vector_color = ["red"] + +add_vectors!(sphere, [Δ, 0, ϵ0] / √(Δ^2 + ϵ0^2)) + +fig, _ = render(sphere) +fig +``` From 617d03b94eba3fee8699b49c7df222cfa3d19ea4 Mon Sep 17 00:00:00 2001 From: cailixun Date: Tue, 17 Jun 2025 21:12:58 +0800 Subject: [PATCH 04/17] add typo exception --- .typos.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/.typos.toml b/.typos.toml index e3264a3d3..cb4a74b2f 100644 --- a/.typos.toml +++ b/.typos.toml @@ -1,3 +1,4 @@ [default.extend-words] ket = "ket" sme = "sme" +nd = "nd" \ No newline at end of file From 3694b2cbcdbc6e6e10fe1a7aec3851c7dbfddfd0 Mon Sep 17 00:00:00 2001 From: cailixun Date: Tue, 17 Jun 2025 21:35:02 +0800 Subject: [PATCH 05/17] ending code example --- docs/src/users_guide/time_evolution/brmesolve.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/src/users_guide/time_evolution/brmesolve.md b/docs/src/users_guide/time_evolution/brmesolve.md index 0e551769d..8b002549f 100644 --- a/docs/src/users_guide/time_evolution/brmesolve.md +++ b/docs/src/users_guide/time_evolution/brmesolve.md @@ -14,7 +14,7 @@ One advantage of this approach is that the dissipation processes and rates are o On the downside, it does not intrinsically guarantee that the resulting master equation unconditionally preserves the physical properties of the density matrix (because it is a perturbative method). The Bloch-Redfield master equation must therefore be used with care, and the assumptions made in the derivation must be honored. (The Lindblad master equation is in a sense more robust -- it always results in a physical density matrix -- although some collapse operators might not be physically justified). -For a full derivation of the Bloch Redfield master equation, see e.g. [C. Cohen-Tannoudji, 1992]() or [H.-P. Breuer, 2002](). +For a full derivation of the Bloch Redfield master equation, see e.g. [Cohen_Tannoudji_atomphoton](@citet) or [breuer2002](@citet). Here we present only a brief version of the derivation, with the intention of introducing the notation and how it relates to the implementation in `QuantumToolbox.jl`. @@ -237,3 +237,15 @@ add_vectors!(sphere, [Δ, 0, ϵ0] / √(Δ^2 + ϵ0^2)) fig, _ = render(sphere) fig ``` + +The two steps of calculating the Bloch-Redfield tensor and evolving according to +the corresponding master equation can be combined into one by using the function +[`brmesolve`](@ref), in addition to the same arguments as [`mesolve`](@ref) and +[`mcsolve`](@ref), the nested list of operator-spectrum +tuple should be given under `a_ops`. + +```@example brmesolve + output = brmesolve(H, psi0, tlist, a_ops=[[sigmax(),ohmic_spectrum]], e_ops=e_ops) +``` + +The resulting `output` is of the `struct` [`TimeEvolutionSol`](@ref) like as from [`mesolve`](@ref). From fb86e001c160a52a2e833e32662467cc3588c423 Mon Sep 17 00:00:00 2001 From: cailixun Date: Tue, 17 Jun 2025 21:35:15 +0800 Subject: [PATCH 06/17] add bibtex --- docs/src/resources/bibliography.bib | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/src/resources/bibliography.bib b/docs/src/resources/bibliography.bib index 9cb6b77e1..22bc9be04 100644 --- a/docs/src/resources/bibliography.bib +++ b/docs/src/resources/bibliography.bib @@ -119,3 +119,28 @@ @article{Hill-Wootters1997 doi = {10.1103/PhysRevLett.78.5022}, url = {https://link.aps.org/doi/10.1103/PhysRevLett.78.5022} } + +@book{Cohen_Tannoudji_atomphoton, + added-at = {2010-12-01T16:20:39.000+0100}, + address = {New York}, + author = {{Cohen-Tannoudji}, C. and {Grynberg}, G. and {Dupont-Roc}, J.}, + biburl = {https://www.bibsonomy.org/bibtex/2eb02c7aecb613d60725f7d48f52a82fb/jhigbie}, + interhash = {a839fc31ff7c11b123b8d69d374ad30e}, + intrahash = {eb02c7aecb613d60725f7d48f52a82fb}, + keywords = {imported}, + publisher = {Wiley}, + timestamp = {2010-12-01T16:20:40.000+0100}, + title = {Atom-Photon Interactions: Basic Processes and Applications }, + year = 1992 +} + +@book{breuer2002, + title = {The Theory of Open Quantum Systems}, + author = {Breuer, Heinz-Peter and Petruccione, Francesco}, + year = {2002}, + publisher = {Oxford university press}, + address = {Oxford New York}, + isbn = {978-0-19-852063-4}, + langid = {english}, + lccn = {530.12} +} From cf134371152b66403eebd4db782f464acaf0b67e Mon Sep 17 00:00:00 2001 From: cailixun Date: Tue, 17 Jun 2025 21:56:26 +0800 Subject: [PATCH 07/17] update bibtex --- docs/src/resources/bibliography.bib | 5 ----- 1 file changed, 5 deletions(-) diff --git a/docs/src/resources/bibliography.bib b/docs/src/resources/bibliography.bib index 22bc9be04..9af3e514b 100644 --- a/docs/src/resources/bibliography.bib +++ b/docs/src/resources/bibliography.bib @@ -121,13 +121,8 @@ @article{Hill-Wootters1997 } @book{Cohen_Tannoudji_atomphoton, - added-at = {2010-12-01T16:20:39.000+0100}, address = {New York}, author = {{Cohen-Tannoudji}, C. and {Grynberg}, G. and {Dupont-Roc}, J.}, - biburl = {https://www.bibsonomy.org/bibtex/2eb02c7aecb613d60725f7d48f52a82fb/jhigbie}, - interhash = {a839fc31ff7c11b123b8d69d374ad30e}, - intrahash = {eb02c7aecb613d60725f7d48f52a82fb}, - keywords = {imported}, publisher = {Wiley}, timestamp = {2010-12-01T16:20:40.000+0100}, title = {Atom-Photon Interactions: Basic Processes and Applications }, From e4861b5e20706377edd170bc960891aec0febf56 Mon Sep 17 00:00:00 2001 From: cailixun Date: Tue, 17 Jun 2025 21:59:43 +0800 Subject: [PATCH 08/17] fix make docs --- docs/src/users_guide/time_evolution/brmesolve.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docs/src/users_guide/time_evolution/brmesolve.md b/docs/src/users_guide/time_evolution/brmesolve.md index 8b002549f..b2e1b16cd 100644 --- a/docs/src/users_guide/time_evolution/brmesolve.md +++ b/docs/src/users_guide/time_evolution/brmesolve.md @@ -165,6 +165,13 @@ To illustrate how to calculate the Bloch-Redfield tensor, let's consider a two-l H = -\frac{1}{2}\Delta\sigma_x - \frac{1}{2}\varepsilon_0\sigma_z ``` +```@setup brmesolve +using QuantumToolbox + +using CairoMakie +CairoMakie.enable_only_mime!(MIME"image/svg+xml"()) +``` + ```@example brmesolve Δ = 0.2 * 2π ε0 = 1.0 * 2π @@ -178,7 +185,7 @@ function ohmic_spectrum(ω) elseif ω > 0 # relaxing noise return γ1 / 2 * ω / (2π) else - return o + return 0 end end @@ -245,7 +252,7 @@ the corresponding master equation can be combined into one by using the function tuple should be given under `a_ops`. ```@example brmesolve - output = brmesolve(H, psi0, tlist, a_ops=[[sigmax(),ohmic_spectrum]], e_ops=e_ops) + output = brmesolve(H, ψ0, tlist, ((sigmax(),ohmic_spectrum),); e_ops=e_ops) ``` -The resulting `output` is of the `struct` [`TimeEvolutionSol`](@ref) like as from [`mesolve`](@ref). +The resulting `output` is of the `struct` [`TimeEvolutionSol`](@ref) as [`mesolve`](@ref). From c7e9c9035255c2881515f0ccc0efe9ff3a8dbb5a Mon Sep 17 00:00:00 2001 From: cailixun Date: Tue, 17 Jun 2025 22:23:41 +0800 Subject: [PATCH 09/17] add to the pull down menu --- docs/make.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/make.jl b/docs/make.jl index 50f4696f8..7fb05c01b 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -59,6 +59,7 @@ const PAGES = [ "Monte Carlo Solver" => "users_guide/time_evolution/mcsolve.md", "Stochastic Solver" => "users_guide/time_evolution/stochastic.md", "Solving Problems with Time-dependent Hamiltonians" => "users_guide/time_evolution/time_dependent.md", + "Bloch-Redfield master equation" => "users_guide/time_evolution/brmesolve.md", ], "Intensive parallelization on a Cluster" => "users_guide/cluster.md", "Hierarchical Equations of Motion" => "users_guide/HEOM.md", From 7bf9059aeed49f7ec7e1ee2d5d3856f16abb2632 Mon Sep 17 00:00:00 2001 From: cailixun Date: Tue, 17 Jun 2025 22:24:20 +0800 Subject: [PATCH 10/17] fix math aligned --- .../users_guide/time_evolution/brmesolve.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/src/users_guide/time_evolution/brmesolve.md b/docs/src/users_guide/time_evolution/brmesolve.md index b2e1b16cd..112ef1bf4 100644 --- a/docs/src/users_guide/time_evolution/brmesolve.md +++ b/docs/src/users_guide/time_evolution/brmesolve.md @@ -52,16 +52,16 @@ The Markovian master equation above is still on a too general form to be suitabl This allows us to write master equation in terms of system operators and bath correlation functions: ```math - \frac{d}{dt}\rho_S(t) = - -\hbar^{-2} - \sum_{\alpha\beta} - \int_0^\infty d\tau\; - \left\{ - g_{\alpha\beta}(\tau) \left[A_\alpha(t)A_\beta(t-\tau)\rho_S(t) - A_\beta(t-\tau)\rho_S(t)A_\alpha(t)\right] - \right. \nonumber\\ - \left. - g_{\alpha\beta}(-\tau) \left[\rho_S(t)A_\alpha(t-\tau)A_\beta(t) - A_\beta(t)\rho_S(t)A_\beta(t-\alpha)\right] - \right\}, +\begin{split}\frac{d}{dt}\rho_S(t) = +-\hbar^{-2} +\sum_{\alpha\beta} +\int_0^\infty d\tau\; +\left\{ +g_{\alpha\beta}(\tau) \left[A_\alpha(t)A_\beta(t-\tau)\rho_S(t) - A_\beta(t-\tau)\rho_S(t)A_\alpha(t)\right] +\right. \nonumber\\ +\left. ++ g_{\alpha\beta}(-\tau) \left[\rho_S(t)A_\alpha(t-\tau)A_\beta(t) - A_\beta(t)\rho_S(t)A_\beta(t-\alpha)\right] +\right\},\end{split} ``` where ``g_{\alpha\beta}(\tau) = {\rm Tr}_B\left[B_\alpha(t)B_\beta(t-\tau)\rho_B\right] = \left``, From ff4ef39901ace9a2bef08cb1baf9f1347df3fcde Mon Sep 17 00:00:00 2001 From: cailixun Date: Tue, 17 Jun 2025 23:20:03 +0800 Subject: [PATCH 11/17] Completing user guide menu --- docs/src/users_guide/time_evolution/intro.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/src/users_guide/time_evolution/intro.md b/docs/src/users_guide/time_evolution/intro.md index e1755183d..ae716173e 100644 --- a/docs/src/users_guide/time_evolution/intro.md +++ b/docs/src/users_guide/time_evolution/intro.md @@ -28,6 +28,10 @@ - [Generate QobjEvo](@ref doc-TE:Generate-QobjEvo) - [QobjEvo fields (attributes)](@ref doc-TE:QobjEvo-fields-(attributes)) - [Using parameters](@ref doc-TE:Using-parameters) +- [Bloch-Redfield master equation](@ref doc-TE:Bloch-Redfield-master-equation) + - [Brief Derivation and Definitions](@ref doc-TE:Brief-Derivation-and-Definitions) + - [Bloch-Redfield master equation in `QuantumToolbox.jl`](@ref Bloch-Redfield-master-equation-in-QuantumToolbox-jl) + # [Introduction](@id doc-TE:Introduction) @@ -44,6 +48,7 @@ The following table lists the solvers provided by `QuantumToolbox` for dynamic q | Monte Carlo evolution | [`mcsolve`](@ref) | [`mcsolveProblem`](@ref) [`mcsolveEnsembleProblem`](@ref) | [`TimeEvolutionMCSol`](@ref) | | Stochastic Schrödinger equation | [`ssesolve`](@ref) | [`ssesolveProblem`](@ref) [`ssesolveEnsembleProblem`](@ref) | [`TimeEvolutionStochasticSol`](@ref) | | Stochastic master equation | [`smesolve`](@ref) | [`smesolveProblem`](@ref) [`smesolveEnsembleProblem`](@ref) | [`TimeEvolutionStochasticSol`](@ref) | +| Bloch-Redfield master equation | [`brmesolve`](@ref) | - | [`TimeEvolutionSol`](@ref) | !!! note "Solving dynamics with pre-defined problems" `QuantumToolbox` provides two different methods to solve the dynamics. One can use the function calls listed above by either taking all the operators (like Hamiltonian and collapse operators, etc.) as inputs directly, or generating the `prob`lems by yourself and take it as an input of the function call, e.g., `sesolve(prob)`. From 38326dafd8fa0995f6df75f92820f772fce25f3e Mon Sep 17 00:00:00 2001 From: cailixun Date: Tue, 17 Jun 2025 23:20:36 +0800 Subject: [PATCH 12/17] improve math (`\hat{}` for operator) --- .../users_guide/time_evolution/brmesolve.md | 80 +++++++++---------- 1 file changed, 37 insertions(+), 43 deletions(-) diff --git a/docs/src/users_guide/time_evolution/brmesolve.md b/docs/src/users_guide/time_evolution/brmesolve.md index 112ef1bf4..9833ab830 100644 --- a/docs/src/users_guide/time_evolution/brmesolve.md +++ b/docs/src/users_guide/time_evolution/brmesolve.md @@ -1,8 +1,6 @@ # [Bloch-Redfield master equation](@id doc-TE:Bloch-Redfield-master-equation) -## Introduction - -The Lindblad master equation introduced earlier is constructed so that it describes a physical evolution of the density matrix (i.e., trace and positivity preserving), but it does not provide a connection to any underlying microscopic physical model. +The [Lindblad master equation](@ref doc-TE:Lindblad-Master-Equation-Solver) introduced earlier is constructed so that it describes a physical evolution of the density matrix (i.e., trace and positivity preserving), but it does not provide a connection to any underlying microscopic physical model. The Lindblad operators (collapse operators) describe phenomenological processes, such as for example dephasing and spin flips, and the rates of these processes are arbitrary parameters in the model. In many situations the collapse operators and their corresponding rates have clear physical interpretation, such as dephasing and relaxation rates, and in those cases the Lindblad master equation is usually the method of choice. @@ -18,58 +16,58 @@ For a full derivation of the Bloch Redfield master equation, see e.g. [Cohen_Tan Here we present only a brief version of the derivation, with the intention of introducing the notation and how it relates to the implementation in `QuantumToolbox.jl`. -## Brief Derivation and Definitions +## [Brief Derivation and Definitions](@id doc-TE:Brief-Derivation-and-Definitions) -The starting point of the Bloch-Redfield formalism is the total Hamiltonian for the system and the environment (bath): ``H = H_{\rm S} + H_{\rm B} + H_{\rm I}``, where ``H`` is the total system+bath Hamiltonian, ``H_{\rm S}`` and ``H_{\rm B}`` are the system and bath Hamiltonians, respectively, and ``H_{\rm I}`` is the interaction Hamiltonian. +The starting point of the Bloch-Redfield formalism is the total Hamiltonian for the system and the environment (bath): ``\hat{H} = \hat{H}_{\rm S} + \hat{H}_{\rm B} + \hat{H}_{\rm I}``, where ``\hat{H}`` is the total system+bath Hamiltonian, ``\hat{H}_{\rm S}`` and ``\hat{H}_{\rm B}`` are the system and bath Hamiltonians, respectively, and ``\hat{H}_{\rm I}`` is the interaction Hamiltonian. -The most general form of a master equation for the system dynamics is obtained by tracing out the bath from the von-Neumann equation of motion for the combined system (``\dot\rho = -i\hbar^{-1}[H, \rho]``). In the interaction picture the result is +The most general form of a master equation for the system dynamics is obtained by tracing out the bath from the von-Neumann equation of motion for the combined system (``\frac{d}{dt}\hat{\rho} = -i\hbar^{-1}[\hat{H}, \hat{\rho}]``). In the interaction picture the result is ```math - \frac{d}{dt}\rho_S(t) = - \hbar^{-2}\int_0^t d\tau\; {\rm Tr}_B [H_I(t), [H_I(\tau), \rho_S(\tau)\otimes\rho_B]], + \frac{d}{dt}\hat{\rho}_{\textrm{S}}(t) = - \hbar^{-2}\int_0^t d\tau\; \textrm{Tr}_{\textrm{B}} [\hat{H}_{\textrm{I}}(t), [\hat{H}_{\textrm{I}}(\tau), \hat{\rho}_{\textrm{S}}(\tau)\otimes\hat{\rho}_{\textrm{B}}]], ``` -where the additional assumption that the total system-bath density matrix can be factorized as ``\rho(t) \approx \rho_S(t) \otimes \rho_B``. +where the additional assumption that the total system-bath density matrix can be factorized as ``\hat{\rho}(t) \approx \hat{\rho}_{\textrm{S}}(t) \otimes \hat{\rho}_{\textrm{B}}``. This assumption is known as the Born approximation, and it implies that there never is any entanglement between the system and the bath, neither in the initial state nor at any time during the evolution. *It is justified for weak system-bath interaction.* The master equation above is non-Markovian, i.e., the change in the density matrix at a time ``t`` depends on states at all times ``\tau < t``, making it intractable to solve both theoretically and numerically. -To make progress towards a manageable master equation, we now introduce the Markovian approximation, in which ``\rho_S(\tau)`` is replaced by ``\rho_S(t)``. +To make progress towards a manageable master equation, we now introduce the Markovian approximation, in which ``\hat{\rho}_{\textrm{S}}(\tau)`` is replaced by ``\hat{\rho}_{\textrm{S}}(t)``. The result is the Redfield equation ```math - \frac{d}{dt}\rho_S(t) = - \hbar^{-2}\int_0^t d\tau\; {\rm Tr}_B [H_I(t), [H_I(\tau), \rho_S(t)\otimes\rho_B]], + \frac{d}{dt}\hat{\rho}_{\textrm{S}}(t) = - \hbar^{-2}\int_0^t d\tau\; \textrm{Tr}_{\textrm{B}} [\hat{H}_{\textrm{I}}(t), [\hat{H}_{\textrm{I}}(\tau), \hat{\rho}_{\textrm{S}}(t)\otimes\hat{\rho}_{\textrm{B}}]], ``` which is local in time with respect the density matrix, but still not Markovian since it contains an implicit dependence on the initial state. By extending the integration to infinity and substituting ``\tau \rightarrow t-\tau``, a fully Markovian master equation is obtained: ```math - \frac{d}{dt}\rho_S(t) = - \hbar^{-2}\int_0^\infty d\tau\; {\rm Tr}_B [H_I(t), [H_I(t-\tau), \rho_S(t)\otimes\rho_B]]. + \frac{d}{dt}\hat{\rho}_{\textrm{S}}(t) = - \hbar^{-2}\int_0^\infty d\tau\; \textrm{Tr}_{\textrm{B}} [\hat{H}_{\textrm{I}}(t), [\hat{H}_{\textrm{I}}(t-\tau), \hat{\rho}_{\textrm{S}}(t)\otimes\hat{\rho}_{\textrm{B}}]]. ``` The two Markovian approximations introduced above are valid if the time-scale with which the system dynamics changes is large compared to the time-scale with which correlations in the bath decays (corresponding to a "short-memory" bath, which results in Markovian system dynamics). -The Markovian master equation above is still on a too general form to be suitable for numerical implementation. We therefore assume that the system-bath interaction takes the form ``H_I = \sum_\alpha A_\alpha \otimes B_\alpha`` and where ``A_\alpha`` are system operators and ``B_\alpha`` are bath operators. +The Markovian master equation above is still on a too general form to be suitable for numerical implementation. We therefore assume that the system-bath interaction takes the form ``\hat{H}_{\textrm{I}} = \sum_\alpha \hat{A}_\alpha \otimes \hat{B}_\alpha`` and where ``\hat{A}_\alpha`` are system operators and ``\hat{B}_\alpha`` are bath operators. This allows us to write master equation in terms of system operators and bath correlation functions: ```math -\begin{split}\frac{d}{dt}\rho_S(t) = +\begin{split}\frac{d}{dt}\hat{\rho}_{\textrm{S}}(t) = -\hbar^{-2} \sum_{\alpha\beta} \int_0^\infty d\tau\; \left\{ -g_{\alpha\beta}(\tau) \left[A_\alpha(t)A_\beta(t-\tau)\rho_S(t) - A_\beta(t-\tau)\rho_S(t)A_\alpha(t)\right] +g_{\alpha\beta}(\tau) \left[\hat{A}_\alpha(t)\hat{A}_\beta(t-\tau)\hat{\rho}_{\textrm{S}}(t) - \hat{A}_\beta(t-\tau)\hat{\rho}_{\textrm{S}}(t)\hat{A}_\alpha(t)\right] \right. \nonumber\\ \left. -+ g_{\alpha\beta}(-\tau) \left[\rho_S(t)A_\alpha(t-\tau)A_\beta(t) - A_\beta(t)\rho_S(t)A_\beta(t-\alpha)\right] ++ g_{\alpha\beta}(-\tau) \left[\hat{\rho}_{\textrm{S}}(t)\hat{A}_\alpha(t-\tau)\hat{A}_\beta(t) - \hat{A}_\beta(t)\hat{\rho}_{\textrm{S}}(t)\hat{A}_\beta(t-\alpha)\right] \right\},\end{split} ``` -where ``g_{\alpha\beta}(\tau) = {\rm Tr}_B\left[B_\alpha(t)B_\beta(t-\tau)\rho_B\right] = \left``, -since the bath state ``\rho_B`` is a steady state. +where ``g_{\alpha\beta}(\tau) = \textrm{Tr}_{\textrm{B}}\left[\hat{B}_\alpha(t)\hat{B}_\beta(t-\tau)\hat{\rho}_{\textrm{B}}\right] = \langle\hat{B}_\alpha(\tau)\hat{B}_\beta(0)\rangle``, +since the bath state ``\hat{\rho}_{\textrm{B}}`` is a steady state. In the eigenbasis of the system Hamiltonian, where ``A_{mn}(t) = A_{mn} e^{i\omega_{mn}t}``, ``\omega_{mn} = \omega_m - \omega_n`` and ``\omega_m`` are the eigenfrequencies -corresponding the eigenstate ``\left|m\right>``, we obtain in matrix form in the Schrödinger picture +corresponding the eigenstate ``\left|m\rangle``, we obtain in matrix form in the Schrödinger picture ```math \begin{aligned} @@ -94,7 +92,7 @@ corresponding the eigenstate ``\left|m\right>``, we obtain in matrix form in the ``` where the "sec" above the summation symbol indicate summation of the secular terms which satisfy ``|\omega_{ab}-\omega_{cd}| \ll \tau_ {\rm decay}``. -This is an almost-useful form of the master equation. The final step before arriving at the form of the Bloch-Redfield master equation that is implemented in QuTiP, involves rewriting the bath correlation function ``g(\tau)`` in terms of the noise-power spectrum of the environment ``S(\omega) = \int_{-\infty}^\infty d\tau e^{i\omega\tau} g(\tau)``: +This is an almost-useful form of the master equation. The final step before arriving at the form of the Bloch-Redfield master equation that is implemented in `QuantumToolbox.jl`, involves rewriting the bath correlation function ``g(\tau)`` in terms of the noise-power spectrum of the environment ``S(\omega) = \int_{-\infty}^\infty d\tau e^{i\omega\tau} g(\tau)``: ```math \int_0^\infty d\tau\; g_{\alpha\beta}(\tau) e^{i\omega\tau} = \frac{1}{2}S_{\alpha\beta}(\omega) + i\lambda_{\alpha\beta}(\omega), @@ -114,6 +112,7 @@ where ``\lambda_{ab}(\omega)`` is an energy shift that is neglected here. The fi where ```math +\begin{aligned} R_{abcd} = -\frac{\hbar^{-2}}{2} \sum_{\alpha,\beta} \left\{ \delta_{bd}\sum_nA^\alpha_{an}A^\beta_{nc}S_{\alpha\beta}(\omega_{cn}) @@ -126,15 +125,17 @@ where - A^\beta_{ac}A^\alpha_{db} S_{\alpha\beta}(\omega_{db}) \right\}, +\end{aligned} ``` is the Bloch-Redfield tensor. -The Bloch-Redfield master equation in this form is suitable for numerical implementation. The input parameters are the system Hamiltonian ``H``, the system operators through which the environment couples to the system ``A_\alpha``, and the noise-power spectrum ``S_{\alpha\beta}(\omega)`` associated with each system-environment interaction term. +The Bloch-Redfield master equation in this form is suitable for numerical implementation. The input parameters are the system Hamiltonian ``\hat{H}_{\textrm{S}}``, the system operators through which the environment couples to the system ``\hat{A}_\alpha``, and the noise-power spectrum ``S_{\alpha\beta}(\omega)`` associated with each system-environment interaction term. -To simplify the numerical implementation we often assume that ``A_\alpha`` are Hermitian and that cross-correlations between different environment operators vanish, resulting in +To simplify the numerical implementation we often assume that ``\hat{A}_\alpha`` are Hermitian and that cross-correlations between different environment operators vanish, resulting in ```math +\begin{aligned} R_{abcd} = -\frac{\hbar^{-2}}{2} \sum_{\alpha} \left\{ \delta_{bd}\sum_nA^\alpha_{an}A^\alpha_{nc}S_{\alpha}(\omega_{cn}) @@ -147,22 +148,23 @@ To simplify the numerical implementation we often assume that ``A_\alpha`` are H - A^\alpha_{ac}A^\alpha_{db} S_{\alpha}(\omega_{db}) \right\}. +\end{aligned} ``` -## Bloch-Redfield master equation in `QuantumToolbox.jl` +## [Bloch-Redfield master equation in `QuantumToolbox.jl`](@id Bloch-Redfield-master-equation-in-QuantumToolbox-jl) ### Preparing the Bloch-Redfield tensor In `QuantumToolbox.jl`, the Bloch-redfield master equation can be calculated using the function [`bloch_redfield_tensor`](@ref). -It takes two mandatory arguments: The system Hamiltonian ``H`` and a nested list `a_ops` consist of tuples as `(A, spec)` -with `A::QuantumObject{Operator}` being the operator ``A_\alpha`` and `spec::Function` being the spectral density functions ``S_\alpha(\omega)``. +It takes two mandatory arguments: The system Hamiltonian ``\hat{H}`` and a nested list `a_ops` consist of tuples as `(A, spec)` +with `A::QuantumObject` being the [`Operator`](@ref) ``\hat{A}_\alpha`` and `spec::Function` being the spectral density function ``S_\alpha(\omega)``. -It is possible to also get the term for a bath `\alpha` directly using [`brterm`](@ref). This function takes only one hermitian coupling operator ``A_\alpha`` and spectral response function ``S_\alpha(\omega)``. +It is possible to also get the ``\alpha``-th term for the bath directly using [`brterm`](@ref). This function takes only one Hermitian coupling operator ``\hat{A}_\alpha`` and spectral response function ``S_\alpha(\omega)``. To illustrate how to calculate the Bloch-Redfield tensor, let's consider a two-level atom ```math - H = -\frac{1}{2}\Delta\sigma_x - \frac{1}{2}\varepsilon_0\sigma_z + \hat{H}_{\textrm{S}} = -\frac{1}{2}\Delta\hat{\sigma}_x - \frac{1}{2}\varepsilon_0\hat{\sigma}_z ``` ```@setup brmesolve @@ -179,15 +181,7 @@ CairoMakie.enable_only_mime!(MIME"image/svg+xml"()) H = -Δ/2.0 * sigmax() - ε0/2 * sigmaz() -function ohmic_spectrum(ω) - if ω == 0. # dephasing noise - return γ1 - elseif ω > 0 # relaxing noise - return γ1 / 2 * ω / (2π) - else - return 0 - end -end +ohmic_spectrum(ω) = (ω == 0.0) ? γ1 : γ1 / 2 * (ω / (2 * π)) * (ω > 0.0) R, U = bloch_redfield_tensor(H, [(sigmax(), ohmic_spectrum)]) @@ -199,18 +193,18 @@ Bloch-Refield tensor by passing the operators via the third argument `c_ops` like you would in the [`mesolve`](@ref) or [`mcsolve`](@ref) functions. For convenience, when the keyword argument `fock_basis = false`, the function [`bloch_redfield_tensor`](@ref) also returns the basis transformation operator `U`, the eigen vector matrix, since they are calculated in the -process of calculating the Bloch-Redfield tensor `R`, and the `U` are usually +process of generating the Bloch-Redfield tensor `R`, and the `U` are usually needed again later when transforming operators between the laboratory basis and the eigen basis. The tensor can be obtained in the laboratory basis by setting `fock_basis = true`, -in that case, the transformation operator is not returned. +in that case, the transformation operator `U` is not returned. ### Time evolution The evolution of a wave function or density matrix, according to the Bloch-Redfield master equation, can be calculated using the function [`mesolve`](@ref) -using Bloch-Refield tensor in the laboratory basis instead of a liouvillian. -For example, to evaluate the expectation values of the ``\sigma_x``, -``\sigma_y``, and ``\sigma_z`` operators for the example above, we can use the following code: +with Bloch-Refield tensor `R` in the laboratory basis instead of a [`liouvillian`](@ref). +For example, to evaluate the expectation values of the ``\hat{\sigma}_x``, +``\hat{\sigma}_y``, and ``\hat{\sigma}_z`` operators for the example above, we can use the following code: ```@example brmesolve Δ = 0.2 * 2 * π @@ -245,14 +239,14 @@ fig, _ = render(sphere) fig ``` -The two steps of calculating the Bloch-Redfield tensor and evolving according to +The two steps of calculating the Bloch-Redfield tensor `R` and evolving according to the corresponding master equation can be combined into one by using the function [`brmesolve`](@ref), in addition to the same arguments as [`mesolve`](@ref) and [`mcsolve`](@ref), the nested list of operator-spectrum tuple should be given under `a_ops`. ```@example brmesolve - output = brmesolve(H, ψ0, tlist, ((sigmax(),ohmic_spectrum),); e_ops=e_ops) +sol = brmesolve(H, ψ0, tlist, ((sigmax(),ohmic_spectrum),); e_ops=e_ops) ``` -The resulting `output` is of the `struct` [`TimeEvolutionSol`](@ref) as [`mesolve`](@ref). +The resulting `sol` is of the `struct` [`TimeEvolutionSol`](@ref) as [`mesolve`](@ref). From 0327aa3100bc23b3c4f874e91620a4ae43837c7b Mon Sep 17 00:00:00 2001 From: cailixun Date: Tue, 17 Jun 2025 23:22:58 +0800 Subject: [PATCH 13/17] update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 020c8e43b..87922e063 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add Bloch-Redfield master equation solver. ([#473]) - Implement Bloch Sphere rendering and align style with qutip. ([#472], [#480], [#485], [#487], [#489]) - Add `Base.copy` method for `AbstractQuantumObject`. ([#486]) +- Add documentation for Bloch-Redfield master equation. ([#493]) ## [v0.31.1] Release date: 2025-05-16 @@ -241,3 +242,4 @@ Release date: 2024-11-13 [#486]: https://github.com/qutip/QuantumToolbox.jl/issues/486 [#487]: https://github.com/qutip/QuantumToolbox.jl/issues/487 [#489]: https://github.com/qutip/QuantumToolbox.jl/issues/489 +[#493]: https://github.com/qutip/QuantumToolbox.jl/issues/493 From 190c4ca913373384f01c3420aa97bb248b3c4385 Mon Sep 17 00:00:00 2001 From: cailixun Date: Tue, 17 Jun 2025 23:31:56 +0800 Subject: [PATCH 14/17] Minor changes --- .../users_guide/time_evolution/brmesolve.md | 61 ++++--------------- 1 file changed, 12 insertions(+), 49 deletions(-) diff --git a/docs/src/users_guide/time_evolution/brmesolve.md b/docs/src/users_guide/time_evolution/brmesolve.md index 9833ab830..d1d732d07 100644 --- a/docs/src/users_guide/time_evolution/brmesolve.md +++ b/docs/src/users_guide/time_evolution/brmesolve.md @@ -1,19 +1,10 @@ # [Bloch-Redfield master equation](@id doc-TE:Bloch-Redfield-master-equation) -The [Lindblad master equation](@ref doc-TE:Lindblad-Master-Equation-Solver) introduced earlier is constructed so that it describes a physical evolution of the density matrix (i.e., trace and positivity preserving), but it does not provide a connection to any underlying microscopic physical model. -The Lindblad operators (collapse operators) describe phenomenological processes, such as for example dephasing and spin flips, and the rates of these processes are arbitrary parameters in the model. -In many situations the collapse operators and their corresponding rates have clear physical interpretation, such as dephasing and relaxation rates, and in those cases the Lindblad master equation is usually the method of choice. +The [Lindblad master equation](@ref doc-TE:Lindblad-Master-Equation-Solver) introduced earlier is constructed so that it describes a physical evolution of the density matrix (i.e., trace and positivity preserving), but it does not provide a connection to any underlying microscopic physical model. The Lindblad operators (collapse operators) describe phenomenological processes, such as for example dephasing and spin flips, and the rates of these processes are arbitrary parameters in the model. In many situations the collapse operators and their corresponding rates have clear physical interpretation, such as dephasing and relaxation rates, and in those cases the Lindblad master equation is usually the method of choice. However, in some cases, for example systems with varying energy biases and eigenstates and that couple to an environment in some well-defined manner (through a physically motivated system-environment interaction operator), it is often desirable to derive the master equation from more fundamental physical principles, and relate it to for example the noise-power spectrum of the environment. -The Bloch-Redfield formalism is one such approach to derive a master equation from a microscopic system. -It starts from a combined system-environment perspective, and derives a perturbative master equation for the system alone, under the assumption of weak system-environment coupling. -One advantage of this approach is that the dissipation processes and rates are obtained directly from the properties of the environment. -On the downside, it does not intrinsically guarantee that the resulting master equation unconditionally preserves the physical properties of the density matrix (because it is a perturbative method). -The Bloch-Redfield master equation must therefore be used with care, and the assumptions made in the derivation must be honored. -(The Lindblad master equation is in a sense more robust -- it always results in a physical density matrix -- although some collapse operators might not be physically justified). -For a full derivation of the Bloch Redfield master equation, see e.g. [Cohen_Tannoudji_atomphoton](@citet) or [breuer2002](@citet). -Here we present only a brief version of the derivation, with the intention of introducing the notation and how it relates to the implementation in `QuantumToolbox.jl`. +The Bloch-Redfield formalism is one such approach to derive a master equation from a microscopic system. It starts from a combined system-environment perspective, and derives a perturbative master equation for the system alone, under the assumption of weak system-environment coupling. One advantage of this approach is that the dissipation processes and rates are obtained directly from the properties of the environment. On the downside, it does not intrinsically guarantee that the resulting master equation unconditionally preserves the physical properties of the density matrix (because it is a perturbative method). The Bloch-Redfield master equation must therefore be used with care, and the assumptions made in the derivation must be honored. (The Lindblad master equation is in a sense more robust -- it always results in a physical density matrix -- although some collapse operators might not be physically justified). For a full derivation of the Bloch Redfield master equation, see e.g. [Cohen_Tannoudji_atomphoton](@citet) or [breuer2002](@citet). Here we present only a brief version of the derivation, with the intention of introducing the notation and how it relates to the implementation in `QuantumToolbox.jl`. ## [Brief Derivation and Definitions](@id doc-TE:Brief-Derivation-and-Definitions) @@ -26,13 +17,9 @@ The most general form of a master equation for the system dynamics is obtained b \frac{d}{dt}\hat{\rho}_{\textrm{S}}(t) = - \hbar^{-2}\int_0^t d\tau\; \textrm{Tr}_{\textrm{B}} [\hat{H}_{\textrm{I}}(t), [\hat{H}_{\textrm{I}}(\tau), \hat{\rho}_{\textrm{S}}(\tau)\otimes\hat{\rho}_{\textrm{B}}]], ``` -where the additional assumption that the total system-bath density matrix can be factorized as ``\hat{\rho}(t) \approx \hat{\rho}_{\textrm{S}}(t) \otimes \hat{\rho}_{\textrm{B}}``. -This assumption is known as the Born approximation, and it implies that there never is any entanglement between the system and the bath, neither in the initial state nor at any time during the evolution. -*It is justified for weak system-bath interaction.* +where the additional assumption that the total system-bath density matrix can be factorized as ``\hat{\rho}(t) \approx \hat{\rho}_{\textrm{S}}(t) \otimes \hat{\rho}_{\textrm{B}}``. This assumption is known as the Born approximation, and it implies that there never is any entanglement between the system and the bath, neither in the initial state nor at any time during the evolution. *It is justified for weak system-bath interaction.* -The master equation above is non-Markovian, i.e., the change in the density matrix at a time ``t`` depends on states at all times ``\tau < t``, making it intractable to solve both theoretically and numerically. -To make progress towards a manageable master equation, we now introduce the Markovian approximation, in which ``\hat{\rho}_{\textrm{S}}(\tau)`` is replaced by ``\hat{\rho}_{\textrm{S}}(t)``. -The result is the Redfield equation +The master equation above is non-Markovian, i.e., the change in the density matrix at a time ``t`` depends on states at all times ``\tau < t``, making it intractable to solve both theoretically and numerically. To make progress towards a manageable master equation, we now introduce the Markovian approximation, in which ``\hat{\rho}_{\textrm{S}}(\tau)`` is replaced by ``\hat{\rho}_{\textrm{S}}(t)``. The result is the Redfield equation ```math \frac{d}{dt}\hat{\rho}_{\textrm{S}}(t) = - \hbar^{-2}\int_0^t d\tau\; \textrm{Tr}_{\textrm{B}} [\hat{H}_{\textrm{I}}(t), [\hat{H}_{\textrm{I}}(\tau), \hat{\rho}_{\textrm{S}}(t)\otimes\hat{\rho}_{\textrm{B}}]], @@ -46,8 +33,7 @@ which is local in time with respect the density matrix, but still not Markovian The two Markovian approximations introduced above are valid if the time-scale with which the system dynamics changes is large compared to the time-scale with which correlations in the bath decays (corresponding to a "short-memory" bath, which results in Markovian system dynamics). -The Markovian master equation above is still on a too general form to be suitable for numerical implementation. We therefore assume that the system-bath interaction takes the form ``\hat{H}_{\textrm{I}} = \sum_\alpha \hat{A}_\alpha \otimes \hat{B}_\alpha`` and where ``\hat{A}_\alpha`` are system operators and ``\hat{B}_\alpha`` are bath operators. -This allows us to write master equation in terms of system operators and bath correlation functions: +The Markovian master equation above is still on a too general form to be suitable for numerical implementation. We therefore assume that the system-bath interaction takes the form ``\hat{H}_{\textrm{I}} = \sum_\alpha \hat{A}_\alpha \otimes \hat{B}_\alpha`` and where ``\hat{A}_\alpha`` are system operators and ``\hat{B}_\alpha`` are bath operators. This allows us to write master equation in terms of system operators and bath correlation functions: ```math \begin{split}\frac{d}{dt}\hat{\rho}_{\textrm{S}}(t) = @@ -62,12 +48,9 @@ g_{\alpha\beta}(\tau) \left[\hat{A}_\alpha(t)\hat{A}_\beta(t-\tau)\hat{\rho}_{\t \right\},\end{split} ``` -where ``g_{\alpha\beta}(\tau) = \textrm{Tr}_{\textrm{B}}\left[\hat{B}_\alpha(t)\hat{B}_\beta(t-\tau)\hat{\rho}_{\textrm{B}}\right] = \langle\hat{B}_\alpha(\tau)\hat{B}_\beta(0)\rangle``, -since the bath state ``\hat{\rho}_{\textrm{B}}`` is a steady state. +where ``g_{\alpha\beta}(\tau) = \textrm{Tr}_{\textrm{B}}\left[\hat{B}_\alpha(t)\hat{B}_\beta(t-\tau)\hat{\rho}_{\textrm{B}}\right] = \langle\hat{B}_\alpha(\tau)\hat{B}_\beta(0)\rangle``, since the bath state ``\hat{\rho}_{\textrm{B}}`` is a steady state. -In the eigenbasis of the system Hamiltonian, where ``A_{mn}(t) = A_{mn} e^{i\omega_{mn}t}``, -``\omega_{mn} = \omega_m - \omega_n`` and ``\omega_m`` are the eigenfrequencies -corresponding the eigenstate ``\left|m\rangle``, we obtain in matrix form in the Schrödinger picture +In the eigenbasis of the system Hamiltonian, where ``A_{mn}(t) = A_{mn} e^{i\omega_{mn}t}``, ``\omega_{mn} = \omega_m - \omega_n`` and ``\omega_m`` are the eigenfrequencies corresponding the eigenstate ``\left|m\rangle``, we obtain in matrix form in the Schrödinger picture ```math \begin{aligned} @@ -91,8 +74,7 @@ corresponding the eigenstate ``\left|m\rangle``, we obtain in matrix form in the \end{aligned} ``` -where the "sec" above the summation symbol indicate summation of the secular terms which satisfy ``|\omega_{ab}-\omega_{cd}| \ll \tau_ {\rm decay}``. -This is an almost-useful form of the master equation. The final step before arriving at the form of the Bloch-Redfield master equation that is implemented in `QuantumToolbox.jl`, involves rewriting the bath correlation function ``g(\tau)`` in terms of the noise-power spectrum of the environment ``S(\omega) = \int_{-\infty}^\infty d\tau e^{i\omega\tau} g(\tau)``: +where the "sec" above the summation symbol indicate summation of the secular terms which satisfy ``|\omega_{ab}-\omega_{cd}| \ll \tau_ {\rm decay}``. This is an almost-useful form of the master equation. The final step before arriving at the form of the Bloch-Redfield master equation that is implemented in `QuantumToolbox.jl`, involves rewriting the bath correlation function ``g(\tau)`` in terms of the noise-power spectrum of the environment ``S(\omega) = \int_{-\infty}^\infty d\tau e^{i\omega\tau} g(\tau)``: ```math \int_0^\infty d\tau\; g_{\alpha\beta}(\tau) e^{i\omega\tau} = \frac{1}{2}S_{\alpha\beta}(\omega) + i\lambda_{\alpha\beta}(\omega), @@ -100,7 +82,6 @@ This is an almost-useful form of the master equation. The final step before arri where ``\lambda_{ab}(\omega)`` is an energy shift that is neglected here. The final form of the Bloch-Redfield master equation is - ```math \frac{d}{dt}\rho_{ab}(t) = @@ -155,9 +136,7 @@ To simplify the numerical implementation we often assume that ``\hat{A}_\alpha`` ### Preparing the Bloch-Redfield tensor -In `QuantumToolbox.jl`, the Bloch-redfield master equation can be calculated using the function [`bloch_redfield_tensor`](@ref). -It takes two mandatory arguments: The system Hamiltonian ``\hat{H}`` and a nested list `a_ops` consist of tuples as `(A, spec)` -with `A::QuantumObject` being the [`Operator`](@ref) ``\hat{A}_\alpha`` and `spec::Function` being the spectral density function ``S_\alpha(\omega)``. +In `QuantumToolbox.jl`, the Bloch-redfield master equation can be calculated using the function [`bloch_redfield_tensor`](@ref). It takes two mandatory arguments: The system Hamiltonian ``\hat{H}`` and a nested list `a_ops` consist of tuples as `(A, spec)` with `A::QuantumObject` being the [`Operator`](@ref) ``\hat{A}_\alpha`` and `spec::Function` being the spectral density function ``S_\alpha(\omega)``. It is possible to also get the ``\alpha``-th term for the bath directly using [`brterm`](@ref). This function takes only one Hermitian coupling operator ``\hat{A}_\alpha`` and spectral response function ``S_\alpha(\omega)``. @@ -188,23 +167,11 @@ R, U = bloch_redfield_tensor(H, [(sigmax(), ohmic_spectrum)]) R ``` -Note that it is also possible to add Lindblad dissipation superoperators in the -Bloch-Refield tensor by passing the operators via the third argument `c_ops` -like you would in the [`mesolve`](@ref) or [`mcsolve`](@ref) functions. -For convenience, when the keyword argument `fock_basis = false`, the function [`bloch_redfield_tensor`](@ref) also returns the basis -transformation operator `U`, the eigen vector matrix, since they are calculated in the -process of generating the Bloch-Redfield tensor `R`, and the `U` are usually -needed again later when transforming operators between the laboratory basis and the eigen basis. -The tensor can be obtained in the laboratory basis by setting `fock_basis = true`, -in that case, the transformation operator `U` is not returned. +Note that it is also possible to add Lindblad dissipation superoperators in the Bloch-Refield tensor by passing the operators via the third argument `c_ops` like you would in the [`mesolve`](@ref) or [`mcsolve`](@ref) functions. For convenience, when the keyword argument `fock_basis = false`, the function [`bloch_redfield_tensor`](@ref) also returns the basis transformation operator `U`, the eigen vector matrix, since they are calculated in the process of generating the Bloch-Redfield tensor `R`, and the `U` are usually needed again later when transforming operators between the laboratory basis and the eigen basis. The tensor can be obtained in the laboratory basis by setting `fock_basis = true`, in that case, the transformation operator `U` is not returned. ### Time evolution -The evolution of a wave function or density matrix, according to the Bloch-Redfield -master equation, can be calculated using the function [`mesolve`](@ref) -with Bloch-Refield tensor `R` in the laboratory basis instead of a [`liouvillian`](@ref). -For example, to evaluate the expectation values of the ``\hat{\sigma}_x``, -``\hat{\sigma}_y``, and ``\hat{\sigma}_z`` operators for the example above, we can use the following code: +The evolution of a wave function or density matrix, according to the Bloch-Redfield master equation, can be calculated using the function [`mesolve`](@ref) with Bloch-Refield tensor `R` in the laboratory basis instead of a [`liouvillian`](@ref). For example, to evaluate the expectation values of the ``\hat{\sigma}_x``, ``\hat{\sigma}_y``, and ``\hat{\sigma}_z`` operators for the example above, we can use the following code: ```@example brmesolve Δ = 0.2 * 2 * π @@ -239,11 +206,7 @@ fig, _ = render(sphere) fig ``` -The two steps of calculating the Bloch-Redfield tensor `R` and evolving according to -the corresponding master equation can be combined into one by using the function -[`brmesolve`](@ref), in addition to the same arguments as [`mesolve`](@ref) and -[`mcsolve`](@ref), the nested list of operator-spectrum -tuple should be given under `a_ops`. +The two steps of calculating the Bloch-Redfield tensor `R` and evolving according to the corresponding master equation can be combined into one by using the function [`brmesolve`](@ref), in addition to the same arguments as [`mesolve`](@ref) and [`mcsolve`](@ref), the nested list of operator-spectrum tuple should be given under `a_ops`. ```@example brmesolve sol = brmesolve(H, ψ0, tlist, ((sigmax(),ohmic_spectrum),); e_ops=e_ops) From 6a5a98c05aa20e03b3831d2e52366e970c41d387 Mon Sep 17 00:00:00 2001 From: cailixun Date: Tue, 17 Jun 2025 23:36:43 +0800 Subject: [PATCH 15/17] update changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87922e063..b7d49a21f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add Bloch-Redfield master equation solver. ([#473]) - Implement Bloch Sphere rendering and align style with qutip. ([#472], [#480], [#485], [#487], [#489]) - Add `Base.copy` method for `AbstractQuantumObject`. ([#486]) -- Add documentation for Bloch-Redfield master equation. ([#493]) +- Add documentation for Bloch-Redfield master equation. ([#494]) ## [v0.31.1] Release date: 2025-05-16 @@ -242,4 +242,4 @@ Release date: 2024-11-13 [#486]: https://github.com/qutip/QuantumToolbox.jl/issues/486 [#487]: https://github.com/qutip/QuantumToolbox.jl/issues/487 [#489]: https://github.com/qutip/QuantumToolbox.jl/issues/489 -[#493]: https://github.com/qutip/QuantumToolbox.jl/issues/493 +[#494]: https://github.com/qutip/QuantumToolbox.jl/issues/494 From 0fa256374c015e8df4200b3a5ddfb690f424c3f6 Mon Sep 17 00:00:00 2001 From: cailixun Date: Wed, 18 Jun 2025 00:07:35 +0800 Subject: [PATCH 16/17] add `sec_cutoff` info and warning --- .../users_guide/time_evolution/brmesolve.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/src/users_guide/time_evolution/brmesolve.md b/docs/src/users_guide/time_evolution/brmesolve.md index d1d732d07..b922112f9 100644 --- a/docs/src/users_guide/time_evolution/brmesolve.md +++ b/docs/src/users_guide/time_evolution/brmesolve.md @@ -55,7 +55,7 @@ In the eigenbasis of the system Hamiltonian, where ``A_{mn}(t) = A_{mn} e^{i\ome ```math \begin{aligned} \frac{d}{dt} \rho_{ab}(t) = & -i\omega_{ab}\rho_{ab}(t)\\ - &-\hbar^{-2} \sum_{\alpha,\beta} \sum_{c,d}^{\rm sec} \int_0^\infty d\tau\; + &-\hbar^{-2} \sum_{\alpha,\beta} \sum_{c,d}^{\textrm{sec}} \int_0^\infty d\tau\; \left\{ g_{\alpha\beta}(\tau) \left[\delta_{bd}\sum_nA^\alpha_{an}A^\beta_{nc}e^{i\omega_{cn}\tau} @@ -87,7 +87,7 @@ where ``\lambda_{ab}(\omega)`` is an energy shift that is neglected here. The fi = -i\omega_{ab}\rho_{ab}(t) + - \sum_{c,d}^{\rm sec}R_{abcd}\rho_{cd}(t), + \sum_{c,d}^{\textrm{sec}}R_{abcd}\rho_{cd}(t), ``` where @@ -213,3 +213,17 @@ sol = brmesolve(H, ψ0, tlist, ((sigmax(),ohmic_spectrum),); e_ops=e_ops) ``` The resulting `sol` is of the `struct` [`TimeEvolutionSol`](@ref) as [`mesolve`](@ref). + +!!! note "Secular cutoff" + While the code example simulates the Bloch-Redfield equation in the secular approximation, `QuantumToolbox`'s implementation allows the user to simulate the non-secular version of the Bloch-Redfield equation by setting `sec_cutoff=-1`, as well as do a partial secular approximation by setting it to a `Float64` , this float number will become the cutoff for the summation (``\sum_{c,d}^{\textrm{sec}}``) in the previous equations, meaning that terms with ``\omega_{ab} - \omega_{cd}`` greater than the `sec_cutoff` will be neglected. Its default value is `0.1` which corresponds to the secular approximation. + +For example, the command + +```julia +sol = brmesolve(H, ψ0, tlist, ((sigmax(),ohmic_spectrum),); e_ops=e_ops, sec_cutoff=-1) +``` + +will simulate the same example as above without the secular approximation. + +!!! warning "Secular cutoff" + Using the non-secular version may lead to negativity issues. From 56dd7126d8c144879a9df7ee6abefab60376db91 Mon Sep 17 00:00:00 2001 From: cailixun Date: Wed, 18 Jun 2025 00:16:21 +0800 Subject: [PATCH 17/17] fix typo --- docs/src/users_guide/time_evolution/brmesolve.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/users_guide/time_evolution/brmesolve.md b/docs/src/users_guide/time_evolution/brmesolve.md index b922112f9..c7a46e612 100644 --- a/docs/src/users_guide/time_evolution/brmesolve.md +++ b/docs/src/users_guide/time_evolution/brmesolve.md @@ -50,7 +50,7 @@ g_{\alpha\beta}(\tau) \left[\hat{A}_\alpha(t)\hat{A}_\beta(t-\tau)\hat{\rho}_{\t where ``g_{\alpha\beta}(\tau) = \textrm{Tr}_{\textrm{B}}\left[\hat{B}_\alpha(t)\hat{B}_\beta(t-\tau)\hat{\rho}_{\textrm{B}}\right] = \langle\hat{B}_\alpha(\tau)\hat{B}_\beta(0)\rangle``, since the bath state ``\hat{\rho}_{\textrm{B}}`` is a steady state. -In the eigenbasis of the system Hamiltonian, where ``A_{mn}(t) = A_{mn} e^{i\omega_{mn}t}``, ``\omega_{mn} = \omega_m - \omega_n`` and ``\omega_m`` are the eigenfrequencies corresponding the eigenstate ``\left|m\rangle``, we obtain in matrix form in the Schrödinger picture +In the eigenbasis of the system Hamiltonian, where ``A_{mn}(t) = A_{mn} e^{i\omega_{mn}t}``, ``\omega_{mn} = \omega_m - \omega_n`` and ``\omega_m`` are the eigenfrequencies corresponding to the eigenstate ``|m\rangle``, we obtain in matrix form in the Schrödinger picture ```math \begin{aligned}