Utilities

Collection of some utilities for simulations.

ITensor Utilities

QuantumDynamics.Utilities.MPO_to_MPSFunction
MPO_to_MPS(ρ::MPO, fbcombiner)

Convert a given MPO to an MPS by combining the two site indices on every tensor into a single one using the vector of combiner tensors.

source
ITensors.ITensorMPS.expectFunction
ITensors.expect(ρ::MPO, ops; kwargs...)

Extends ITensors' expect function to handle density matrices in the form of MPOs.

source

HDF5 Utilities

Generic Utilities

QuantumDynamics.Utilities.get_BLAS_implementationFunction
get_BLAS_implementation()

Reports the BLAS implementation under use. The default implementation used by Julia is OpenBlas. MKL is supported through the external package MKL.jl, which needs to be installed and loaded before the loading of QuantumDynamics.jl

source
QuantumDynamics.Utilities.trapezoidFunction
trapezoid(x, y; discrete::Bool=false, exec=ThreadedEx())

Returns the trapezoidal integration of y with respect to x. If discrete is set to true, then returns sum of y. exec encodes the execution paradigm and is one of seq or par.

source
QuantumDynamics.Utilities.fourier_transformFunction
fourier_transform(time::AbstractArray{<:Real}, corr::AbstractArray{<:Complex}; full=true, unitary=false)

Returns the Fourier transform of corr:

$C(\omega) = \mathcal{N}\,\int_a^\infty C(t)\,e^{i\omega t}\,dt$

If unitary is true, then $\mathcal{N}=\frac{1}{2\pi}$, else $\mathcal{N}=1$.

If full is true, then $a=-\infty$, else $a=0$.

source
QuantumDynamics.Utilities.calculate_LiouvillianFunction
calculate_Liouvillian(H::OpSum, sites)

Returns the forward-backward space combiner and the Liouvillian MPO corresponding to the Hamiltonian provided as an ITensor OpSum, to be built on the sites.

source
calculate_Liouvillian(Hamiltonian::AbstractMatrix{Complex})

Returns the Liouvillian corresponding to the given Hamiltonian.

source
QuantumDynamics.Utilities.unhash_pathFunction
unhash_path(path_num::Int, ntimes::Int, sdim::Int)

Construct a path for a system with sdim dimensions, corresponding to the number path_num, with ntimes time steps.

source

There are a few utilities for creating specific kinds of Hamiltonians.

QuantumDynamics.Utilities.create_nn_hamiltonianFunction
create_nn_hamiltonian(; site_energies::AbstractVector{AbstractFloat}, couplings::AbstractVector{AbstractFloat}, periodic::Bool)

Creates a nearest neighbour Hamiltonian with the given site_energies and couplings. Periodic boundary conditions can also be used by passing true into the periodic argument.

source

Extra arguments

Many of the algorithms require extra, method-specific arguments. These are implemented as subtypes of Utilities.ExtraArgs.

QuantumDynamics.Utilities.DiffEqArgsType

Extra parameters for solving differential equations. Currently has a threshold for magnitude-based filtering. The default values are:

  • reltol = 1e-10
  • abstol = 1e-10
  • solver = Tsit5()
source
QuantumDynamics.Utilities.TensorNetworkArgsType

Extra parameters for tensor network algorithms. Currently has an SVD cutoff, a maximum bond dimension maxdim, and the contraction algorithm. The default values are as follows:

  • cutoff = 1e-8
  • maxdim = 500
  • algorithm = "naive"

Other options for algorithm are "densitymatrix" and "fit".

source