Code Monkey home page Code Monkey logo

atomicstructure.jl's Introduction

AtomicStructure.jl

https://img.shields.io/badge/docs-stable-blue.svg https://img.shields.io/badge/docs-dev-blue.svg https://github.com/JuliaAtoms/AtomicStructure.jl/workflows/CI/badge.svg https://codecov.io/gh/JuliaAtoms/AtomicStructure.jl/branch/master/graph/badge.svg

This library provides structures for representing atoms as linear combinations of single-particle orbitals.

Usage

The radial coordinate is represented using a basis function expansion that fulfils the ContinuumArrays.jl interface. The examples below use CompactBases.jl, but AtomicStructure.jl is not dependent on which basis you choose.

using AtomicStructure
using AtomicLevels
using CompactBases

Grid setup

The grid can be tailored to a specific nucleus, which is why we first decide the nuclear potential to be used, in this case a point charge corresponding to helium:

nucleus = pc"He"
Z = 2 [He]
rₘₐₓ = 300
ρ = 0.25 # Discretization interval
N = ceil(Int, rₘₐₓ/ρ + 1/2)
# Finite-difference scheme that accounts for the boundary condition at
# r = 0
R = StaggeredFiniteDifferences(N, ρ, float(charge(nucleus)))
Radial finite differences basis {Float64} on 0.125..300.125 (formally 0..300.125) with 1201 points spaced by ρ = 0.25

Different atoms

Non-relativistic helium, one configuration state function, the orbitals are automatically initialized to their hydrogenic values:

