qit.markov.MarkovianBath

class qit.markov.MarkovianBath(bath_type: str, stat: str, TU: float, T: float)

Markovian heat bath.

Supports bosonic and fermionic canonical ensembles at absolute temperature T, with an ohmic spectral density. The bath couples to the system via a single-term coupling \(H_\text{int} = A \otimes \sum_k \lambda_k (a_k +a_k')\).

Parameters
  • bath_type (str) – bath type, determines the spectral density, in {‘ohmic’, ‘photon’}.

  • stat (str) – bath statistics, in (‘boson’, ‘fermion’)

  • TU (float) – bath time unit (in s)

  • T (float) – bath temperature (in K)

The bath spectral density is either ohmic or photonic, with a cutoff:

\[\begin{split}J_\text{ohmic}(\omega) = \omega \: \mathrm{cut}(\omega) \Theta(\omega),\\ J_\text{photon}(\omega) = \omega^3 \: \mathrm{cut}(\omega) \Theta(\omega).\end{split}\]

Three types of cutoffs are supported:

\[\begin{split}\mathrm{cut}_\text{exp}(x \: \omega_c) &= \exp(-x),\\ \mathrm{cut}_\text{smooth}(x \: \omega_c) &= \frac{1}{1+x^2},\\ \mathrm{cut}_\text{sharp}(x \: \omega_c) &= \Theta(1-x).\end{split}\]

The effects of the bath on the system are contained in the complex spectral correlation tensor \(\Gamma\). Computing values of this tensor is the main purpose of this class. It depends on three parameters: the inverse temperature of the bath \(s = \beta \hbar\), the spectral cutoff frequency of the bath \(\omega_c\), and the system frequency \(\omega\). It has the following scaling property:

\[\Gamma_{s,\omega_c}(\omega) = \Gamma_{s/a,\omega_c a}(\omega a) / a.\]

Hence we may eliminate the dimensions by choosing a = TU:

\[\Gamma_{s,\omega_c}(\omega) = \frac{1}{\text{TU}} \Gamma_{\hat{s}, \hat{\omega_c}}(\hat{\omega}),\]

where the hat denotes a dimensionless quantity. Since we only have one coupling term, \(\Gamma\) is a scalar. We split it into its hermitian and antihermitian parts:

\[\Gamma_{s, \omega_c}(\omega) = \frac{1}{2} \gamma(\omega) +i S(\omega),\]

where \(\gamma\) and \(S\) are real, and

\[\begin{split}\gamma(\omega) &= 2 \pi (1 \pm n(\omega)) \mathrm{cut}(|\omega|) \begin{cases} \omega \quad \text{(bosons)}\\ |\omega| \quad \text{(fermions)} \end{cases}\\ S(\omega) &= P \int_0^\infty \mathrm{d}\nu \frac{J(\nu)}{(\omega-\nu)(\omega+\nu)} \begin{cases} \omega \coth(\beta \hbar \nu/2) +\nu \quad \text{(bosons)}\\ \omega +\nu \tanh(\beta \hbar \nu/2) \quad \text{(fermions)} \end{cases}\end{split}\]

where \(n(\omega) := 1/(e^{\beta \hbar \omega} \mp 1)\) is the Planc/Fermi function and \(\beta = 1/(k_B T)\). Since \(\Gamma\) is pretty expensive to compute, we store the computed results into a lookup table which is used to interpolate nearby values.

Private attributes (set automatically):

Data member

Description

cut_func

Spectral density cutoff function.

pf

Planck or Fermi function depending on statistics.

corr_int

Integral transform for the dimensionless bath correlation function.

g_func

Spectral correlation tensor, real part. \(\gamma(\omega/\text{TU}) \: \text{TU} = \mathrm{g\_func}(\omega)\).

s_func

Spectral correlation tensor, imaginary part.

g0

\(\lim_{\omega \to 0} \gamma(\omega)\).

s0

\(\lim_{\omega \to 0} S(\omega)\).

omega

Lookup table.

gs_table

Lookup table. \(\gamma(\text{omega[k]}/\text{TU}) \: \text{TU}\) = gs_table[k, 0].

Attributes

type

Bath type.

stat

Bath statistics.

TU

Time unit (in s).

T

Absolute temperature of the bath (in K).

scale

Dimensionless temperature scaling parameter \(\hbar / (k_B T \: \text{TU})\).

cut_type

Spectral density cutoff type, in {'sharp', 'smooth', 'exp'}.

cut_omega

Spectral density cutoff angular frequency \(\omega_c\) (in \(1/\text{TU}\)).

Methods

build_LUT([om])

Build a lookup table for the spectral correlation tensor Gamma.

compute_gs(x)

Computes the spectral correlation tensor.

corr(x)

Bath spectral correlation tensor, computed or interpolated.

desc([long])

Bath description string for plots.

fit(delta, T1, T2)

Qubit-bath coupling that reproduces given decoherence times.

plot_bath_correlation()

Plot the bath correlation function \(C_{s,\omega_c}(t) = \frac{1}{\hbar^2}\langle B(t) B(0)\rangle\).

plot_spectral_correlation()

Plot the spectral correlation tensor components \(\gamma\) and \(S\) as a function of omega.

plot_spectral_correlation_vs_cutoff([boltz])

Plot spectral correlation tensor components as a function of cutoff frequency.

set_cutoff(cutoff_type, cut_omega)

Set the spectral density cutoff.

setup()

Initializes the g and s functions, and the LUT.

type

Bath type. ‘ohmic’ or ‘photon’.

stat

Bath statistics. Either ‘boson’ or ‘fermion’.

TU

Time unit (in s). All Hamiltonians have been made dimensionless by multiplying with \(\text{TU}/\hbar\).

T

Absolute temperature of the bath (in K).

scale

Dimensionless temperature scaling parameter \(\hbar / (k_B T \: \text{TU})\).

cut_type

Spectral density cutoff type, in {'sharp', 'smooth', 'exp'}.

cut_omega

Spectral density cutoff angular frequency \(\omega_c\) (in \(1/\text{TU}\)).

desc(long: bool = True) str

Bath description string for plots.

Parameters

long (bool) –

Return type

str

set_cutoff(cutoff_type: Optional[str], cut_omega: Optional[float]) None

Set the spectral density cutoff.

Passing None leaves the corresponding property unchanged.

Parameters
  • cutoff_type (Optional[str]) – cutoff type, in {'sharp', 'smooth', 'exp'}

  • cut_omega (Optional[float]) – omega cutoff value

Return type

None

setup() None

Initializes the g and s functions, and the LUT.

Must be called after parameters change.

Return type

None

_pad_LUT() None

Add limits at infinity to the lookup tables.

Return type

None

build_LUT(om: Optional[np.ndarray[float]] = None) None

Build a lookup table for the spectral correlation tensor Gamma.

Parameters

om (Optional[np.ndarray[float]]) – vector of omegas denoting the points to compute

Return type

None

_plot(x, om, q, gs, odd_s, even_s, f=<function plot>)

Plotting utility.

Parameters
  • x (array[float]) – x coordinates of the points

  • om (array[float]) –

  • q (array[float]) –

  • gs (array[float]) – gamma and S, the real and imaginary components of the spectral correlation tensor

  • odd_s (array[float]) – odd part of S

  • even_s (array[float]) – even part of S

  • f (callable) – plotting function

Returns

the plot

Return type

Axes

plot_spectral_correlation() None

Plot the spectral correlation tensor components \(\gamma\) and \(S\) as a function of omega.

Additionally plots the even and odd parts of \(S\), and compares them to analytical expressions. Uses the spectral correlation tensor LUT.

Return type

None

plot_spectral_correlation_vs_cutoff(boltz: float = 0.5) None

Plot spectral correlation tensor components as a function of cutoff frequency.

The angular frequency \(\omega\) at which the spectral correlation tensor is evaluated is fixed by giving the Boltzmann factor \(e^{-\beta \hbar \omega}\).

Parameters

boltz (float) – Boltzmann factor

Return type

None

plot_bath_correlation() None

Plot the bath correlation function \(C_{s,\omega_c}(t) = \frac{1}{\hbar^2}\langle B(t) B(0)\rangle\).

It scales as

\[C_{s,\omega_c}(t) = \frac{1}{a^2} C_{s/a,\omega_c a}(t/a).\]

Choosing a = TU, we obtain

\[C_{s,\omega_c}(t) = \frac{1}{\text{TU}^2} C_{\hat{s}, \hat{\omega_c}}(\hat{t}).\]
Return type

None

compute_gs(x: float) Tuple[float, float]

Computes the spectral correlation tensor. See corr for usage.

Parameters

x (float) – angular frequency [1/TU]

Returns

Real and imaginary parts of the spectral correlation tensor at x [1/TU]

Return type

Tuple[float, float]

corr(x: float) Tuple[float, float]

Bath spectral correlation tensor, computed or interpolated.

\[\Gamma(x/\text{TU}) \: \text{TU} = \frac{1}{2} g +i s\]
Parameters

x (float) – angular frequency [1/TU]

Returns

Real and imaginary parts of the spectral correlation tensor at x [1/TU]

Return type

Tuple[float, float]

fit(delta: float, T1: float, T2: float)

Qubit-bath coupling that reproduces given decoherence times.

Parameters
  • delta (float) – qubit energy splitting (in units of \(\hbar/TU\))

  • T1 (float) – qubit decoherence times T1 and T2 (in units of \(TU\))

  • T2 (float) – qubit decoherence times T1 and T2 (in units of \(TU\))

Returns

qubit Hamiltonian, qubit-bath coupling operator

Return type

array[complex], array[complex]

Returns the qubit Hamiltonian H and the qubit-bath coupling operator D that reproduce the decoherence times T1 and T2 for a single-qubit system coupled to the bath.

The bath object is not modified.