Physics Constants
The physics constants module QMTK.Consts
uses NIST CODATA Project's definitions of physics constants as default. You can access all NIST data in QMTK.Consts.DATA["NIST"]
by use certain names of the constant, e.g
julia> a = Consts.DATA["NIST"]["Bohr radius"]
5.2917721067e-11
You will receive a Consts.NISTConst
type, which contains information of the constants quantity
, uncertainty
, unit
and value
, but don't panic we have overload this type and just use it like normal native Julia numbers, it will automatically use its value
to do the operation.
You can access all these property by
julia> a.quantity
"Bohr radius"
julia> a.uncertainty
1.2e-20
julia> a.unit
"m"
julia> a.value
5.2917721067e-11
You can bring defined Physics Constants' name by calling
juila> using QMTK.Consts
This will bring the following physics constatns into your current scope. Be careful, this may cause name conflict to your current variables. If you do not want to cause this conflict you can just use
julia> import QMTK.Consts
Defined Physics Constant
The following physics constants whose value is defined are provided by QMTK.Consts
:
QMTK.Consts.μ0
— Constant.magnetic constant (vacuum permeability)
QMTK.Consts.ε0
— Constant.electric constant (vacuum permittivity)
Universal constants
The following physics constants are provided by QMTK.Consts
with data download from NIST:
QMTK.Consts.c
— Constant.speed of light in vacuum
QMTK.Consts.c0
— Constant.speed of light in vacuum
QMTK.Consts.G
— Constant.Newtonian constant of gravitation
QMTK.Consts.g
— Constant.standard acceleration of gravity
QMTK.Consts.ħ
— Constant.Planck constant over 2 pi
QMTK.Consts.h
— Constant.Planck constant
Electromagnetic constants
This constant will cause conflict with default constant e
for mathematical constant e
, you can use another binding eu
for 2.718...
after using QMTK.Consts
instead.
QMTK.Consts.e
— Constant.atomic unit of charge
Atomic and nuclear constants
QMTK.Consts.a0
— Constant.Bohr radius
QMTK.Consts.α
— Constant.fine-structure constant
Physico-chemical constants
QMTK.Consts.k
— Constant.Boltzmann constant
QMTK.Consts.NA
— Constant.Avogadro constant
QMTK.Consts.atm
— Constant.standard atmosphere
Pauli matrix
We provide some sugar for pauli matrix with Julia stdlib
in QMTK.Consts.Pauli
You can use the following command to bring sigmax
, sigmay
, sigmaz
, sigmai
(for the 2x2 identity) and σ
, σ₀
, σ₁
, σ₂
, σ₃
where σ
is the Pauli Group
julia> σ[1] # sigmai
2×2 SparseMatrixCSC{Int64,Int64} with 2 stored entries:
[1, 1] = 1
[2, 2] = 1
julia> σ[2] # sigmax
2×2 SparseMatrixCSC{Int64,Int64} with 2 stored entries:
[2, 1] = 1
[1, 2] = 1
julia> σ[3] # sigmay
2×2 SparseMatrixCSC{Complex{Int64},Int64} with 2 stored entries:
[2, 1] = 0+1im
[1, 2] = 0-1im
julia> σ[4] # sigmaz
2×2 SparseMatrixCSC{Int64,Int64} with 2 stored entries:
[1, 1] = 1
[2, 2] = -1
and S
is the PauliVector
: $(\sigma_x, \sigma_y, \sigma_z)$
you can use it when you need operations like
julia> S * S # σ₁⊗σ₁ + σ₂⊗σ₂ + σ₃⊗σ₃
4×4 SparseMatrixCSC{Complex{Int64},Int64} with 6 stored entries:
[1, 1] = 1+0im
[2, 2] = -1+0im
[3, 2] = 2+0im
[2, 3] = 2+0im
[3, 3] = -1+0im
[4, 4] = 1+0im