StollLab / EasySpin

MATLAB toolbox for Electron Paramagnetic Resonance (EPR) spectroscopy
http://easyspin.org
MIT License
49 stars 26 forks source link

More systematic names for Hamiltonian functions #231

Closed stestoll closed 2 years ago

stestoll commented 2 years ago

Functions that return Hamiltonians are not systematically named; this should be improved. Proposal:

ham - total Hamiltonian (instead of sham - since orbital terms can be included, it's not clean to call this a spin Hamiltonian) ham_ez - electron Zeeman (instead of zeeman with appropriate indices) ham_nz - nuclear Zeeman (instead of zeeman with appropriate indices) ham_oz - orbital Zeeman (instead of zeeman with appropriate indices) ham_zf - zero-field term (instead of zfield) ham_ee - electron-electron (instead of eeint) ham_nn - nucleus-nucleus (instead of nnint) ham_hf - hyperfine (instead of hfine) ham_nq - nuclear quadrupole (instead of nquad) ham_so - spin-orbit (instead of soint) ham_ez_ho - high-order Zeeman (instead of zeemanho) ham_cf- crystal field (instead of crystalfield)

Most of these functions (except zeeman) are currently only called in sham.

Pros:

Cons:

stestoll commented 2 years ago

Alternative (suggested by @cetait): Use a single function with an (optional) parameter specifying the interaction:

ham(Sys)
ham(Sys,B)

ham(Sys,"ez")
ham(Sys,"ez",e)
ham(Sys,"nz")
ham(Sys,"nz",n)
ham(Sys,"oz")
ham(Sys,"oz",o)

ham(Sys,"zf")
ham(Sys,"zf",e)

ham(Sys,"hf")
ham(Sys,"hf",[e n])

ham(Sys,"ee")
ham(Sys,"ee",[e1 e2])

ham(Sys,"nq")
ham(Sys,"nq",n)

ham(Sys,"nn")
ham(Sys,"nn",[n1 n2])

ham(Sys,"so")
ham(Sys,"so",[e o])

ham(Sys,"cf")
ham(Sys,"cf",o)

ham(Sys,"ezho")
ham(Sys,"ezho",o)
ham(Sys,"ezho",o,lB)

ham(__,"sparse")