clavigne / FLIPT.jl

Proof-of-concept code for https://arxiv.org/pdf/1907.07734.pdf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Code for “An efficient spectral method for numerical time-dependent perturbation theory”

This is proof-of-concept code for the paper, which can be obtained at https://arxiv.org/pdf/1907.07734.pdf.

The algorithm is entirely located in NLSolve.jl. Starting with the matrix mu for the transition dipole moments in the eigenbasis, the vector of eigenenergies e0 and the initial density matrix rho0, you can compute a nonlinear response using,

include("NLSolve.jl")
include("GaussianField.jl")

# initialize state
y0 = NLSolve.steady_state(rho0 , T)

# make an evaluator for the Green's function
ħ = 0.6582119514
G! = NLSolve.make_G!(e0, ħ=ħ)


# make a pump field
w0 = wpump
sigma = fwhm2sigma(FWHMpump)
et, ew = make_gaussian_field(1.0, w0, sigma)
wmin = w0-4*sigma
wmax = w0+4*sigma
pump = NLSolve.Interaction([wmin], [wmax], [ew], [false])
cpump = NLSolve.compile_interaction(pump + conj(pump), y0)

# Compute first order
y1 = NLSolve.V!(y0, mu, ħ=ħ)
y1 = NLSolve.E(y1, cpump)
y1 = G!(y1)

# Compute second order
y2 = NLSolve.V!(y1, mu, ħ=ħ)
y2 = NLSolve.E(y2, cpump)
y2 = G!(y2)

# Save the density matrix at time times[i] in output[:,:,i]
NLSolve.at_t!(output[:,:,i], y2, times[i])

The code in this repo is extremely rough, as is often the case when produced by a finishing PhD student… It should be taken more as a guide on how to implement the method than as a working program.

Examples from the paper

Scaling analysis on a Λ-system

To run the scaling analysis shown in Figs. 1-3, execute the script lambda_system.jl using

julia lambda_system.jl

This will produce the data required to make the graphs, which can be processed as described below. You’ll need a bunch of RAM (24 Gb or so) to run the final scaling analysis.

Pyrazine spectroscopy

To produce the pyrazine spectroscopic experiments shown in Figs. 4-6, you need to first build the requisite Hamiltonian using

julia pyr2_build.jl

Then, compute the spectroscopic experiments using

julia pyrazine_spectra.jl

This code will compute linear, TA and CARS spectra.

Plots

To reproduce the plots of the paper from these results, use

julia process_outputs.jl

which will compile the data from the .jld files into HDF5 for plotting with python. The python plots can be generated using

python graphs.py

License

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org/>

About

Proof-of-concept code for https://arxiv.org/pdf/1907.07734.pdf


Languages

Language:Julia 75.9%Language:Python 24.1%