0

1

0

1

# +EMAIL: stefanos.carlstrom@gmail.com

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

mkpath("images")

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

# +RESULTS:

: 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

04/30/2018

2 months ago

51 commits