API Reference

Molecules

OpenQuantumSystems.ModeType
Mode{T}(omega, shift)

Stuct which purpose is to model vibrational LHO mode in Molecule.

$V(q) = \hbar \omega (q - q_0)^2, \quad \hbar = 1$

Arguments

  • omega: The frequency of LHO ($\omega$).
  • shift: The shift of the coordinate of LHO ($q_0$).
source
OpenQuantumSystems.MoleculeType
Molecule{T,C1,C2}(modes, Nvib, E)

Stuct which purpose is to model a molecule in Aggregate.

Arguments

  • modes: Vector of modes (Mode).
  • Nvib: Maximum number of vibrational states for all modes.
  • E: Energy of ground and excited state of molecule (HOMO, LUMO).
source
OpenQuantumSystems.get_mol_state_energyMethod
get_mol_state_energy(mol, molElState, molVibState)

Get the energy of the Molecule state.

Arguments

  • mol: Instance of Molecule.
  • molElState: Electric state of the molecule in local basis (i.e. 1 or 2, where 1 is ground state).
  • molVibState: Vibrational state of the molecule (e.g. [1, 5, 2, 2]).
source
OpenQuantumSystems.get_mol_state_fcMethod
get_mol_state_fc(mol, molElState1, molVibState1, molElState2, molVibState2)

Get the energy of the Molecule state.

Arguments

  • mol: Instance of Molecule.
  • molElState1, molElState2: Electric state of the molecule in local basis (i.e. 1 or 2, where 1 is ground state).
  • molVibState1, molVibState2: Vibrational state of the molecule (e.g. [1, 5, 2, 2]).
source

Aggregate Core

OpenQuantumSystems.AggregateCoreType
AggregateCore{T,C1,C2}(molecules, coupling)
AggregateCore{T,C1,C2}(molecules)

Mutable stuct which purpose is to store important information about the whole aggregate.

Arguments

  • molecules: Vector of molecules (Molecule).
  • coupling: Matrix of couplings $J_{nm}$ between molecules.
source
OpenQuantumSystems.get_agg_state_energyMethod
get_agg_state_energy(agg, aggElState, aggVibState)

Get Hamiltonian of the Aggregate in a form of DenseOperator.

Arguments

  • agg: Instance of Aggregate.
  • aggElState: Aggregate electric state (e.g. [1, 1, 2]).
  • aggVibState: Aggregate vibrational state (e.g. [[9, 1], [2, 5, 3], [10]]).
source

Aggregate Tools

Aggregate Operators

OpenQuantumSystems.get_agg_ham_system_bathMethod

getagghamsystembath(agg, aggTools.indices, franckcondonfactors; groundEnergy = false) getagghamsystembath(agg, aggTools.indices; groundEnergy = false) getagghamsystembath(agg; groundEnergy = false)

Get system and bath Hamiltonian of the Aggregate in a form of DenseOperator.

Arguments

source

Aggregate

Convenience Constructors

OpenQuantumSystems.setup_linear_chainMethod
setup_linear_chain(; energies=[12500., 12700.], J_nearest=100., mode_omega=200., mode_hr=0.02, nvib=3)

Create a fully set-up linear chain Aggregate with nearest-neighbour coupling and one vibrational mode per molecule.

Returns an Aggregate ready for time-evolution calculations.

source
OpenQuantumSystems.setup_trimerMethod
setup_trimer(; E=[12500., 12700., 12900.], J_matrix=zeros(3,3), mode_omega=200., mode_hr=0.02, nvib=3)

Create a fully set-up trimer Aggregate with one vibrational mode per molecule.

J_matrix is a 3x3 coupling matrix (only off-diagonal elements are used). Returns an Aggregate ready for time-evolution calculations.

source

Evolution

OpenQuantumSystems.evolutionExact!Method
evolutionExact!(op_array, op0, tspan, Hamiltonian; 
	diagonalize = true, approximate = false)

Calculate exact time evolution of the op0 state inplace see evolution_operator_iterator. The diagonalize argument decompose Hamiltonian into $\lambda_i, S, S^{-1}$ and calculate the exponential using eigenvalue decomposition. The approximate option asusmes that tspan is made of equidistant points, therefore $U(t)$ has to be calculated for $t_0$ and $t_\text{step}$.

source
OpenQuantumSystems.evolutionExact!Method
evolutionExact!(ket_array, ket0, tspan, Hamiltonian; 
	diagonalize = true, approximate = false)

Calculate exact time evolution of the ket0 state inplace see evolution_operator_iterator. The diagonalize argument decompose Hamiltonian into $\lambda_i, S, S^{-1}$ and calculate the exponential using eigenvalue decomposition. The approximate option asusmes that tspan is made of equidistant points, therefore $U(t)$ has to be calculated for $t_0$ and $t_\text{step}$.

source
OpenQuantumSystems.evolutionExactMethod
evolutionExact(ket0, tspan, Hamiltonian; diagonalize = true, approximate = false)