Atom(R, csfs(c"1s2"), nucleus, verbosity=3)
⎡ Hydrogenic initialization of the orbitals of Atom{Float64,RadialDifferences{Float64,Int64}}(Z = 2 [He]) with 1 CSF
⎢ ⎡ Diagonalizing symmetry ℓ = s, maximum n = 1 => 1 eigenvalues required
⎢ ⎢ Target eigenvalue: ≤ -2.0 Ha
⎢ ⎢ Diagonalizing via arnoldi_shift_invert
⎢ ⎢ Schur values: [0.49955]
⎢ ⎢ Hydrogenic energies [-1.9981975] Ha
⎢ ⎢ Analytic energies   [-2.0000000] Ha
⎢ ⎣ Δ                   [+1.803e-03] Ha
⎢ 
⎢ [ Initial norm of 1s: 0.500000, 1-normalized: 5.000000e-01
⎣ 

Atom{Float64,RadialDifferences{Float64,Int64}}(Z = 2 [He]) with 1 CSF: 1s²(₀¹S|¹S)+

Non-relativistic, with the 2s,2p,3s,3p,3d orbitals as possible correlation orbitals:

Atom(R, csfs(excited_configurations(c"1s2", os"2[s-p]"..., os"3[s-d]"...)), nucleus, verbosity=3)
⎡ Hydrogenic initialization of the orbitals of Atom{Float64,RadialDifferences{Float64,Int64}}(Z = 2 [He]) with 32 CSFs
⎢ ⎡ Diagonalizing symmetry ℓ = s, maximum n = 3 => 3 eigenvalues required
⎢ ⎢ Target eigenvalue: ≤ -2.0 Ha
⎢ ⎢ Diagonalizing via arnoldi_shift_invert
⎢ ⎢ Schur values: [0.49955, 0.285767, 0.264747]
⎢ ⎢ Hydrogenic energies [-1.9981975, -0.5006417, -0.2228092] Ha
⎢ ⎢ Analytic energies   [-2.0000000, -0.5000000, -0.2222222] Ha
⎢ ⎣ Δ                   [+1.803e-03, -6.417e-04, -5.870e-04] Ha
⎢ 
⎢ ⎡ Diagonalizing symmetry ℓ = d, maximum n = 3 => 1 eigenvalues required
⎢ ⎢ Target eigenvalue: ≤ -0.2222222222222222 Ha
⎢ ⎢ Diagonalizing via arnoldi_shift_invert
⎢ ⎢ Schur values: [4.5007]
⎢ ⎢ Hydrogenic energies [-0.2222567] Ha
⎢ ⎢ Analytic energies   [-0.2222222] Ha
⎢ ⎣ Δ                   [-3.448e-05] Ha
⎢ 
⎢ ⎡ Diagonalizing symmetry ℓ = p, maximum n = 3 => 2 eigenvalues required
⎢ ⎢ Target eigenvalue: ≤ -0.5 Ha
⎢ ⎢ Diagonalizing via arnoldi_shift_invert
⎢ ⎢ Schur values: [1.99957, 1.28594]
⎢ ⎢ Hydrogenic energies [-0.4998912, -0.2223581] Ha
⎢ ⎢ Analytic energies   [-0.5000000, -0.2222222] Ha
⎢ ⎣ Δ                   [+1.088e-04, -1.359e-04] Ha
⎢ 
⎢ ⎡ Initial norm of 1s: 0.500000, 1-normalized: 5.000000e-01
⎢ ⎢ Initial norm of 2s: 0.500000, 1-normalized: 5.000000e-01
⎢ ⎢ Initial norm of 2p: 0.500000, 1-normalized: 5.000000e-01
⎢ ⎢ Initial norm of 3s: 0.500000, 1-normalized: 5.000000e-01
⎢ ⎢ Initial norm of 3p: 0.500000, 1-normalized: 5.000000e-01
⎢ ⎣ Initial norm of 3d: 0.500000, 1-normalized: 5.000000e-01
⎣ 

Atom{Float64,RadialDifferences{Float64,Int64}}(Z = 2 [He]) with 32 CSFs:
32-element Array{CSF{Orbital,IntermediateTerm,Term},1}:
 1s²(₀¹S|¹S)+          
 1s(₁²S|²S) 2s(₁²S|¹S)+
 1s(₁²S|²S) 2s(₁²S|³S)+
 1s(₁²S|²S) 3s(₁²S|¹S)+
 1s(₁²S|²S) 3s(₁²S|³S)+
 1s(₁²S|²S) 3d(₁²D|¹D)+
 1s(₁²S|²S) 3d(₁²D|³D)+
 2s²(₀¹S|¹S)+          
 2s(₁²S|²S) 3s(₁²S|¹S)+
 2s(₁²S|²S) 3s(₁²S|³S)+
 2s(₁²S|²S) 3d(₁²D|¹D)+
 ⋮                     
 3s²(₀¹S|¹S)+          
 3s(₁²S|²S) 3d(₁²D|¹D)+
 3s(₁²S|²S) 3d(₁²D|³D)+
 3p²(₀¹S|¹S)+          
 3p²(₂¹D|¹D)+          
 3p²(₂³P|³P)+          
 3d²(₀¹S|¹S)+          
 3d²(₂¹D|¹D)+          
 3d²(₂¹G|¹G)+          
 3d²(₂³P|³P)+          
 3d²(₂³F|³F)+

TODO/Ideas

  • [ ] Multiple eigenvalues per symmetry and/or Lagrange multipliers for orthogonality
  • [ ] Warn if core modelled by potential differs too much from core of configuration(s) to optimize
    • [ ] Optimize “frozen” orbitals as well
  • [ ] Virial theorem V/T = -2 as accuracy indicator
  • [ ] Number of eigenvalues required per equation
  • [ ] Tabulate bound spectra
  • [ ] Extension of atom
    • [ ] onto larger grid
    • [ ] more configurations (e.g. continuum)
  • [ ] Evaluate smaller effect [eg. (hyper)fine structure] by inclusion of new operators
    • [ ] via perturbation theory
      • [ ] tests of accuracy using analytic perturbation theory formulas, e.g. hyperfine splitting of Rb in magnetic fields.
    • [ ] reoptimization of orbitals (requires expansion of basis, if not working with spin-orbitals)
  • [ ] Generalize atomic operators
    • [ ] AbstractAtomicOperator
    • [ ] DiagonalIntegral
    • [ ] RepulsionIntegral
    • [ ] MultipoleInteraction
    • [ ] Spin–orbit interaction
    • [ ] &c.
  • [ ] Generalize notion of energy expression to derive arbitrary equations of motion, either for optimization of orbitals or for time propagation.

atomicstructure.jl's People

Contributors

github-actions[bot] avatar jagot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.