Physics Constants

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.μ0Constant.

magnetic constant (vacuum permeability)

source
QMTK.Consts.ε0Constant.

electric constant (vacuum permittivity)

source

Universal constants

The following physics constants are provided by QMTK.Consts with data download from NIST:

QMTK.Consts.cConstant.

speed of light in vacuum

source
QMTK.Consts.c0Constant.

speed of light in vacuum

source
QMTK.Consts.GConstant.

Newtonian constant of gravitation

source
QMTK.Consts.gConstant.

standard acceleration of gravity

source
QMTK.Consts.ħConstant.

Planck constant over 2 pi

source
QMTK.Consts.hConstant.

Planck constant

source

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.eConstant.

atomic unit of charge

source

Atomic and nuclear constants

QMTK.Consts.a0Constant.

Bohr radius

source
QMTK.Consts.αConstant.

fine-structure constant

source

Physico-chemical constants

QMTK.Consts.kConstant.

Boltzmann constant

source
QMTK.Consts.NAConstant.

Avogadro constant

source
QMTK.Consts.atmConstant.

standard atmosphere

source

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