Calculate exact time evolution of the ket0 state see evolution_operator_iterator. The diagonalize argument decompose Hamiltonian into $\lambda_i, S, S^{-1}$ and calculate the exponential using eigenvalue decomposition. The approximate option asusmes that tspan is made of equidistant points, therefore $U(t)$ has to be calculated for $t_0$ and $t_\text{step}$.

source
OpenQuantumSystems.evolutionExactMethod
evolutionExact(op0, tspan, Hamiltonian; diagonalize = true, approximate = false)

Calculate exact time evolution of the op0 state see evolution_operator_iterator. The diagonalize argument decompose Hamiltonian into $\lambda_i, S, S^{-1}$ and calculate the exponential using eigenvalue decomposition. The approximate option asusmes that tspan is made of equidistant points, therefore $U(t)$ has to be calculated for $t_0$ and $t_\text{step}$.

source
OpenQuantumSystems.evolution_approximateMethod
evolution_exact(rho0, tspan, Hamiltonian; diagonalize = false)

Calculate approximate time evolution of the rho0 based on $U(t)$ that is calculated for $t_0$ and $t_\text{step}$. The diagonalize argument decompose Hamiltonian into $\lambda_i, S, S^{-1}$ and calculate the exponential using eigenvalue decomposition. See evolution_operator. This method returns tspan and Vector of Operators.

source
OpenQuantumSystems.evolution_exactMethod
evolution_exact(rho0, tspan, Hamiltonian; diagonalize = false)

Calculate exact time evolution of the rho0 inplace based on $U(t)$. The diagonalize argument decompose Hamiltonian into $\lambda_i, S, S^{-1}$ and calculate the exponential using eigenvalue decomposition. See evolution_operator. This method returns tspan and Vector of Operators.

source
OpenQuantumSystems.evolution_operator_aMethod
evolution_operator_a(H_lambda, S, Sinv, t)

Get evolution operator as Array using the definition

$U(t) = S e^{-i H_\lambda t / \hbar} S^{-1},$

where $\hbar = 1$, $H_{\lambda,ii} = \lambda_i$ are eigenvalues of $H$, so $H$ has to be non-singular, otherwise $H_{\lambda,ij} = 0, i \neq j$. $S$ is obtained from eigendecomposition of $H$, for example

H_lambda, S = eigen(Hamiltonian.data)
Sinv = inv(S)
H_lambda = diagm(H_lambda)

and arguments have to be Arrays.

source
OpenQuantumSystems.evolution_operator_iteratorFunction
evolution_operator_iterator(Hamiltonian, tspan; diagonalize = true, approximate = false)

Resumable function that returns evolution operator as Operator type at the time t from tspan. See evolution_operator. The diagonalize argument decompose Hamiltonian into $\lambda_i, S, S^{-1}$ and calculate the exponential using eigenvalue decomposition. The approximate option asusmes that tspan is made of equidistant points, therefore $U(t)$ has to be calculated for $t_0$ and $t_\text{step}$.

source
OpenQuantumSystems.evolution_super_operatorMethod
evolution_super_operator(Hamiltonian, t)

Get evolution operator as SuperOperator using the definition

$\mathcal{U}(t) \:\cdot\: = U(t) \:\cdot\: U^\dagger(t) = e^{-i H t / \hbar} \:\cdot\: e^{i H t / \hbar}, \quad \hbar = 1$.

source
OpenQuantumSystems.evolution_super_operator_arrayMethod
evolution_operator_array(Hamiltonian, tspan)

Get evolution superoperators as Vector or SuperOperators using the definition

$\mathcal{U}(t) \:\cdot\: = U(t) \:\cdot\: U^\dagger(t) = e^{-i H t / \hbar} \:\cdot\: e^{i H t / \hbar}, \quad \hbar = 1$.

source
OpenQuantumSystems.evolution_super_operator_iteratorFunction
evolution_super_operator_iterator(Hamiltonian, tspan; 
	diagonalize = true, approximate = false)

Resumable function that returns evolution operator as Operator type at the time t from tspan. See evolution_super_operator. The diagonalize argument decompose Hamiltonian into $\lambda_i, S, S^{-1}$ and calculate the exponential using eigenvalue decomposition. The approximate option asusmes that tspan is made of equidistant points, therefore $U(t)$ has to be calculated for $t_0$ and $t_\text{step}$.

source

Schrodinger Equation

OpenQuantumSystems.schroedingerMethod
schroedinger(psi0, tspan, H; 
	reltol=1.0e-12, abstol=1.0e-12, fout=nothing, alg=OrdinaryDiffEq.Tsit5())

Integrate Schroedinger equation to evolve states or compute propagators

$\frac{d}{d t}\vert\psi(t)\rangle = - \frac{i}{\hbar} \hat H\vert\psi(t)\rangle, \quad \hbar = 1$.

