+TITLE: ElectricFields.jl

+AUTHOR: Stefanos Carlström

+EMAIL: stefanos.carlstrom@gmail.com

[[https://travis-ci.org/jagot/ElectricFields.jl][https://travis-ci.org/jagot/ElectricFields.jl.svg?branch=master]] [[https://coveralls.io/github/jagot/ElectricFields.jl?branch=master][https://coveralls.io/repos/github/jagot/ElectricFields.jl/badge.svg?branch=master]] [[https://codecov.io/gh/jagot/ElectricFields.jl][https://codecov.io/gh/jagot/ElectricFields.jl/branch/master/graph/badge.svg]]

+PROPERTY: header-args:julia :session julia-README

A small Julian DSL for defining electrical fields, chiefly for use in atomic physics calculations.

This is a [[https://github.com/jagot/LiterateOrg.jl][LiterateOrg.jl]] project. The documentation is found [[file:src/ElectricFields.org][within the code]].

+BEGIN_SRC julia :exports none

using Unitful using PyPlot matplotlib[:style]:use


function savefig_f(filename) filename = "./images/$(filename).svg" savefig(filename, transparent=true) filename end



: savefig_f (generic function with 1 method)

  • Usage First we load the library and set the base units, which are used if unitless quantities are passed to =@field=, below. The units are defined in the fashion of [[https://github.com/ajkeller34/Unitful.jl][Unitful.jl]]. #+BEGIN_SRC julia :exports code using ElectricFields

# These are the default base units, so setting these is actually not # necessary, if you are happy with the defaults. @set_base_units() do λ = u"nm" I₀ = u"W/cm^2" τ = u"fs" end #+END_SRC

#+RESULTS: : nothing

We can now define a field, which we name =IR=, using the =@field= macro: #+BEGIN_SRC julia :exports both :results value verbatim @field(IR) do λ = 800.0 I₀ = 1e14 τ = 6.2 Tmax = 10 end #+END_SRC

#+RESULTS: : Linearly polarized field with a : Fixed carrier @ λ = 800.00 nm (T = 2.67 fs) and a : I₀ = 1e+14 cm^-2 W Gaussian envelope of duration 6.2 fs (intensity FWHM; ±10.14σ)

More usage examples are found [[file:src/ElectricFields.org][within the code]].

  • Ideas
    • Harmonic fields
    • Chirped/dispersed fields
    • Elliptically polarized fields

First Commit


Last Touched

10 months ago


51 commits

Used By: