diff --git a/dev/api/index.html b/dev/api/index.html index 6785babf..ad2e2ef6 100644 --- a/dev/api/index.html +++ b/dev/api/index.html @@ -1,5 +1,5 @@ -API · QuPhys.jl

API

Quantum object functions

QuPhys.QuantumObjectType
mutable struct QuantumObject{MT<:AbstractArray,ObjType<:QuantumObjectType}
+API · QuPhys.jl

API

Quantum object functions

QuPhys.QuantumObjectType
mutable struct QuantumObject{MT<:AbstractArray,ObjType<:QuantumObjectType}
     data::MT
     type::Type{ObjType}
     dims::Vector{Int}
@@ -13,7 +13,7 @@
 ⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢
 
 julia> a isa QuantumObject
-true
source
QuPhys.ket2dmFunction
ket2dm(ψ::QuantumObject)

Transform the ket state $\ket{\psi}$ into a pure density matrix $\hat{\rho} = \dyad{\psi}$.

source
LinearAlgebra.trFunction
tr(A::QuantumObject})

Returns the trace of A.

Examples

julia> a = destroy(20)
+true
source
QuPhys.ket2dmFunction
ket2dm(ψ::QuantumObject)

Transform the ket state $\ket{\psi}$ into a pure density matrix $\hat{\rho} = \dyad{\psi}$.

source
LinearAlgebra.trFunction
tr(A::QuantumObject})

Returns the trace of A.

Examples

julia> a = destroy(20)
 Quantum Object:   type=Operator   dims=[20]   size=(20, 20)   ishermitian=false
 20×20 SparseMatrixCSC{ComplexF64, Int64} with 19 stored entries:
 ⠈⠢⡀⠀⠀⠀⠀⠀⠀⠀