Arguments

  • psi0: Initial state vector (can be a bra or a ket) or initial propagator.
  • tspan: Vector specifying the points of time for which output should be displayed.
  • H: Arbitrary operator specifying the Hamiltonian.
  • reltol: Relative tolerance for OrdinaryDiffEq solver and its inner states.
  • abstol: Absolute tolerance for OrdinaryDiffEq solver and its inner states.
  • fout=nothing: If given, this function fout(t, psi) is called every time an output should be displayed. ATTENTION: The state psi is neither normalized nor permanent! It is still in use by the ode solver and therefore must not be changed.
  • alg: Algorithm with which OrdinaryDiffEq will solve Schroedinger equation.
source
OpenQuantumSystems.schroedinger_dynamicMethod
schroedinger_dynamic(psi0, tspan, f; 
	reltol=1.0e-12, abstol=1.0e-12, fout=nothing, alg=OrdinaryDiffEq.Tsit5())

Integrate time-dependent Schroedinger equation to evolve states or compute propagators

$\frac{d}{d t}\vert\psi(t)\rangle = - \frac{i}{\hbar} \hat H(t)\vert\rho(t)\rangle, \quad \hbar = 1$.

Arguments

  • psi0: Initial state vector (can be a bra or a ket) or initial propagator.
  • tspan: Vector specifying the points of time for which output should be displayed.
  • f: Function f(t, psi) -> H returning the time and or state dependent Hamiltonian.
  • reltol: Relative tolerance for OrdinaryDiffEq solver and its inner states.
  • abstol: Absolute tolerance for OrdinaryDiffEq solver and its inner states.
  • fout=nothing: If given, this function fout(t, psi) is called every time an output should be displayed. ATTENTION: The state psi is neither normalized nor permanent! It is still in use by the ode solver and therefore must not be changed.
  • alg: Algorithm with which OrdinaryDiffEq will solve Schroedinger equation.
source

Liouville-von Neumann Equation

OpenQuantumSystems.LvN_sIMethod
liouvilleVonNeumann(rho0, tspan, H; 
	reltol=1.0e-12, abstol=1.0e-12, fout=nothing, alg=OrdinaryDiffEq.Tsit5())

Integrate Liouville-von Neumann equation to evolve states or compute propagators

$\frac{d}{d t} \rho(t) = - \frac{i}{\hbar} [ \hat H, \rho(t) ], \quad \hbar = 1$.

Arguments

  • rho0: Initial state vector (can be a bra or a ket) or initial propagator.
  • tspan: Vector specifying the points of time for which output should be displayed.
  • H: Arbitrary operator specifying the Hamiltonian.
  • reltol: Relative tolerance for OrdinaryDiffEq solver and its inner states.
  • abstol: Absolute tolerance for OrdinaryDiffEq solver and its inner states.
  • fout=nothing: If given, this function fout(t, rho) is called every time an output should be displayed. ATTENTION: The state rho is neither normalized nor permanent! It is still in use by the ode solver and therefore must not be changed.
  • alg: Algorithm with which OrdinaryDiffEq will solve LvN equation.
source

Interaction Picture

Quantum Master Equation — Exact

OpenQuantumSystems.QME_SS_exactMethod
master(W0, tspan, Ham; 
	reltol=1.0e-12, abstol=1.0e-12, int_reltol=1.0e-8, int_abstol=0.0, 
	fout=nothing, alg=DelayDiffEq.MethodOfSteps(DelayDiffEq.Vern6()))

Integrate Quantum Master equation

$\frac{d}{d t} \rho(t) = - \frac{i}{\hbar} [ \hat{H}, \rho(t_0) ] -\frac{1}{\hbar^2} \int_{t_0}^{t_1} \text{d} \tau \: [ \hat{H}, [ \hat{H}, \rho(\tau) ]] ,\quad \hbar = 1.$

Arguments

  • W0: Initial state vector (can be a bra or a ket) or initial propagator.
  • tspan: Vector specifying the points of time for which output should be displayed.s
  • Ham: Arbitrary operator specifying the Hamiltonian.
  • reltol: Relative tolerance for DiffEqCallbacks solver and its inner states.
  • abstol: Absolute tolerance for DiffEqCallbacks solver and its inner states.
  • int_reltol: Relative tolerance for QuadGK solver and its inner states.
  • int_abstol: Absolute tolerance for QuadGK solver and its inner states.
  • fout=nothing: If given, this function fout(t, rho) is called every time an output should be displayed. ATTENTION: The state rho is neither normalized nor permanent! It is still in use by the ode solver and therefore must not be changed.
  • alg: Algorithm with which DiffEqCallbacks will solve QME equation.
source
OpenQuantumSystems.QME_sI_exactMethod
master_int(W0, tspan, Ham_0, Ham_I; 
	reltol=1.0e-12, abstol=1.0e-12, int_reltol=1.0e-8, int_abstol=0.0, 
	fout=nothing, alg=DelayDiffEq.MethodOfSteps(DelayDiffEq.Vern6()))

Integrate Quantum Master equation

$\frac{d}{d t} \rho^{(I)}(t) = - \frac{i}{\hbar} [ \hat{H}_I^{(I)}(t), \rho^{(I)}(t_0) ] -\frac{1}{\hbar^2} \int_{t_0}^{t_1} \text{d} \tau \: [ \hat{H}_I^{(I)}(t), [ \hat{H}_I^{(I)}(\tau), \rho^{(I)}(\tau) ]]$

$H = H_S + H_B + H_I = H_0 + H_I, \quad \hbar = 1.$

Arguments

  • W0: Initial state vector (can be a bra or a ket) or initial propagator.
  • tspan: Vector specifying the points of time for which output should be displayed.s
  • Ham_0: System and bath Hamiltonian as Operator.
  • Ham_I: Interaction Hamiltonian as Operator.
  • reltol: Relative tolerance for DiffEqCallbacks solver and its inner states.
  • abstol: Absolute tolerance for DiffEqCallbacks solver and its inner states.
  • int_reltol: Relative tolerance for QuadGK solver and its inner states.
  • int_abstol: Absolute tolerance for QuadGK solver and its inner states.
  • fout=nothing: If given, this function fout(t, rho) is called every time an output should be displayed. ATTENTION: The state rho is neither normalized nor permanent! It is still in use by the ode solver and therefore must not be changed.
  • alg: Algorithm with which DiffEqCallbacks will solve QME equation.
source

Quantum Master Equation — Ansatz

Redfield

Quantum Master Equation — Iterative

Forster Theory

OpenQuantumSystems.LineshapeResultType
LineshapeResult

Container for a normalized molecular lineshape (absorption or emission spectrum).

Fields

  • freqs: frequency grid (same units as molecule energies, typically cm⁻¹).
  • intensities: normalized spectral intensities (∫ intensities dν ≈ 1).
source
OpenQuantumSystems.absorption_spectrumMethod
absorption_spectrum(mol; T=0.0, sigma=50.0, n_points=2000)

Compute the normalized absorption spectrum of a Molecule.

Transitions from thermally-weighted ground-electronic vibronic states to all excited-electronic vibronic states, broadened by a Gaussian of width sigma.

Arguments

  • mol: Molecule instance.
  • T: temperature in Kelvin (energies assumed in cm⁻¹; uses BOLTZMANN_CM).
  • sigma: Gaussian broadening standard deviation (same units as energies; default 50 cm⁻¹).
  • n_points: frequency grid resolution (default 2000).
source
OpenQuantumSystems.emission_spectrumMethod
emission_spectrum(mol; T=0.0, sigma=50.0, n_points=2000)

Compute the normalized emission spectrum of a Molecule.