@@ -23,7 +23,7 @@
 ⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢
 
 julia> tr(a' * a)
-190.0 + 0.0im
source
LinearAlgebra.normFunction
norm(A::QuantumObject)

Returns the norm of A.

Examples

julia> ψ = fock(10, 2)
+190.0 + 0.0im
source
LinearAlgebra.normFunction
norm(A::QuantumObject)

Returns the norm of A.

Examples

julia> ψ = fock(10, 2)
 Quantum Object:   type=Ket   dims=[10]   size=(10,)
 10-element Vector{ComplexF64}:
  0.0 + 0.0im
@@ -38,7 +38,7 @@
  0.0 + 0.0im
 
 julia> norm(ψ)
-1.0
source
Base.kronFunction
kron(A::QuantumObject, B::QuantumObject)

Returns the Kronecker product $\hat{A} \otimes \hat{B}$.

Examples

julia> a = destroy(20)
 Quantum Object:   type=Operator   dims=[20]   size=(20, 20)   ishermitian=false
 20×20 SparseMatrixCSC{ComplexF64, Int64} with 19 stored entries:
 ⠈⠢⡀⠀⠀⠀⠀⠀⠀⠀
@@ -70,7 +70,7 @@
 ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢦⡀⠀⠀⠀⠀⠀
 ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢦⡀⠀⠀⠀
 ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢦⡀⠀
-⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠦
source

General functions

QuPhys.tidyupFunction
tidyup(A::QuantumObject, tol::Real=1e-14)

Removes those elements of a QuantumObject A whose absolute value is less than tol.

source
QuPhys.tidyup!Function
tidyup!(A::QuantumObject, tol::Real=1e-14)

Removes those elements of a QuantumObject A whose absolute value is less than tol. In-place version of tidyup.

source
QuPhys.gaussianFunction
gaussian(x::Number, μ::Number, σ::Number)

Returns the gaussian function $\exp \left[- \frac{(x - \mu)^2}{2 \sigma^2} \right]$, where $\mu$ and $\sigma^2$ are the mean and the variance respectively.

source
QuPhys.ptraceFunction
ptrace(QO::QuantumObject, sel::Vector{Int})

Partial trace of a quantum state QO leaving only the dimensions with the indices present in the sel vector.

Examples

Two qubits in the state $\ket{\psi} = \ket{e,g}$:

julia> ψ = kron(fock(2,0), fock(2,1))
+⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠦
source

General functions

QuPhys.tidyupFunction
tidyup(A::QuantumObject, tol::Real=1e-14)

Removes those elements of a QuantumObject A whose absolute value is less than tol.

source
QuPhys.tidyup!Function
tidyup!(A::QuantumObject, tol::Real=1e-14)

Removes those elements of a QuantumObject A whose absolute value is less than tol. In-place version of tidyup.

source
QuPhys.gaussianFunction
gaussian(x::Number, μ::Number, σ::Number)

Returns the gaussian function $\exp \left[- \frac{(x - \mu)^2}{2 \sigma^2} \right]$, where $\mu$ and $\sigma^2$ are the mean and the variance respectively.

source
QuPhys.ptraceFunction
ptrace(QO::QuantumObject, sel::Vector{Int})

Partial trace of a quantum state QO leaving only the dimensions with the indices present in the sel vector.

Examples

Two qubits in the state $\ket{\psi} = \ket{e,g}$:

julia> ψ = kron(fock(2,0), fock(2,1))
 Quantum Object:   type=Ket   dims=[2, 2]   size=(4,)
 4-element Vector{ComplexF64}:
  0.0 + 0.0im
@@ -94,7 +94,7 @@
 Quantum Object:   type=Operator   dims=[2]   size=(2, 2)   ishermitian=true
 2×2 Matrix{ComplexF64}:
  0.5+0.0im  0.0+0.0im
- 0.0+0.0im  0.5+0.0im
source
QuPhys.entropy_vnFunction
entropy_vn(ρ::QuantumObject; base::Int=0, tol::Real=1e-15)

Calculates the Von Neumann entropy $S = - \Tr \left[ \hat{\rho} \log \left( \hat{\rho} \right) \right]$ where $\hat{\rho}$ is the density matrix of the system.

The base parameter specifies the base of the logarithm to use, and when using the default value 0, the natural logarithm is used. The tol parameter describes the absolute tolerance for detecting the zero-valued eigenvalues of the density matrix $\hat{\rho}$.

Examples

Pure state:

julia> ψ = fock(2,0)
+ 0.0+0.0im  0.5+0.0im
source
QuPhys.entropy_vnFunction
entropy_vn(ρ::QuantumObject; base::Int=0, tol::Real=1e-15)

Calculates the Von Neumann entropy $S = - \Tr \left[ \hat{\rho} \log \left( \hat{\rho} \right) \right]$ where $\hat{\rho}$ is the density matrix of the system.

The base parameter specifies the base of the logarithm to use, and when using the default value 0, the natural logarithm is used. The tol parameter describes the absolute tolerance for detecting the zero-valued eigenvalues of the density matrix $\hat{\rho}$.

Examples

Pure state:

julia> ψ = fock(2,0)
 Quantum Object:   type=Ket   dims=[2]   size=(2,)
 2-element Vector{ComplexF64}:
  1.0 + 0.0im
@@ -114,13 +114,13 @@
  0.0+0.0im  0.5+0.0im
 
 julia> entropy_vn(ρ, base=2)
-1.0
source
QuPhys.entanglementFunction
entanglement(QO::QuantumObject, sel::Vector)

Calculates the entanglement by doing the partial trace of QO, selecting only the dimensions with the indices contained in the sel vector, and then using the Von Neumann entropy entropy_vn.

source
QuPhys.expectFunction
expect(O::QuantumObject, ψ::QuantumObject)

Expectation value of the operator O with the state ψ. The latter can be a KetQuantumObject, BraQuantumObject or a OperatorQuantumObject. If ψ is a density matrix, the function calculates $\Tr \left[ \hat{O} \hat{\psi} \right]$, while if ψ is a state, the function calculates $\mel{\psi}{\hat{O}}{\psi}$.

The function returns a real number if the operator is hermitian, and returns a complex number otherwise.

Examples

julia> ψ = 1 / √2 * (fock(10,2) + fock(10,4));
+1.0
source
QuPhys.entanglementFunction
entanglement(QO::QuantumObject, sel::Vector)

Calculates the entanglement by doing the partial trace of QO, selecting only the dimensions with the indices contained in the sel vector, and then using the Von Neumann entropy entropy_vn.

source
QuPhys.expectFunction
expect(O::QuantumObject, ψ::QuantumObject)

Expectation value of the operator O with the state ψ. The latter can be a KetQuantumObject, BraQuantumObject or a OperatorQuantumObject. If ψ is a density matrix, the function calculates $\Tr \left[ \hat{O} \hat{\psi} \right]$, while if ψ is a state, the function calculates $\mel{\psi}{\hat{O}}{\psi}$.

The function returns a real number if the operator is hermitian, and returns a complex number otherwise.

Examples

julia> ψ = 1 / √2 * (fock(10,2) + fock(10,4));
 
 julia> a = destroy(10);
 
 julia> expect(a' * a, ψ) ≈ 3
-true
source
QuPhys.wignerFunction
wigner(state::QuantumObject, xvec::AbstractVector, yvec::AbstractVector; g::Real=√2,
-    solver::WignerSolver=WignerLaguerre())

Generates the Wigner quasipropability distribution of state at points xvec + 1im * yvec. The g parameter is a scaling factor related to the value of $\hbar$ in the commutation relation $[x, y] = i \hbar$ via $\hbar=2/g^2$ giving the default value $\hbar=1$.

The solver parameter can be either WignerLaguerre() or WignerClenshaw(). The former uses the Laguerre polynomial expansion of the Wigner function, while the latter uses the Clenshaw algorithm. The Laguerre expansion is faster for sparse matrices, while the Clenshaw algorithm is faster for dense matrices. The WignerLaguerre solver has an optional parallel parameter which defaults to true and uses multithreading to speed up the calculation.

source
QuPhys.get_coherenceFunction
get_coherence(ψ::QuantumObject)

Get the coherence value $\alpha$ by measuring the expectation value of the destruction operator $\hat{a}$ on the state $\ket{\psi}$.

It returns both $\alpha$ and the state $\ket{\delta_\psi} = \exp ( \bar{\alpha} \hat{a} - \alpha \hat{a}^\dagger )$. The latter corresponds to the quantum fulctuations around the coherent state $\ket{\alpha}$.

source
QuPhys.n_thFunction
n_th(ω::Number, T::Real)

Gives the mean number of excitations in a mode with frequency ω at temperature T: $n_{\rm th} (\omega, T) = \frac{1}{e^{\omega/T} - 1}$

source

Quantum states, operators and super-operators

QuPhys.spreFunction
spre(O::QuantumObject)

Returns the super-operator form of O acting on the left of the density matrix operator, $\mathcal{O} \left(\hat{O}\right) \left[ \hat{\rho} \right] = \hat{O} \hat{\rho}$.

Since the density matrix is vectorized, this super-operator is always a matrix, obtained from $\mathcal{O} \left(\hat{O}\right) \boldsymbol{\cdot} = \hat{\mathbb{1}} \otimes \hat{O}$.

source
QuPhys.spostFunction
spost(O::QuantumObject)

Returns the super-operator form of O acting on the right of the density matrix operator, $\mathcal{O} \left(\hat{O}\right) \left[ \hat{\rho} \right] = \hat{\rho} \hat{O}$.

Since the density matrix is vectorized, this super-operator is always a matrix, obtained from $\mathcal{O} \left(\hat{O}\right) \boldsymbol{\cdot} = \hat{O}^T \otimes \hat{\mathbb{1}}$.

source
QuPhys.sprepostFunction
sprepost(A::QuantumObject, B::QuantumObject)

Returns the super-operator form of A and B acting on the left and the right of the density matrix operator respectively, $\mathcal{O} \left( \hat{A}, \hat{B} \right) \left[ \hat{\rho} \right] = \hat{A} \hat{\rho} \hat{B}$.

Since the density matrix is vectorized, this super-operator is always a matrix, obtained from $\mathcal{O} \left(\hat{A}, \hat{B}\right) \boldsymbol{\cdot} = \text{spre}(A) * \text{spost}(B)$.

source
QuPhys.lindblad_dissipatorFunction
lindblad_dissipator(O::QuantumObject)

Returns the Lindblad super-operator defined as $\mathcal{D} \left( \hat{O} \right) \left[ \hat{\rho} \right] = \frac{1}{2} \left( 2 \hat{O} \hat{\rho} \hat{O}^\dagger - \hat{O}^\dagger \hat{O} \hat{\rho} - \hat{\rho} \hat{O}^\dagger \hat{O} \right)$ considering the density matrix $\hat{\rho}$ in the vectorized form.

source
QuPhys.destroyFunction
destroy(N::Int)

Bosonic annihilation operator with Hilbert space cutoff N. This operator acts on a fock state as $\hat{a} \ket{n} = \sqrt{n} \ket{n-1}$.

Examples

julia> a = destroy(20)
+true
source
QuPhys.wignerFunction
wigner(state::QuantumObject, xvec::AbstractVector, yvec::AbstractVector; g::Real=√2,
+    solver::WignerSolver=WignerLaguerre())

Generates the Wigner quasipropability distribution of state at points xvec + 1im * yvec. The g parameter is a scaling factor related to the value of $\hbar$ in the commutation relation $[x, y] = i \hbar$ via $\hbar=2/g^2$ giving the default value $\hbar=1$.

The solver parameter can be either WignerLaguerre() or WignerClenshaw(). The former uses the Laguerre polynomial expansion of the Wigner function, while the latter uses the Clenshaw algorithm. The Laguerre expansion is faster for sparse matrices, while the Clenshaw algorithm is faster for dense matrices. The WignerLaguerre solver has an optional parallel parameter which defaults to true and uses multithreading to speed up the calculation.

source
QuPhys.get_coherenceFunction
get_coherence(ψ::QuantumObject)

Get the coherence value $\alpha$ by measuring the expectation value of the destruction operator $\hat{a}$ on the state $\ket{\psi}$.

It returns both $\alpha$ and the state $\ket{\delta_\psi} = \exp ( \bar{\alpha} \hat{a} - \alpha \hat{a}^\dagger )$. The latter corresponds to the quantum fulctuations around the coherent state $\ket{\alpha}$.

source
QuPhys.n_thFunction
n_th(ω::Number, T::Real)

Gives the mean number of excitations in a mode with frequency ω at temperature T: $n_{\rm th} (\omega, T) = \frac{1}{e^{\omega/T} - 1}$

source

Quantum states, operators and super-operators

QuPhys.spreFunction
spre(O::QuantumObject)

Returns the super-operator form of O acting on the left of the density matrix operator, $\mathcal{O} \left(\hat{O}\right) \left[ \hat{\rho} \right] = \hat{O} \hat{\rho}$.

Since the density matrix is vectorized, this super-operator is always a matrix, obtained from $\mathcal{O} \left(\hat{O}\right) \boldsymbol{\cdot} = \hat{\mathbb{1}} \otimes \hat{O}$.

source
QuPhys.spostFunction
spost(O::QuantumObject)

Returns the super-operator form of O acting on the right of the density matrix operator, $\mathcal{O} \left(\hat{O}\right) \left[ \hat{\rho} \right] = \hat{\rho} \hat{O}$.

Since the density matrix is vectorized, this super-operator is always a matrix, obtained from $\mathcal{O} \left(\hat{O}\right) \boldsymbol{\cdot} = \hat{O}^T \otimes \hat{\mathbb{1}}$.

source
QuPhys.sprepostFunction
sprepost(A::QuantumObject, B::QuantumObject)

Returns the super-operator form of A and B acting on the left and the right of the density matrix operator respectively, $\mathcal{O} \left( \hat{A}, \hat{B} \right) \left[ \hat{\rho} \right] = \hat{A} \hat{\rho} \hat{B}$.

Since the density matrix is vectorized, this super-operator is always a matrix, obtained from $\mathcal{O} \left(\hat{A}, \hat{B}\right) \boldsymbol{\cdot} = \text{spre}(A) * \text{spost}(B)$.

source
QuPhys.lindblad_dissipatorFunction
lindblad_dissipator(O::QuantumObject)

Returns the Lindblad super-operator defined as $\mathcal{D} \left( \hat{O} \right) \left[ \hat{\rho} \right] = \frac{1}{2} \left( 2 \hat{O} \hat{\rho} \hat{O}^\dagger - \hat{O}^\dagger \hat{O} \hat{\rho} - \hat{\rho} \hat{O}^\dagger \hat{O} \right)$ considering the density matrix $\hat{\rho}$ in the vectorized form.

source
QuPhys.destroyFunction
destroy(N::Int)

Bosonic annihilation operator with Hilbert space cutoff N. This operator acts on a fock state as $\hat{a} \ket{n} = \sqrt{n} \ket{n-1}$.

Examples

julia> a = destroy(20)
 Quantum Object:   type=Operator   dims=[20]   size=(20, 20)   ishermitian=false
 20×20 SparseMatrixCSC{ComplexF64, Int64} with 19 stored entries:
 ⠈⠢⡀⠀⠀⠀⠀⠀⠀⠀
@@ -130,7 +130,7 @@
 ⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢
 
 julia> fock(20, 3)' * a * fock(20, 4)
-2.0 + 0.0im
source
QuPhys.createFunction
create(N::Int)

Bosonic creation operator with Hilbert space cutoff N. This operator acts on a fock state as $\hat{a}^\dagger \ket{n} = \sqrt{n+1} \ket{n+1}$.

Examples

julia> a_d = create(20)
+2.0 + 0.0im
source
QuPhys.createFunction
create(N::Int)

Bosonic creation operator with Hilbert space cutoff N. This operator acts on a fock state as $\hat{a}^\dagger \ket{n} = \sqrt{n+1} \ket{n+1}$.

Examples

julia> a_d = create(20)
 Quantum Object:   type=Operator   dims=[20]   size=(20, 20)   ishermitian=false
 20×20 SparseMatrixCSC{ComplexF64, Int64} with 19 stored entries:
 ⠢⡀⠀⠀⠀⠀⠀⠀⠀⠀
@@ -140,7 +140,7 @@
 ⠀⠀⠀⠀⠀⠀⠀⠈⠢⡀
 
 julia> fock(20, 4)' * a_d * fock(20, 3)
-2.0 + 0.0im
source
QuPhys.sigmapFunction
sigmap()

Pauli ladder operator $\hat{\sigma}_+ = \hat{\sigma}_x + i \hat{\sigma}_y$.

source
QuPhys.sigmamFunction
sigmam()

Pauli ladder operator $\hat{\sigma}_- = \hat{\sigma}_x - i \hat{\sigma}_y$.

source
QuPhys.sigmaxFunction
sigmax()

Pauli operator $\hat{\sigma}_x = \hat{\sigma}_- + \hat{\sigma}_+$.

source
QuPhys.sigmayFunction
sigmay()

Pauli operator $\hat{\sigma}_y = i \left( \hat{\sigma}_- - \hat{\sigma}_+ \right)$.

source
QuPhys.sigmazFunction
sigmaz()

Pauli operator $\hat{\sigma}_z = \comm{\hat{\sigma}_+}{\hat{\sigma}_-}$.

source
QuPhys.eyeFunction
eye(N::Int; type=OperatorQuantumObject, dims=[N])

Identity operator $\hat{\mathbb{1}}$ with Hilbert dimension N.

source
QuPhys.fockFunction
fock(N::Int, pos::Int; dims::Vector{Int}=[N], sparse::Bool=false)

Generates a fock state $\ket{\psi}$ of dimension N. It is also possible to specify the list of dimensions dims if different subsystems are present.

source
QuPhys.basisFunction
basis(N::Int, pos::Int; dims::Vector{Int}=[N])

Generates a fock state like fock.

source
QuPhys.coherentFunction
coherent(N::Real, α::T)

Generates a coherent state $\ket{\alpha}$, which is defined as an eigenvector of the bosonic annihilation operator $\hat{a} \ket{\alpha} = \alpha \ket{\alpha}$.

source
QuPhys.rand_dmFunction
rand_dm(N::Integer; kwargs...)

Generates a random density matrix $\hat{\rho}$, with the property to be positive definite, and that $\Tr \left[ \hat{\rho} \right] = 1$.

source
QuPhys.projectionFunction
projection(N::Int, i::Int, j::Int)

Generates the projection operator $\hat{O} = \dyad{i}{j}$ with Hilbert space dimension N.

source
QuPhys.sinmFunction
sinm(O::QuantumObject)

Generates the sine of the operator O, defined as

$\sin \left( \hat{O} \right) = \frac{e^{i \hat{O}} - e^{-i \hat{O}}}{2 i}$

source
QuPhys.cosmFunction
cosm(O::QuantumObject)

Generates the cosine of the operator O, defined as

$\cos \left( \hat{O} \right) = \frac{e^{i \hat{O}} + e^{-i \hat{O}}}{2}$

source

Time evolution

QuPhys.sigmapFunction
sigmap()

Pauli ladder operator $\hat{\sigma}_+ = \hat{\sigma}_x + i \hat{\sigma}_y$.

source
QuPhys.sigmamFunction
sigmam()

Pauli ladder operator $\hat{\sigma}_- = \hat{\sigma}_x - i \hat{\sigma}_y$.

source
QuPhys.sigmaxFunction
sigmax()

Pauli operator $\hat{\sigma}_x = \hat{\sigma}_- + \hat{\sigma}_+$.

source
QuPhys.sigmayFunction
sigmay()

Pauli operator $\hat{\sigma}_y = i \left( \hat{\sigma}_- - \hat{\sigma}_+ \right)$.

source
QuPhys.sigmazFunction
sigmaz()

Pauli operator $\hat{\sigma}_z = \comm{\hat{\sigma}_+}{\hat{\sigma}_-}$.

source
QuPhys.eyeFunction
eye(N::Int; type=OperatorQuantumObject, dims=[N])

Identity operator $\hat{\mathbb{1}}$ with Hilbert dimension N.

source
QuPhys.fockFunction
fock(N::Int, pos::Int; dims::Vector{Int}=[N], sparse::Bool=false)

Generates a fock state $\ket{\psi}$ of dimension N. It is also possible to specify the list of dimensions dims if different subsystems are present.

source
QuPhys.basisFunction
basis(N::Int, pos::Int; dims::Vector{Int}=[N])

Generates a fock state like fock.

source
QuPhys.coherentFunction
coherent(N::Real, α::T)

Generates a coherent state $\ket{\alpha}$, which is defined as an eigenvector of the bosonic annihilation operator $\hat{a} \ket{\alpha} = \alpha \ket{\alpha}$.

source
QuPhys.rand_dmFunction
rand_dm(N::Integer; kwargs...)

Generates a random density matrix $\hat{\rho}$, with the property to be positive definite, and that $\Tr \left[ \hat{\rho} \right] = 1$.

source
QuPhys.projectionFunction
projection(N::Int, i::Int, j::Int)

Generates the projection operator $\hat{O} = \dyad{i}{j}$ with Hilbert space dimension N.

source
QuPhys.sinmFunction
sinm(O::QuantumObject)

Generates the sine of the operator O, defined as

$\sin \left( \hat{O} \right) = \frac{e^{i \hat{O}} - e^{-i \hat{O}}}{2 i}$

source
QuPhys.cosmFunction
cosm(O::QuantumObject)

Generates the cosine of the operator O, defined as

$\cos \left( \hat{O} \right) = \frac{e^{i \hat{O}} + e^{-i \hat{O}}}{2}$

source

Time evolution

QuPhys.sesolveProblemFunction
sesolveProblem(H::QuantumObject,
     ψ0::QuantumObject,
     t_l::AbstractVector;
     alg::OrdinaryDiffEq.OrdinaryDiffEqAlgorithm=Tsit5()
@@ -148,7 +148,7 @@
     H_t::Union{Nothing,Function}=nothing,
     params::Dict{Symbol, Any}=Dict{Symbol, Any}(),
     progress::Bool=true,
-    kwargs...)

Generates the ODEProblem for the Schrödinger time evolution of a quantum system.

Arguments

  • H::QuantumObject: The Hamiltonian of the system.
  • ψ0::QuantumObject: The initial state of the system.
  • t_l::AbstractVector: The time list of the evolution.
  • alg::OrdinaryDiffEq.OrdinaryDiffEqAlgorithm: The algorithm used for the time evolution.
  • e_ops::AbstractVector: The list of operators to be evaluated during the evolution.
  • H_t::Union{Nothing,Function}: The time-dependent Hamiltonian of the system. If nothing, the Hamiltonian is time-independent.
  • params::Dict{Symbol, Any}: The parameters of the system.
  • progress::Bool: Whether to show the progress bar.
  • kwargs...: The keyword arguments passed to the ODEProblem constructor.

Returns

  • prob: The ODEProblem for the Schrödinger time evolution of the system.
source
QuPhys.mesolveProblemFunction
mesolveProblem(H::QuantumObject,
+    kwargs...)

Generates the ODEProblem for the Schrödinger time evolution of a quantum system.

Arguments

  • H::QuantumObject: The Hamiltonian of the system.
  • ψ0::QuantumObject: The initial state of the system.
  • t_l::AbstractVector: The time list of the evolution.
  • alg::OrdinaryDiffEq.OrdinaryDiffEqAlgorithm: The algorithm used for the time evolution.
  • e_ops::AbstractVector: The list of operators to be evaluated during the evolution.
  • H_t::Union{Nothing,Function}: The time-dependent Hamiltonian of the system. If nothing, the Hamiltonian is time-independent.
  • params::Dict{Symbol, Any}: The parameters of the system.
  • progress::Bool: Whether to show the progress bar.
  • kwargs...: The keyword arguments passed to the ODEProblem constructor.

Returns

  • prob: The ODEProblem for the Schrödinger time evolution of the system.
source
QuPhys.mesolveProblemFunction
mesolveProblem(H::QuantumObject,
     ψ0::QuantumObject,
     t_l::AbstractVector, c_ops::AbstractVector=[];
     alg::OrdinaryDiffEq.OrdinaryDiffEqAlgorithm=Tsit5(),
@@ -156,7 +156,7 @@
     H_t::Union{Nothing,Function}=nothing,
     params::Dict{Symbol, Any}=Dict{Symbol, Any}(),
     progress::Bool=true,
-    kwargs...)

Generates the ODEProblem for the master equation time evolution of an open quantum system.

Arguments

  • H::QuantumObject: The Hamiltonian or the Liouvillian of the system.
  • ψ0::QuantumObject: The initial state of the system.
  • t_l::AbstractVector: The time list of the evolution.
  • c_ops::AbstractVector=[]: The list of the collapse operators.
  • alg::OrdinaryDiffEq.OrdinaryDiffEqAlgorithm=Tsit5(): The algorithm used for the time evolution.
  • e_ops::AbstractVector=[]: The list of the operators for which the expectation values are calculated.
  • H_t::Union{Nothing,Function}=nothing: The time-dependent Hamiltonian or Liouvillian.
  • params::Dict{Symbol, Any}=Dict{Symbol, Any}(): The parameters of the time evolution.
  • progress::Bool=true: Whether to show the progress bar.
  • kwargs...: The keyword arguments for the ODEProblem.

Returns

  • prob::ODEProblem: The ODEProblem for the master equation time evolution.
source
QuPhys.mcsolveProblemFunction
mcsolveProblem(H::QuantumObject,
+    kwargs...)

Generates the ODEProblem for the master equation time evolution of an open quantum system.

Arguments

  • H::QuantumObject: The Hamiltonian or the Liouvillian of the system.
  • ψ0::QuantumObject: The initial state of the system.
  • t_l::AbstractVector: The time list of the evolution.
  • c_ops::AbstractVector=[]: The list of the collapse operators.
  • alg::OrdinaryDiffEq.OrdinaryDiffEqAlgorithm=Tsit5(): The algorithm used for the time evolution.
  • e_ops::AbstractVector=[]: The list of the operators for which the expectation values are calculated.
  • H_t::Union{Nothing,Function}=nothing: The time-dependent Hamiltonian or Liouvillian.
  • params::Dict{Symbol, Any}=Dict{Symbol, Any}(): The parameters of the time evolution.
  • progress::Bool=true: Whether to show the progress bar.
  • kwargs...: The keyword arguments for the ODEProblem.

Returns

  • prob::ODEProblem: The ODEProblem for the master equation time evolution.
source
QuPhys.mcsolveProblemFunction
mcsolveProblem(H::QuantumObject,
     ψ0::QuantumObject,
     t_l::AbstractVector, c_ops::AbstractVector;
     alg::OrdinaryDiffEq.OrdinaryDiffEqAlgorithm=Tsit5(),
@@ -164,7 +164,7 @@
     H_t::Union{Nothing,Function}=nothing,
     params::Dict{Symbol, Any}=Dict{Symbol, Any}(),
     jump_interp_pts::Integer=-1,
-    kwargs...)

Generates the ODEProblem for a single trajectory of the Monte Carlo wave function time evolution of an open quantum system.

Arguments

  • H::QuantumObject: Hamiltonian of the system.
  • ψ0::QuantumObject: Initial state of the system.
  • t_l::AbstractVector: List of times at which to save the state of the system.
  • c_ops::AbstractVector: List of collapse operators.
  • alg::OrdinaryDiffEq.OrdinaryDiffEqAlgorithm: Algorithm to use for the time evolution.
  • e_ops::AbstractVector: List of operators for which to calculate expectation values.
  • H_t::Union{Nothing,Function}: Time-dependent part of the Hamiltonian.
  • params::Dict{Symbol, Any}: Dictionary of parameters to pass to the solver.
  • jump_interp_pts::Integer: Number of points to use for interpolation of the jump times.
  • kwargs...: Additional keyword arguments to pass to the solver.

Returns

  • prob::ODEProblem: The ODEProblem for the Monte Carlo wave function time evolution.

Notes

When jump_interp_pts is set to -1, a DiscreteCallback is used to detect the jump times. When jump_interp_pts is set to a positive integer, a ContinuousCallback is used to detect the jump times.

source
QuPhys.mcsolveEnsembleProblemFunction
mcsolveEnsembleProblem(H::QuantumObject,
+    kwargs...)

Generates the ODEProblem for a single trajectory of the Monte Carlo wave function time evolution of an open quantum system.

Arguments

  • H::QuantumObject: Hamiltonian of the system.
  • ψ0::QuantumObject: Initial state of the system.
  • t_l::AbstractVector: List of times at which to save the state of the system.
  • c_ops::AbstractVector: List of collapse operators.
  • alg::OrdinaryDiffEq.OrdinaryDiffEqAlgorithm: Algorithm to use for the time evolution.
  • e_ops::AbstractVector: List of operators for which to calculate expectation values.
  • H_t::Union{Nothing,Function}: Time-dependent part of the Hamiltonian.
  • params::Dict{Symbol, Any}: Dictionary of parameters to pass to the solver.
  • jump_interp_pts::Integer: Number of points to use for interpolation of the jump times.
  • kwargs...: Additional keyword arguments to pass to the solver.

Returns

  • prob::ODEProblem: The ODEProblem for the Monte Carlo wave function time evolution.

Notes

When jump_interp_pts is set to -1, a DiscreteCallback is used to detect the jump times. When jump_interp_pts is set to a positive integer, a ContinuousCallback is used to detect the jump times.

source
QuPhys.mcsolveEnsembleProblemFunction
mcsolveEnsembleProblem(H::QuantumObject,
     ψ0::QuantumObject,
     t_l::AbstractVector, c_ops::AbstractVector;
     alg::OrdinaryDiffEq.OrdinaryDiffEqAlgorithm=Tsit5(),
@@ -176,7 +176,7 @@
     jump_interp_pts::Integer=-1,
     prob_func::Function=_mcsolve_prob_func,
     output_func::Function=_mcsolve_output_func,
-    kwargs...)

Generates the ODEProblem for an ensemble of trajectories of the Monte Carlo wave function time evolution of an open quantum system.

Arguments

  • H::QuantumObject: Hamiltonian of the system.
  • ψ0::QuantumObject: Initial state of the system.
  • t_l::AbstractVector: List of times at which to save the state of the system.
  • c_ops::AbstractVector: List of collapse operators.
  • alg::OrdinaryDiffEq.OrdinaryDiffEqAlgorithm: Algorithm to use for the time evolution.
  • e_ops::AbstractVector: List of operators for which to calculate expectation values.
  • H_t::Union{Nothing,Function}: Time-dependent part of the Hamiltonian.
  • params::Dict{Symbol, Any}: Dictionary of parameters to pass to the solver.
  • progress::Bool: Whether to show a progress bar.
  • n_traj::Integer: Number of trajectories to use.
  • jump_interp_pts::Integer: Number of points to use for interpolation of the jump times.
  • prob_func::Function: Function to use for generating the ODEProblem.
  • output_func::Function: Function to use for generating the output of a single trajectory.
  • kwargs...: Additional keyword arguments to pass to the solver.

Returns

  • prob::EnsembleProblem with ODEProblem: The Ensemble ODEProblem for the Monte Carlo

wave function time evolution.

Notes

When jump_interp_pts is set to -1, a DiscreteCallback is used to detect the jump times. When jump_interp_pts is set to a positive integer, a ContinuousCallback is used to detect the jump times.

source
QuPhys.sesolveFunction
sesolve(H::QuantumObject,
+    kwargs...)

Generates the ODEProblem for an ensemble of trajectories of the Monte Carlo wave function time evolution of an open quantum system.

Arguments

  • H::QuantumObject: Hamiltonian of the system.
  • ψ0::QuantumObject: Initial state of the system.
  • t_l::AbstractVector: List of times at which to save the state of the system.
  • c_ops::AbstractVector: List of collapse operators.
  • alg::OrdinaryDiffEq.OrdinaryDiffEqAlgorithm: Algorithm to use for the time evolution.
  • e_ops::AbstractVector: List of operators for which to calculate expectation values.
  • H_t::Union{Nothing,Function}: Time-dependent part of the Hamiltonian.
  • params::Dict{Symbol, Any}: Dictionary of parameters to pass to the solver.
  • progress::Bool: Whether to show a progress bar.
  • n_traj::Integer: Number of trajectories to use.
  • jump_interp_pts::Integer: Number of points to use for interpolation of the jump times.
  • prob_func::Function: Function to use for generating the ODEProblem.
  • output_func::Function: Function to use for generating the output of a single trajectory.
  • kwargs...: Additional keyword arguments to pass to the solver.

Returns

  • prob::EnsembleProblem with ODEProblem: The Ensemble ODEProblem for the Monte Carlo

wave function time evolution.

Notes

When jump_interp_pts is set to -1, a DiscreteCallback is used to detect the jump times. When jump_interp_pts is set to a positive integer, a ContinuousCallback is used to detect the jump times.

source
QuPhys.sesolveFunction
sesolve(H::QuantumObject,
     ψ0::QuantumObject,
     t_l::AbstractVector;
     alg::OrdinaryDiffEq.OrdinaryDiffEqAlgorithm=Tsit5(),
@@ -184,7 +184,7 @@
     H_t::Union{Nothing,Function}=nothing,
     params::Dict{Symbol, Any}=Dict{Symbol, Any}(),
     progress::Bool=true,
-    kwargs...)

Time evolution of a closed quantum system using the Schrödinger equation.

Arguments

  • H::QuantumObject: Hamiltonian of the system.

  • ψ0::QuantumObject: Initial state of the system.

  • t_l::AbstractVector: List of times at which to save the state of the system.

  • alg::OrdinaryDiffEq.OrdinaryDiffEqAlgorithm: Algorithm to use for the time evolution.

  • e_ops::AbstractVector: List of operators for which to calculate expectation values.

  • H_t::Union{Nothing,Function}: Time-dependent part of the Hamiltonian.

  • params::Dict{Symbol, Any}: Dictionary of parameters to pass to the solver.

  • progress::Bool: Whether to show a progress bar.

  • kwargs...: Additional keyword arguments to pass to the solver.

  • Returns

  • sol::TimeEvolutionSol: The solution of the time evolution.

source
QuPhys.mesolveFunction
mesolve(H::QuantumObject,
+    kwargs...)

Time evolution of a closed quantum system using the Schrödinger equation.

Arguments

  • H::QuantumObject: Hamiltonian of the system.

  • ψ0::QuantumObject: Initial state of the system.

  • t_l::AbstractVector: List of times at which to save the state of the system.

  • alg::OrdinaryDiffEq.OrdinaryDiffEqAlgorithm: Algorithm to use for the time evolution.

  • e_ops::AbstractVector: List of operators for which to calculate expectation values.

  • H_t::Union{Nothing,Function}: Time-dependent part of the Hamiltonian.

  • params::Dict{Symbol, Any}: Dictionary of parameters to pass to the solver.

  • progress::Bool: Whether to show a progress bar.

  • kwargs...: Additional keyword arguments to pass to the solver.

  • Returns

  • sol::TimeEvolutionSol: The solution of the time evolution.

source
QuPhys.mesolveFunction
mesolve(H::QuantumObject,
     ψ0::QuantumObject,
     t_l::AbstractVector, c_ops::AbstractVector=[];
     alg::OrdinaryDiffEqAlgorithm=Tsit5(),
@@ -192,7 +192,7 @@
     H_t::Union{Nothing,Function}=nothing,
     params::Dict{Symbol, Any}=Dict{Symbol, Any}(),
     progress::Bool=true,
-    kwargs...)

Time evolution of an open quantum system using master equation.

Arguments

  • H::QuantumObject: Hamiltonian of Liouvillian of the system.
  • ψ0::QuantumObject: Initial state of the system.
  • t_l::AbstractVector: List of times at which to save the state of the system.
  • c_ops::AbstractVector: List of collapse operators.
  • alg::OrdinaryDiffEqAlgorithm: Algorithm to use for the time evolution.
  • e_ops::AbstractVector: List of operators for which to calculate expectation values.
  • H_t::Union{Nothing,Function}: Time-dependent part of the Hamiltonian.
  • params::Dict{Symbol, Any}: Dictionary of parameters to pass to the solver.
  • progress::Bool: Whether to show a progress bar.
  • kwargs...: Additional keyword arguments to pass to the solver.

Returns

  • sol::TimeEvolutionSol: The solution of the time evolution.
source
QuPhys.mcsolveFunction
mcsolve(H::QuantumObject,
+    kwargs...)

Time evolution of an open quantum system using master equation.

Arguments

  • H::QuantumObject: Hamiltonian of Liouvillian of the system.
  • ψ0::QuantumObject: Initial state of the system.
  • t_l::AbstractVector: List of times at which to save the state of the system.
  • c_ops::AbstractVector: List of collapse operators.
  • alg::OrdinaryDiffEqAlgorithm: Algorithm to use for the time evolution.
  • e_ops::AbstractVector: List of operators for which to calculate expectation values.
  • H_t::Union{Nothing,Function}: Time-dependent part of the Hamiltonian.
  • params::Dict{Symbol, Any}: Dictionary of parameters to pass to the solver.
  • progress::Bool: Whether to show a progress bar.
  • kwargs...: Additional keyword arguments to pass to the solver.

Returns

  • sol::TimeEvolutionSol: The solution of the time evolution.
source
QuPhys.mcsolveFunction
mcsolve(H::QuantumObject,
     ψ0::QuantumObject,
     t_l::AbstractVector, c_ops::AbstractVector;
     alg::OrdinaryDiffEq.OrdinaryDiffEqAlgorithm=Tsit5(),
@@ -203,7 +203,7 @@
     n_traj::Integer=1,
     ensemble_method=EnsembleThreads(),
     jump_interp_pts::Integer=-1,
-    kwargs...)

Time evolution of an open quantum system using quantum trajectories.

Arguments

  • H::QuantumObject: Hamiltonian of the system.
  • ψ0::QuantumObject: Initial state of the system.
  • t_l::AbstractVector: List of times at which to save the state of the system.
  • c_ops::AbstractVector: List of collapse operators.
  • alg::OrdinaryDiffEq.OrdinaryDiffEqAlgorithm: Algorithm to use for the time evolution.
  • e_ops::AbstractVector: List of operators for which to calculate expectation values.
  • H_t::Union{Nothing,Function}: Time-dependent part of the Hamiltonian.
  • params::Dict{Symbol, Any}: Dictionary of parameters to pass to the solver.
  • progress::Bool: Whether to show a progress bar.
  • n_traj::Integer: Number of trajectories to use.
  • ensemble_method: Ensemble method to use.
  • jump_interp_pts::Integer: Number of points to use for interpolation of jump times.
  • kwargs...: Additional keyword arguments to pass to the solver.

Returns

  • sol::TimeEvolutionMCSol: The solution of the time evolution.

Notes

ensemble_method can be one of EnsembleThreads(), EnsembleSerial(), EnsembleDistributed(). When jump_interp_pts is set to -1, a DiscreteCallback is used to detect the jump times. When jump_interp_pts is set to a positive integer, a ContinuousCallback is used to detect the jump times.

source
QuPhys.dfd_mesolveFunction
function dfd_mesolve(H::Function, ψ0::QuantumObject,
+    kwargs...)

Time evolution of an open quantum system using quantum trajectories.

Arguments

  • H::QuantumObject: Hamiltonian of the system.
  • ψ0::QuantumObject: Initial state of the system.
  • t_l::AbstractVector: List of times at which to save the state of the system.
  • c_ops::AbstractVector: List of collapse operators.
  • alg::OrdinaryDiffEq.OrdinaryDiffEqAlgorithm: Algorithm to use for the time evolution.
  • e_ops::AbstractVector: List of operators for which to calculate expectation values.
  • H_t::Union{Nothing,Function}: Time-dependent part of the Hamiltonian.
  • params::Dict{Symbol, Any}: Dictionary of parameters to pass to the solver.
  • progress::Bool: Whether to show a progress bar.
  • n_traj::Integer: Number of trajectories to use.
  • ensemble_method: Ensemble method to use.
  • jump_interp_pts::Integer: Number of points to use for interpolation of jump times.
  • kwargs...: Additional keyword arguments to pass to the solver.

Returns

  • sol::TimeEvolutionMCSol: The solution of the time evolution.

Notes

ensemble_method can be one of EnsembleThreads(), EnsembleSerial(), EnsembleDistributed(). When jump_interp_pts is set to -1, a DiscreteCallback is used to detect the jump times. When jump_interp_pts is set to a positive integer, a ContinuousCallback is used to detect the jump times.

source
QuPhys.dfd_mesolveFunction
function dfd_mesolve(H::Function, ψ0::QuantumObject,
     t_l::AbstractVector, c_ops::Function, maxdims::AbstractVector;
     alg::OrdinaryDiffEq.OrdinaryDiffEqAlgorithm=Tsit5(),
     e_ops::Union{Nothing, Function}=nothing, 
@@ -211,7 +211,7 @@
     params::Dict{Symbol, Any}=Dict{Symbol, Any}(),
     progress::Bool=true,
     tol_list::Vector{<:Number}=Float64[],
-    kwargs...)

Time evolution of an open quantum system using master equation, dynamically changing the dimension of the Hilbert subspaces.

source
QuPhys.dsf_mesolveFunction
function dsf_mesolve(H::Function,
+    kwargs...)

Time evolution of an open quantum system using master equation, dynamically changing the dimension of the Hilbert subspaces.

source
QuPhys.dsf_mesolveFunction
function dsf_mesolve(H::Function,
     ψ0::QuantumObject,
     t_l::AbstractVector, c_ops::Function,
     op_list::AbstractVector,
@@ -222,7 +222,7 @@
     params::Dict{Symbol, Any}=Dict{Symbol, Any}(),
     progress::Bool=true,
     δα_list::Vector{<:Number}=Float64[],
-    kwargs...)

Time evolution of an open quantum system using master equation and the Dynamical Shifted Fock algorithm.

source
QuPhys.dsf_mcsolveFunction
function dsf_mcsolve(H::Function,
+    kwargs...)

Time evolution of an open quantum system using master equation and the Dynamical Shifted Fock algorithm.

source
QuPhys.dsf_mcsolveFunction
function dsf_mcsolve(H::Function,
     ψ0::QuantumObject,
     t_l::AbstractVector, c_ops::Function,
     op_list::AbstractVector,
@@ -237,12 +237,12 @@
     ensemble_method=EnsembleThreads(),
     jump_interp_pts::Integer=10,
     krylov_dim::Integer=cld(prod(ψ0.dims), 4),
-    kwargs...)

Time evolution of a quantum system using the Monte Carlo wave function method and the Dynamical Shifted Fock algorithm.

source
QuPhys.liouvillianFunction
liouvillian(H::QuantumObject, c_ops::AbstractVector)

Construct the Liouvillian superoperator for a system Hamiltonian and a set of collapse operators: $\mathcal{L} \cdot = -i[\hat{H}, \cdot] + \sum_i \mathcal{D}[\hat{O}_i] \cdot$, where $\mathcal{D}[\hat{O}_i] \cdot = \hat{O}_i \cdot \hat{O}_i^\dagger - \frac{1}{2} \hat{O}_i^\dagger \hat{O}_i \cdot - \frac{1}{2} \cdot \hat{O}_i^\dagger \hat{O}_i$.

source
QuPhys.liouvillian_generalizedFunction
liouvillian_generalized(H::QuantumObject, fields::Vector, 
-κ_list::Vector, ω_list::Vector, T_list::Vector; N_trunc::Int=size(H,1), tol::Float64=0.0)

Constructs the generalized Liouvillian for a system coupled to a bath of harmonic oscillators.

See, e.g., Settineri, Alessio, et al. "Dissipation and thermal noise in hybrid quantum systems in the ultrastrong-coupling regime." Physical Review A 98.5 (2018): 053834.

source
QuPhys.steadystate_floquetFunction
steadystate_floquet(H_0::QuantumObject,
+    kwargs...)

Time evolution of a quantum system using the Monte Carlo wave function method and the Dynamical Shifted Fock algorithm.

source
QuPhys.liouvillianFunction
liouvillian(H::QuantumObject, c_ops::AbstractVector)

Construct the Liouvillian superoperator for a system Hamiltonian and a set of collapse operators: $\mathcal{L} \cdot = -i[\hat{H}, \cdot] + \sum_i \mathcal{D}[\hat{O}_i] \cdot$, where $\mathcal{D}[\hat{O}_i] \cdot = \hat{O}_i \cdot \hat{O}_i^\dagger - \frac{1}{2} \hat{O}_i^\dagger \hat{O}_i \cdot - \frac{1}{2} \cdot \hat{O}_i^\dagger \hat{O}_i$.

source
QuPhys.liouvillian_generalizedFunction
liouvillian_generalized(H::QuantumObject, fields::Vector, 
+κ_list::Vector, ω_list::Vector, T_list::Vector; N_trunc::Int=size(H,1), tol::Float64=0.0)

Constructs the generalized Liouvillian for a system coupled to a bath of harmonic oscillators.

See, e.g., Settineri, Alessio, et al. "Dissipation and thermal noise in hybrid quantum systems in the ultrastrong-coupling regime." Physical Review A 98.5 (2018): 053834.

source
QuPhys.steadystate_floquetFunction
steadystate_floquet(H_0::QuantumObject,
     c_ops::Vector, H_p::QuantumObject,
     H_m::QuantumObject,
     ω::Real; n_max::Int=4, lf_solver::LSolver=LiouvillianDirectSolver(),
-    ss_solver::Type{SSSolver}=SteadyStateDirectSolver)

Calculates the steady state of a periodically driven system. Here H_0 is the Hamiltonian or the Liouvillian of the undriven system. Considering a monochromatic drive at frequency $\\omega$, we divide it into two parts, H_p and H_m, where H_p oscillates as $e^{i \\omega t}$ and H_m oscillates as $e^{-i \\omega t}$. n_max is the number of iterations used to obtain the effective Liouvillian, lf_solver is the solver used to solve the effective Liouvillian, and ss_solver is the solver used to solve the steady state.

source

Correlations and Spectrum

QuPhys.correlation_3op_2tFunction
correlation_3op_2t(H::QuantumObject,
+    ss_solver::Type{SSSolver}=SteadyStateDirectSolver)

Calculates the steady state of a periodically driven system. Here H_0 is the Hamiltonian or the Liouvillian of the undriven system. Considering a monochromatic drive at frequency $\\omega$, we divide it into two parts, H_p and H_m, where H_p oscillates as $e^{i \\omega t}$ and H_m oscillates as $e^{-i \\omega t}$. n_max is the number of iterations used to obtain the effective Liouvillian, lf_solver is the solver used to solve the effective Liouvillian, and ss_solver is the solver used to solve the steady state.

source

Correlations and Spectrum

QuPhys.correlation_3op_2tFunction
correlation_3op_2t(H::QuantumObject,
     ψ0::QuantumObject,
     t_l::AbstractVector,
     τ_l::AbstractVector,
@@ -250,7 +250,7 @@
     B::QuantumObject,
     C::QuantumObject,
     c_ops::AbstractVector=[];
-    kwargs...)

Returns the two-times correlation function of three operators $\hat{A}$, $\hat{B}$ and $\hat{C}$: $\expval{\hat{A}(t) \hat{B}(t + \tau) \hat{C}(t)}$ for a given initial state $\ket{\psi_0}$.

source
QuPhys.correlation_2op_2tFunction
correlation_2op_2t(H::QuantumObject,
+    kwargs...)

Returns the two-times correlation function of three operators $\hat{A}$, $\hat{B}$ and $\hat{C}$: $\expval{\hat{A}(t) \hat{B}(t + \tau) \hat{C}(t)}$ for a given initial state $\ket{\psi_0}$.

source
QuPhys.correlation_2op_2tFunction
correlation_2op_2t(H::QuantumObject,
     ψ0::QuantumObject,
     t_l::AbstractVector,
     τ_l::AbstractVector,
@@ -258,20 +258,20 @@
     B::QuantumObject,
     c_ops::AbstractVector=[];
     reverse::Bool=false,
-    kwargs...)

Returns the two-times correlation function of two operators $\hat{A}$ and $\hat{B}$at different times\expval{\hat{A}(t + \tau) \hat{B}(t)}. Whenreverse=true, the correlation function is calculated as\expval{\hat{A}(t) \hat{B}(t + \tau)}`.

source
QuPhys.correlation_2op_1tFunction
correlation_2op_1t(H::QuantumObject,
+    kwargs...)

Returns the two-times correlation function of two operators $\hat{A}$ and $\hat{B}$at different times\expval{\hat{A}(t + \tau) \hat{B}(t)}. Whenreverse=true, the correlation function is calculated as\expval{\hat{A}(t) \hat{B}(t + \tau)}`.

source
QuPhys.correlation_2op_1tFunction
correlation_2op_1t(H::QuantumObject,
     ψ0::QuantumObject,
     τ_l::AbstractVector,
     A::QuantumObject,
     B::QuantumObject,
     c_ops::AbstractVector=[];
     reverse::Bool=false,
-    kwargs...)

Returns the one-time correlation function of two operators $\hat{A}$ and $\hat{B}$ at different times $\expval{\hat{A}(\tau) \hat{B}(0)}$. When $reverse=true$, the correlation function is calculated as $\expval{\hat{A}(0) \hat{B}(\tau)}$.

source
QuPhys.spectrumFunction
spectrum(H::QuantumObject,
+    kwargs...)

Returns the one-time correlation function of two operators $\hat{A}$ and $\hat{B}$ at different times $\expval{\hat{A}(\tau) \hat{B}(0)}$. When $reverse=true$, the correlation function is calculated as $\expval{\hat{A}(0) \hat{B}(\tau)}$.

source
QuPhys.spectrumFunction
spectrum(H::QuantumObject,
 ω_list::AbstractVector,
 A::QuantumObject{<:AbstractArray{T2},OperatorQuantumObject},
 B::QuantumObject{<:AbstractArray{T3},OperatorQuantumObject},
 c_ops::AbstractVector=[];
 solver::MySolver=ExponentialSeries(),
-    kwargs...)

Returns the emission spectrum $S(\omega) = \int_{-\infty}^\infty \expval{\hat{A}(\tau) \hat{B}(0)} e^{-i \omega \tau} d \tau$.

source

Eigenvalues and eigenvectors

LinearAlgebra.eigenFunction
LinearAlgebra.eigen(A::QuantumObject; kwargs...)

Calculates the eigenvalues and eigenvectors of the QuantumObject A using the Julia LinearAlgebra package.

julia> a = destroy(5);
+    kwargs...)

Returns the emission spectrum $S(\omega) = \int_{-\infty}^\infty \expval{\hat{A}(\tau) \hat{B}(0)} e^{-i \omega \tau} d \tau$.

source

Eigenvalues and eigenvectors

LinearAlgebra.eigenFunction
LinearAlgebra.eigen(A::QuantumObject; kwargs...)

Calculates the eigenvalues and eigenvectors of the QuantumObject A using the Julia LinearAlgebra package.

julia> a = destroy(5);
 
 julia> H = a + a'
 Quantum Object:   type=Operator   dims=[5]   size=(5, 5)   ishermitian=true
@@ -302,7 +302,7 @@
 julia> ψ_1 = QuantumObject(U[:,1], dims=H.dims);
 
 julia> expect(H, ψ_1) ≈ E[1]
-true
source
QuPhys.eigsolveFunction
function eigsolve(A::QuantumObject; v0::Union{Nothing,AbstractVector}=nothing, 
+true
source
QuPhys.eigsolveFunction
function eigsolve(A::QuantumObject; v0::Union{Nothing,AbstractVector}=nothing, 
     sigma::Union{Nothing, Real}=nothing, k::Integer = min(4, size(A, 1)), 
     krylovdim::Integer = min(10, size(A, 1)), tol::Real = 1e-8, maxiter::Integer = 200,
-    solver::Union{Nothing, LinearSolve.SciMLLinearSolveAlgorithm} = nothing, showinfo::Bool=false, kwargs...)

Solve for the eigenvalues and eigenvectors of a matrix A using the Arnoldi method. The keyword arguments are passed to the linear solver.

source
+ solver::Union{Nothing, LinearSolve.SciMLLinearSolveAlgorithm} = nothing, showinfo::Bool=false, kwargs...)

Solve for the eigenvalues and eigenvectors of a matrix A using the Arnoldi method. The keyword arguments are passed to the linear solver.

source
diff --git a/dev/benchmark_comparison/index.html b/dev/benchmark_comparison/index.html index 7c0fb734..5f421d3a 100644 --- a/dev/benchmark_comparison/index.html +++ b/dev/benchmark_comparison/index.html @@ -1,34 +1,34 @@ -Multi VS Single Thread · QuPhys.jl

Benchmark Report for QuPhys

Job Properties

  • Time of benchmarks:
    • Target: 6 Jul 2023 - 19:55
    • Baseline: 6 Jul 2023 - 19:58
  • Package commits:
    • Target: 5aef22
    • Baseline: 5aef22
  • Julia commits:
    • Target: e4ee48
    • Baseline: e4ee48
  • Julia command flags:
    • Target: None
    • Baseline: None
  • Environment variables:
    • Target: JULIA_NUM_THREADS => 2
    • Baseline: JULIA_NUM_THREADS => 1

Results

A ratio greater than 1.0 denotes a possible regression (marked with :x:), while a ratio less than 1.0 denotes a possible improvement (marked with :whitecheckmark:). Only significant results - results that indicate possible regressions or improvements - are shown below (thus, an empty table means that all benchmark results remained invariant between builds).

IDtime ratiomemory ratio
["permutation", "get_bdf_blocks"]1.05 (5%) :x:1.00 (1%)
["timeevolution", "mcsolve_parallel"]0.52 (5%) :whitecheckmark:1.00 (1%)
["wigner", "wigner_laguerre_sparse_parallel"]0.60 (5%) :whitecheckmark:1.00 (1%)

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["entanglement"]
  • ["permutation"]
  • ["spectrum"]
  • ["timeevolution"]
  • ["wigner"]

Julia versioninfo

Target

Julia Version 1.9.2
+Multi VS Single Thread · QuPhys.jl

Benchmark Report for QuPhys

Job Properties

  • Time of benchmarks:
    • Target: 6 Jul 2023 - 21:41
    • Baseline: 6 Jul 2023 - 21:44
  • Package commits:
    • Target: e4101a
    • Baseline: e4101a
  • Julia commits:
    • Target: e4ee48
    • Baseline: e4ee48
  • Julia command flags:
    • Target: None
    • Baseline: None
  • Environment variables:
    • Target: JULIA_NUM_THREADS => 2
    • Baseline: JULIA_NUM_THREADS => 1

Results

A ratio greater than 1.0 denotes a possible regression (marked with :x:), while a ratio less than 1.0 denotes a possible improvement (marked with :whitecheckmark:). Only significant results - results that indicate possible regressions or improvements - are shown below (thus, an empty table means that all benchmark results remained invariant between builds).

IDtime ratiomemory ratio
["entanglement", "ptrace"]1.06 (5%) :x:1.00 (1%)
["permutation", "get_bdf_blocks"]0.93 (5%) :whitecheckmark:1.00 (1%)
["timeevolution", "liouvillian"]0.93 (5%) :whitecheckmark:1.00 (1%)
["timeevolution", "mcsolve_parallel"]0.50 (5%) :whitecheckmark:1.00 (1%)
["wigner", "wigner_laguerre_sparse_parallel"]0.61 (5%) :whitecheckmark:1.00 (1%)

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["entanglement"]
  • ["permutation"]
  • ["spectrum"]
  • ["timeevolution"]
  • ["wigner"]

Julia versioninfo

Target

Julia Version 1.9.2
 Commit e4ee485e909 (2023-07-05 09:39 UTC)
 Platform Info:
   OS: Linux (x86_64-linux-gnu)
       Ubuntu 22.04.2 LTS
   uname: Linux 5.15.0-1041-azure #48-Ubuntu SMP Tue Jun 20 20:34:08 UTC 2023 x86_64 x86_64
-  CPU: Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz: 
+  CPU: Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz: 
               speed         user         nice          sys         idle          irq
-       #1  2095 MHz       8733 s          0 s        408 s       4898 s          0 s
-       #2  2095 MHz       5101 s          0 s        384 s       8503 s          0 s
-  Memory: 6.7694854736328125 GB (4713.57421875 MB free)
-  Uptime: 1413.04 sec
-  Load Avg:  1.06  1.05  0.91
+       #1  2294 MHz       6911 s          0 s        422 s       7989 s          0 s
+       #2  2294 MHz       8448 s          0 s        439 s       6430 s          0 s
+  Memory: 6.7694854736328125 GB (4734.0859375 MB free)
+  Uptime: 1545.64 sec
+  Load Avg:  1.03  1.04  0.95
   WORD_SIZE: 64
   LIBM: libopenlibm
-  LLVM: libLLVM-14.0.6 (ORCJIT, skylake-avx512)
+  LLVM: libLLVM-14.0.6 (ORCJIT, broadwell)
   Threads: 2 on 2 virtual cores

Baseline

Julia Version 1.9.2
 Commit e4ee485e909 (2023-07-05 09:39 UTC)
 Platform Info:
   OS: Linux (x86_64-linux-gnu)
       Ubuntu 22.04.2 LTS
   uname: Linux 5.15.0-1041-azure #48-Ubuntu SMP Tue Jun 20 20:34:08 UTC 2023 x86_64 x86_64
-  CPU: Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz: 
+  CPU: Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz: 
               speed         user         nice          sys         idle          irq
-       #1  2095 MHz      10784 s          0 s        426 s       4906 s          0 s
-       #2  2095 MHz       5113 s          0 s        388 s      10556 s          0 s
-  Memory: 6.7694854736328125 GB (4787.46875 MB free)
-  Uptime: 1620.83 sec
-  Load Avg:  1.0  1.02  0.93
+       #1  2294 MHz       6932 s          0 s        428 s      10281 s          0 s
+       #2  2294 MHz      10743 s          0 s        458 s       6439 s          0 s
+  Memory: 6.7694854736328125 GB (4646.703125 MB free)
+  Uptime: 1778.21 sec
+  Load Avg:  1.0  1.01  0.97
   WORD_SIZE: 64
   LIBM: libopenlibm
-  LLVM: libLLVM-14.0.6 (ORCJIT, skylake-avx512)
-  Threads: 1 on 2 virtual cores
+ LLVM: libLLVM-14.0.6 (ORCJIT, broadwell) + Threads: 1 on 2 virtual cores
diff --git a/dev/benchmark_single/index.html b/dev/benchmark_single/index.html index c68cf000..d6f73d0b 100644 --- a/dev/benchmark_single/index.html +++ b/dev/benchmark_single/index.html @@ -1,18 +1,18 @@ -Multi Threads · QuPhys.jl

Benchmark Report for QuPhys

Job Properties

  • Time of benchmark: 6 Jul 2023 - 20:2
  • Package commit: 5aef22
  • Julia commit: e4ee48
  • Julia command flags: None
  • Environment variables: JULIA_NUM_THREADS => 2

Results

Below is a table of this job's results, obtained by running the benchmarks. The values listed in the ID column have the structure [parent_group, child_group, ..., key], and can be used to index into the BaseBenchmarks suite to retrieve the corresponding benchmarks. The percentages accompanying time and memory values in the below table are noise tolerances. The "true" time/memory value for a given benchmark is expected to fall within this percentage of the reported value. An empty cell means that the value was zero.

IDtimeGC timememoryallocations
["entanglement", "entropy_vn"]9.001 μs (5%)30.05 KiB (1%)18
["entanglement", "ptrace"]11.401 μs (5%)27.14 KiB (1%)21
["entanglement", "ptrace_dm"]460.540 μs (5%)76.73 KiB (1%)1337
["permutation", "bdf"]1.612 ms (5%)2.41 MiB (1%)12603
["permutation", "get_bdf_blocks"]81.407 μs (5%)358.94 KiB (1%)24
["spectrum", "spectrum_exponential_series"]9.890 ms (5%)1.55 MiB (1%)876
["spectrum", "spectrum_fft"]8.700 ms (5%)818.27 KiB (1%)1527
["timeevolution", "liouvillian"]281.024 μs (5%)676.59 KiB (1%)398
["timeevolution", "liouvillian_generalized"]1.013 ms (5%)2.50 MiB (1%)1178
["timeevolution", "liouvillian_generalized_trunc"]381.533 μs (5%)695.25 KiB (1%)1169
["timeevolution", "mcsolve_parallel"]1.672 s (5%)65.35 MiB (1%)96048
["timeevolution", "mcsolve_serial"]3.371 s (5%)15.983 ms65.35 MiB (1%)96006
["timeevolution", "mesolve"]35.399 ms (5%)894.73 KiB (1%)729
["timeevolution", "steadystate"]1.175 ms (5%)1.50 MiB (1%)497
["timeevolution", "steadystate_floquet"]249.212 ms (5%)5.941 ms142.12 MiB (1%)748
["wigner", "wigner_clenshaw"]350.208 ms (5%)41.343 ms682.59 MiB (1%)1177
["wigner", "wigner_clenshaw_fock"]156.454 ms (5%)19.205 ms318.62 MiB (1%)631
["wigner", "wigner_laguerre"]166.604 ms (5%)7.57 MiB (1%)21
["wigner", "wigner_laguerre_fock"]5.971 ms (5%)7.55 MiB (1%)26
["wigner", "wigner_laguerre_sparse"]169.715 ms (5%)7.56 MiB (1%)21
["wigner", "wigner_laguerre_sparse_parallel"]114.682 ms (5%)3.018 ms60.44 MiB (1%)49

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["entanglement"]
  • ["permutation"]
  • ["spectrum"]
  • ["timeevolution"]
  • ["wigner"]

Julia versioninfo

Julia Version 1.9.2
+Multi Threads · QuPhys.jl

Benchmark Report for QuPhys

Job Properties

  • Time of benchmark: 6 Jul 2023 - 21:48
  • Package commit: e4101a
  • Julia commit: e4ee48
  • Julia command flags: None
  • Environment variables: JULIA_NUM_THREADS => 2

Results

Below is a table of this job's results, obtained by running the benchmarks. The values listed in the ID column have the structure [parent_group, child_group, ..., key], and can be used to index into the BaseBenchmarks suite to retrieve the corresponding benchmarks. The percentages accompanying time and memory values in the below table are noise tolerances. The "true" time/memory value for a given benchmark is expected to fall within this percentage of the reported value. An empty cell means that the value was zero.

IDtimeGC timememoryallocations
["entanglement", "entropy_vn"]8.700 μs (5%)30.05 KiB (1%)18
["entanglement", "ptrace"]12.200 μs (5%)27.14 KiB (1%)21
["entanglement", "ptrace_dm"]463.802 μs (5%)76.73 KiB (1%)1337
["permutation", "bdf"]1.847 ms (5%)2.41 MiB (1%)12603
["permutation", "get_bdf_blocks"]132.901 μs (5%)358.94 KiB (1%)24
["spectrum", "spectrum_exponential_series"]11.068 ms (5%)1.55 MiB (1%)876
["spectrum", "spectrum_fft"]11.397 ms (5%)818.27 KiB (1%)1527
["timeevolution", "liouvillian"]334.901 μs (5%)676.59 KiB (1%)398
["timeevolution", "liouvillian_generalized"]1.483 ms (5%)2.50 MiB (1%)1178
["timeevolution", "liouvillian_generalized_trunc"]545.703 μs (5%)695.25 KiB (1%)1169
["timeevolution", "mcsolve_parallel"]2.051 s (5%)65.35 MiB (1%)96049
["timeevolution", "mcsolve_serial"]3.955 s (5%)18.499 ms65.35 MiB (1%)96006
["timeevolution", "mesolve"]44.905 ms (5%)894.73 KiB (1%)729
["timeevolution", "steadystate"]1.369 ms (5%)1.50 MiB (1%)497
["timeevolution", "steadystate_floquet"]432.019 ms (5%)8.201 ms142.12 MiB (1%)749
["wigner", "wigner_clenshaw"]420.820 ms (5%)60.009 ms682.59 MiB (1%)1177
["wigner", "wigner_clenshaw_fock"]185.502 ms (5%)27.240 ms318.62 MiB (1%)631
["wigner", "wigner_laguerre"]175.155 ms (5%)7.57 MiB (1%)21
["wigner", "wigner_laguerre_fock"]6.538 ms (5%)7.55 MiB (1%)26
["wigner", "wigner_laguerre_sparse"]176.400 ms (5%)7.56 MiB (1%)21
["wigner", "wigner_laguerre_sparse_parallel"]124.098 ms (5%)3.997 ms60.44 MiB (1%)49

Benchmark Group List

Here's a list of all the benchmark groups executed by this job:

  • ["entanglement"]
  • ["permutation"]
  • ["spectrum"]
  • ["timeevolution"]
  • ["wigner"]

Julia versioninfo

Julia Version 1.9.2
 Commit e4ee485e909 (2023-07-05 09:39 UTC)
 Platform Info:
   OS: Linux (x86_64-linux-gnu)
       Ubuntu 22.04.2 LTS
   uname: Linux 5.15.0-1041-azure #48-Ubuntu SMP Tue Jun 20 20:34:08 UTC 2023 x86_64 x86_64
-  CPU: Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz: 
+  CPU: Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz: 
               speed         user         nice          sys         idle          irq
-       #1  2095 MHz      11608 s          0 s        435 s       6123 s          0 s
-       #2  2095 MHz       6438 s          0 s        402 s      11269 s          0 s
-  Memory: 6.7694854736328125 GB (4691.16015625 MB free)
-  Uptime: 1826.44 sec
-  Load Avg:  1.15  1.06  0.98
+       #1  2294 MHz       8403 s          0 s        446 s      11095 s          0 s
+       #2  2294 MHz      11677 s          0 s        468 s       7800 s          0 s
+  Memory: 6.7694854736328125 GB (4694.1015625 MB free)
+  Uptime: 2009.25 sec
+  Load Avg:  1.02  1.02  1.0
   WORD_SIZE: 64
   LIBM: libopenlibm
-  LLVM: libLLVM-14.0.6 (ORCJIT, skylake-avx512)
-  Threads: 2 on 2 virtual cores
+ LLVM: libLLVM-14.0.6 (ORCJIT, broadwell) + Threads: 2 on 2 virtual cores
diff --git a/dev/index.html b/dev/index.html index 64da724b..16fd2654 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,2 @@ -Introduction · QuPhys.jl

Introduction

QuPhys is a Julia package for numerical simulation of quantum systems.

+Introduction · QuPhys.jl

Introduction

QuPhys is a Julia package for numerical simulation of quantum systems.

diff --git a/dev/search/index.html b/dev/search/index.html index c1dc6018..d0bf665f 100644 --- a/dev/search/index.html +++ b/dev/search/index.html @@ -1,2 +1,2 @@ -Search · QuPhys.jl

Loading search...

    +Search · QuPhys.jl

    Loading search...