Transitions from thermally-weighted excited-electronic vibronic states (Kasha's rule) to all ground-electronic vibronic states, broadened by a Gaussian of width sigma.

Arguments

  • mol: Molecule instance.
  • T: temperature in Kelvin.
  • sigma: Gaussian broadening standard deviation (default 50 cm⁻¹).
  • n_points: frequency grid resolution (default 2000).
source
OpenQuantumSystems.forster_rateMethod
forster_rate(J, mol_donor, mol_acceptor; T=0.0, sigma=50.0, n_points=2000)

Compute the Förster excitation energy transfer rate:

$k_{DA} = 2\pi |J_{DA}|^2 \int I_D(\omega) A_A(\omega)\, d\omega$

Arguments

  • J: electronic coupling (cm⁻¹).
  • mol_donor: donor Molecule.
  • mol_acceptor: acceptor Molecule.
  • T: temperature in Kelvin (default 0).
  • sigma: Gaussian broadening width in cm⁻¹ (default 50).
  • n_points: frequency grid resolution (default 2000).

Returns

Rate in cm⁻¹. To convert to 1/fs: multiply by 2π × c where c = 3×10⁻⁵ cm/fs.

source
OpenQuantumSystems.forster_rate_matrixMethod
forster_rate_matrix(aggCore; T=0.0, sigma=50.0, n_points=2000)

Compute the matrix of pairwise Förster excitation energy transfer rates for all molecules in an AggregateCore.

Returns an N×N matrix where entry (i,j) is the Förster rate from molecule i to molecule j. Diagonal entries are zero.

The electronic coupling $J_{ij}$ is read from aggCore.coupling[i+1, j+1] (the +1 offset accounts for the ground state row/column in the padded coupling matrix).

Arguments

  • aggCore: AggregateCore instance.
  • T: temperature in Kelvin (default 0).
  • sigma: Gaussian broadening width in cm⁻¹ (default 50).
  • n_points: frequency grid resolution (default 2000).
source
OpenQuantumSystems.spectral_overlapMethod
spectral_overlap(donor_emission, acceptor_absorption)

Compute the spectral overlap integral:

$J = \int I_D(\omega) A_A(\omega)\, d\omega$

Both spectra must be normalized (∫ dν = 1). Returns the overlap in units of 1/[frequency], where frequency is in the same units as the molecule energies.

Uses linear interpolation onto the donor emission frequency grid.

source

Spectral Density

OpenQuantumSystems.SpectralDensityType
SpectralDensity(frequencies, huang_rhys)

Discrete spectral density defined by a set of vibrational mode frequencies and their Huang-Rhys factors. Used to compute lineshape functions for Förster and modified Redfield theories.

Fields

  • frequencies: mode frequencies (cm⁻¹).
  • huang_rhys: Huang-Rhys factors $S_\alpha$ for each mode.
source
OpenQuantumSystems.lineshape_derivativeMethod
lineshape_derivative(sd, t, T)

Compute the first derivative $\dot{g}(t)$ of the lineshape function.

$\dot{g}(t) = \sum_\alpha S_\alpha \omega_\alpha \left[(2\bar{n}_\alpha + 1)\sin\omega_\alpha t + i(\cos\omega_\alpha t - 1)\right]$

source
OpenQuantumSystems.lineshape_functionMethod
lineshape_function(sd, t, T)

Compute the lineshape function $g(t)$ for a discrete spectral density at temperature T (Kelvin):

$g(t) = \sum_\alpha S_\alpha \left[(2\bar{n}_\alpha + 1)(1 - \cos\omega_\alpha t) + i(\sin\omega_\alpha t - \omega_\alpha t)\right]$

Returns a complex number.

source
OpenQuantumSystems.lineshape_second_derivativeMethod
lineshape_second_derivative(sd, t, T)

Compute the second derivative $\ddot{g}(t)$ of the lineshape function.

$\ddot{g}(t) = \sum_\alpha S_\alpha \omega_\alpha^2 \left[(2\bar{n}_\alpha + 1)\cos\omega_\alpha t - i\sin\omega_\alpha t\right]$

source

Modified Redfield Theory

OpenQuantumSystems.exciton_basisFunction
exciton_basis(aggCore, aggTools)

Diagonalize the system Hamiltonian (excited-state block) to obtain exciton energies and transformation coefficients.

Returns (energies, coefficients) where:

  • energies: N-element vector of exciton energies (cm⁻¹).
  • coefficients: N×N matrix where coefficients[m, k] is the contribution of site k to exciton state m.
source
OpenQuantumSystems.modified_redfield_ratesFunction
modified_redfield_rates(aggCore; T=300.0, t_max=1000.0, gamma=0.0, rtol=1e-6, atol=1e-8)

Compute the modified Redfield population transfer rate matrix in the exciton basis.

Returns (rates, energies, coefficients) where:

  • rates: N×N rate matrix. rates[m, n] is the rate from exciton n to exciton m. Diagonal elements are set so that columns sum to zero (population conservation).
  • energies: exciton energies.
  • coefficients: exciton transformation coefficients.

The rate from exciton state n to exciton state m is:

$R_{mn} = 2 \operatorname{Re} \int_0^\infty dt\, \left[\ddot{g}_{mn}(t) + \left(\dot{g}_{mm}(t) - \dot{g}_{nn}(t)\right) \dot{g}_{mn}(t)\right] e^{+i\varepsilon_{mn}t - f_{mn}(t) - \gamma t}$

where $f_{mn}(t) = g_{mm}(t) + g_{nn}(t) - 2g_{mn}(t)$ and $\varepsilon_{mn} = \varepsilon_m - \varepsilon_n$.

Arguments

  • aggCore: AggregateCore instance.
  • T: temperature in Kelvin (default 300).
  • t_max: upper integration limit (default 1000, increase for slow dynamics).
  • gamma: phenomenological damping rate for convergence (default 0, set > 0 for weakly damped systems).
  • rtol, atol: tolerances for numerical integration.
source
OpenQuantumSystems.modified_redfield_dynamicsFunction
modified_redfield_dynamics(aggCore, rho0_exciton, tspan; T=300.0, t_max=1000.0, gamma=0.0)

Propagate exciton populations using modified Redfield rates.

Arguments

  • aggCore: AggregateCore instance.
  • rho0_exciton: initial population vector in the exciton basis (N-element vector).
  • tspan: time points for output.
  • T: temperature in Kelvin.
  • t_max: integration limit for rate calculation.
  • gamma: phenomenological damping for rate convergence.

Returns (tspan, populations) where populations is a Matrix{Float64} of size (length(tspan), N).

source

Dipole Couplings

OpenQuantumSystems.TransitionDipoleType
TransitionDipole(position, dipole)

Stores the 3D position and transition dipole vector of a molecule, used to compute point-dipole couplings between molecules in an aggregate.

Arguments

  • position: 3-element vector giving the molecular position in Å.
  • dipole: 3-element transition dipole vector in Debye (magnitude encoded in norm).
source
OpenQuantumSystems.dipole_dipole_couplingMethod
dipole_dipole_coupling(td1, td2)

Compute the point-dipole coupling (in cm⁻¹) between two transition dipoles.

Uses the formula:

J = DIPOLE_COUPLING_FACTOR × (μ₁·μ₂ - 3(μ₁·R̂)(μ₂·R̂)) / R³

where R is the inter-molecular distance in Å, μ in Debye, and the prefactor converts D²/ų to cm⁻¹.

Arguments

source

Trace

OpenQuantumSystems.adMethod
ad(rho, rho_bath, agg, FCProd, aggIndices, vibindices)

This is the inverse operation to the trace over bath trace_bath and get_rho_bath defined as follows

$\rho = \operatorname{ad}\{\rho_\text{tr}, \rho_\text{bath} \}$

source
OpenQuantumSystems.correlation_functionMethod
correlation_function(t, rho0_bath, Ham_0, Ham_I, agg, FCProd, aggInds, vibindices)

Get time dependent correlation function for a specified time t using following definition

$C(t) = \operatorname{tr}_B \{ \hat{H}_I^{(I)}(t) \hat{H}_I \rho_\text{bath}(0) \}$

source
OpenQuantumSystems.get_rho_bathMethod
get_rho_bath(rho, agg, FCProd, aggIndices, vibindices; justCopy=false)

This method will return the bath part of rho knowing the result of trace_bath defined as follows

$\rho_\text{bath} = \operatorname{tr}_S \{\rho\}$

$\rho_{\text{bath}, ab} = \rho_{ab} / \langle a \vert \operatorname{tr}_B \{ \rho \}\vert b \rangle$

source
OpenQuantumSystems.trace_bathMethod
trace_bath(rho, a, b, agg, FCProd, aggIndices, vibindices)

Trace out bath degrees of freedom from rho without the product of Franck-Condon factors. The trace will be done only on the Hilber space for electric bra part a and ket part b. Input density matrix rho is for the whole Hilber space. This method returns number.

source
OpenQuantumSystems.trace_bath_ground_excitedMethod
trace_bath(rho, agg, FCProd, aggIndices, vibindices)

Trace out bath degrees of freedom from rho

$\rho_\text{tr} = \operatorname{tr}_B \{\rho\} = \sum_{k} \langle k \vert \left( \sum_{ab} \rho_{am, bn} \vert am \rangle \langle bn \vert \right)\vert k \rangle$

source
OpenQuantumSystems.trace_bath_partMethod
trace_bath_part(rho, a, b, agg, FCProd, aggIndices, vibindices)

Trace out bath degrees of freedom from rho without the product of Franck-Condon factors. The trace will be done only on the Hilber space for electric bra part a and ket part b. Input density matrix rho is only for the subspace. This method returns number.

source

Initial State

OpenQuantumSystems.thermal_stateMethod
thermal_state(T, mu_array, Ham, aggIndices; 
	boltzmann_const = 0.69503476, diagonalize = false, diagonal = false)

Get initial state as thermal state excited with ultra-fast laser pulse. In this version we suppose that after the thermal state is excited with laser pulse, the whole population of ground state is distributed over electric states in mu_array. We assume Condon approximation.

$\rho_\text{thermal} = \exp( -\frac{i}{\hbar} H ), \quad \hbar = 1$`.

Arguments

  • T: Temperature of the initial thermal state.
  • mu_array: Vector of electric states in local basis, see electronic_indices. The first index is for ground state of the aggregate the rest are first excited states in local basis.
  • Ham: Arbitrary operator specifying the Hamiltonian.
  • aggIndices: Aggregate indices, see get_indices.
  • boltzmann_const: Boltzmann const in $\mathrm{cm^{-1}}$.
  • diagonalize: Decompose Hamiltonian into $\lambda_i, S, S^{-1}$ and calculate the exponential using eigenvalue decomposition.
  • diagonal: Return only the diagonal part of the excited density matrix.
source
OpenQuantumSystems.thermal_state_compositeMethod
thermal_state_composite(T, mu_weighted, Ham, aggIndices; 
	boltzmann_const::Float64 = 0.69503476, diagonalize::Bool=false, diagonal=false)

Functionality of this method is similar to thermal_state, but the final state is constructed from partial thermal_states with weight specified in mu_weighted. For example

julia thermal_state_composite(T, [0.0, 0.8, 0.2], ...) = 0.8 * thermal_state(T, [1, 2, 1], ...) + 0.2 * thermal_state(T, [1, 1, 2], ...)`

$\rho_\text{thermal} = \exp( -\frac{i}{\hbar} H ), \quad \hbar = 1$.

Arguments

  • T: Temperature of the initial thermal state.
  • mu_weighted: Vector of weights of electric states in local basis, see electronic_indices.
  • Ham: Arbitrary operator specifying the Hamiltonian.
  • aggIndices: Aggregate indices, see get_indices.
  • boltzmann_const: Boltzmann const in $\mathrm{cm^{-1}}$.
  • diagonalize: Decompose Hamiltonian into $\lambda_i, S, S^{-1}$ and calculate the exponential using eigenvalue decomposition.
  • diagonal: Return only the diagonal part of the excited density matrix.
source

Memory Kernel

OpenQuantumSystems.MemoryKernel_1_tracedMethod
MemoryKernel_1_traced(H_II_t, H_II_tau, W_bath, agg, FCProd, aggIndices, indicesMap)

Calculate the first part of Memory Kernel with the definition

$\mathcal{M}_1(t, \tau) = \operatorname{tr}_B \{ \hat{H}_I^{(I)}(t) \hat{H}_I^{(I)}(\tau) W_\text{bath} \}$.

Arguments

  • H_II_t: Interaction Hamiltonian in interaction picutre at the time t, $\hat{H}_I^{(I)}(t)$.
  • H_II_tau: Interaction Hamiltonian in interaction picutre at the time tau, $\hat{H}_I^{(I)}(\tau)$.
  • W_bath: Density matrix representing bath part of the density matrix, see get_rho_bath.
  • agg: Aggregate of molecules, see Aggregate.
  • aggIndices: Aggregate indices, see get_indices.
  • indicesMap: Aggregate vibrational indices, see get_indices_map.
source
OpenQuantumSystems.MemoryKernel_2_tracedMethod
MemoryKernel_2_traced(H_II_t, H_II_tau, W_bath, agg, FCProd, aggIndices, indicesMap)

Calculate the second part of Memory Kernel with the definition

$\mathcal{M}_2(t, \tau) = \operatorname{tr}_B \{ \hat{H}_I^{(I)}(t) W_\text{bath} \hat{H}_I^{(I)}(\tau) \}$.

Arguments

  • H_II_t: Interaction Hamiltonian in interaction picutre at the time t, $\hat{H}_I^{(I)}(t)$.
  • H_II_tau: Interaction Hamiltonian in interaction picutre at the time tau, $\hat{H}_I^{(I)}(\tau)$.
  • W_bath: Density matrix representing bath part of the density matrix, see get_rho_bath.
  • agg: Aggregate of molecules, see Aggregate.
  • aggIndices: Aggregate indices, see get_indices.
  • indicesMap: Aggregate vibrational indices, see get_indices_map.
source
OpenQuantumSystems.MemoryKernel_3_tracedMethod
MemoryKernel_3_traced(H_II_t, H_II_tau, W_bath, agg, FCProd, aggIndices, indicesMap)

Calculate the third part of Memory Kernel with the definition

$\mathcal{M}_3(t, \tau) = \operatorname{tr}_B \{ \hat{H}_I^{(I)}(\tau) W_\text{bath} \hat{H}_I^{(I)}(t) \}$.

Arguments

  • H_II_t: Interaction Hamiltonian in interaction picutre at the time t, $\hat{H}_I^{(I)}(t)$.
  • H_II_tau: Interaction Hamiltonian in interaction picutre at the time tau, $\hat{H}_I^{(I)}(\tau)$.
  • W_bath: Density matrix representing bath part of the density matrix, see get_rho_bath.
  • agg: Aggregate of molecules, see Aggregate.
  • aggIndices: Aggregate indices, see get_indices.
  • indicesMap: Aggregate vibrational indices, see get_indices_map.
source
OpenQuantumSystems.MemoryKernel_4_tracedMethod
MemoryKernel_4_traced(H_II_t, H_II_tau, W_bath, agg, FCProd, aggIndices, indicesMap)

Calculate the fourth part of Memory Kernel with the definition

$\mathcal{M}_4(t, \tau) = \operatorname{tr}_B \{ W_\text{bath} \hat{H}_I^{(I)}(\tau) \hat{H}_I^{(I)}(t) \}$.

Arguments

  • H_II_t: Interaction Hamiltonian in interaction picutre at the time t, $\hat{H}_I^{(I)}(t)$.
  • H_II_tau: Interaction Hamiltonian in interaction picutre at the time tau, $\hat{H}_I^{(I)}(\tau)$.
  • W_bath: Density matrix representing bath part of the density matrix, see get_rho_bath.
  • agg: Aggregate of molecules, see Aggregate.
  • aggIndices: Aggregate indices, see get_indices.
  • indicesMap: Aggregate vibrational indices, see get_indices_map.
source
OpenQuantumSystems.MemoryKernel_tracedMethod
MemoryKernel_traced(H_II_t, H_II_tau, W_bath, agg, FCProd, aggIndices, indicesMap)

Calculate Memory Kernel with the definition

$\mathcal{M}(t, \tau) = \operatorname{tr}_B \{ [ \hat{H}_I^{(I)}(t), [ \hat{H}_I^{(I)}(\tau), W_\text{bath} ]]\}$.

Arguments

  • H_II_t: Interaction Hamiltonian in interaction picutre at the time t, $\hat{H}_I^{(I)}(t)$.
  • H_II_tau: Interaction Hamiltonian in interaction picutre at the time tau, $\hat{H}_I^{(I)}(\tau)$.
  • W_bath: Density matrix representing bath part of the density matrix, see get_rho_bath.
  • agg: Aggregate of molecules, see Aggregate.
  • aggIndices: Aggregate indices, see get_indices.
  • indicesMap: Aggregate vibrational indices, see get_indices_map.
source

Rate Constants

Post-processing

OpenQuantumSystems.validate_stateMethod
validate_state(rho; tol=1e-6) -> Bool

Check a density matrix (Operator) for physical validity. Warns (does not error) if trace deviates from 1 or if Inf/NaN values are found. Returns true if valid, false otherwise.

source
OpenQuantumSystems.validate_trajectoryMethod
validate_trajectory(rho_t; tol=1e-6) -> Bool

Check a vector of density matrices for physical validity. Applies validate_state to each element. Returns true if all valid, false otherwise.

source

Scoring

Simulation Result

OpenQuantumSystems.SimulationResultType
SimulationResult

Wrapper around solver output that provides a uniform interface regardless of which solver was used.

Fields

  • tspan::Vector{Float64} — time points at which states were recorded.
  • states::Vector{<:Operator} — density matrices at each time point.
  • method::Symbol — solver method that produced this result.
  • extra::Dict{Symbol,Any} — optional extra data (e.g. :W_1_bath_t).
source
OpenQuantumSystems.populationsMethod
populations(r::SimulationResult) -> Matrix{Float64}

Return a length(r) x dim real matrix whose (t, k) entry is the k-th diagonal element of the density matrix at time step t.

source

Unified Solver

OpenQuantumSystems.solveMethod
solve(W0, tspan, agg; method=:qme_exact_si, kwargs...)

Unified entry point for all solvers in OpenQuantumSystems.

Dispatches to the appropriate solver function based on method:

methodSolver functionNotes
:lvn_siLvN_sILiouville–von Neumann, small, interaction
:lvn_ssLvN_sSLiouville–von Neumann, small, Schrödinger
:lvn_SILvN_SILiouville–von Neumann, big, interaction
:lvn_SSLvN_SSLiouville–von Neumann, big, Schrödinger
:qme_exact_siQME_sI_exactQME exact, small, interaction
:qme_exact_ssQME_sS_exactQME exact, small, Schrödinger
:qme_exact_SIQME_SI_exactQME exact, big, interaction
:qme_exact_SSQME_SS_exactQME exact, big, Schrödinger
:qme_redfieldQME_sI_RedfieldRedfield QME
:qme_ansatzQME_sI_ansatzAnsatz QME (pass ansatz=:test etc.)
:qme_iterativeQME_sI_iterativeIterative QME (requires extra positional args via iterative_args)

All keyword arguments except method and iterative_args are forwarded to the underlying solver.

For :qme_iterative, pass the required positional arguments (rho_0_int_t, W_0_bath_t) as a tuple via the iterative_args keyword:

solve(W0, tspan, agg; method=:qme_iterative,
      iterative_args=(rho_0_int_t, W_0_bath_t))
source

Dense Operators

OpenQuantumSystems.ShiftOperatorType
ShiftOperator{BL,BR}(basis_l, basis_r, shift)

Dense shift operator as a mutable struct using the definition

$D(\alpha) = \exp(\alpha a^\dagger - \alpha^* a)$.

Arguments

  • basis_l: Bra basis.
  • basis_r: Ket basis.
  • shift: Shift or $\alpha$ parameter, can be complex number.
source

Superoperators

OpenQuantumSystems.CommutatorMethod
Commutator(A)

Create commutator in a form of superoperator from a given operator.

$\text{Commutator}(A) \:\cdot\: = [A, \:\cdot\:]$

source

Metrics

QuantumOpticsBase.tracedistance_hMethod
tracedistance_h(rho, sigma)

Trace distance between rho and sigma. It uses the identity

\[T(ρ,σ) = \frac{1}{2} \operatorname{tr}\{\sqrt{(ρ - σ)^† (ρ - σ)}\} = \frac{1}{2} \sum_i |λ_i|\]

where $λ_i$ are the eigenvalues of rho - sigma.

source
QuantumOpticsBase.tracedistance_nhMethod
tracedistance_nh(rho, sigma)

Trace distance between rho and sigma. Note that in this case rho and sigma don't have to be represented by square matrices (i.e. they can have different left-hand and right-hand bases). It uses the identity

\[ T(ρ,σ) = \frac{1}{2} \operatorname{tr}\{\sqrt{(ρ - σ)^† (ρ - σ)}\} = \frac{1}{2} \sum_i σ_i\]

where $σ_i$ are the singular values of rho - sigma.

source
QuantumOpticsBase.tracenorm_hMethod
tracenorm_h(rho)

Trace norm of rho. It uses the identity

\[T(ρ) = \operatorname{tr}\{\sqrt{ρ^† ρ}\} = \sum_i |λ_i|\]

where $λ_i$ are the eigenvalues of rho.

source
QuantumOpticsBase.tracenorm_nhMethod
tracenorm_nh(rho)

Trace norm of rho. Note that in this case rho doesn't have to be represented by a square matrix (i.e. it can have different left-hand and right-hand bases). It uses the identity

\[ T(ρ) = \operatorname{tr}\{\sqrt{ρ^† ρ}\} = \sum_i σ_i\]

where $σ_i$ are the singular values of rho.

source

Time-evolution Base

OpenQuantumSystems.integrateMethod
integrate(tspan, df::Function, x0::Vector{ComplexF64},
        state::T, dstate::T, fout::Function; kwargs...)

Integrate using OrdinaryDiffEq

source