The Jaynes-Cummings model (JCM) is a solvable fully quantum mechanical model of an atom in a field. It was first used in 1963 to examine the classical aspects of spontaneous emission and to reveal the existence of Rabi oscillations in atomic excitation probabilities for fields with sharply defined energy (or photon number). For fields having a statistical distribution of photon numbers the oscillations collapse to an expected steady value. In 1980 it was discovered that with appropriate initial conditions (e.g. a near-classical field), the Rabi oscillations would eventually revive, only to collapse and revive repeatedly in a complicated pattern. The existence of these revivals, present in the analytic solutions of the JCM, provided direct evidence for the discreteness of field excitation (photons) and hence for the truly quantum nature of radiation. The relative simplicity of the JCM and the ease with which it can be extended through analytic expressions or numerical computation continues to motivate attention. Here is presented a brief overview of this theory; if you are interested in learning more about the topic, I recommend reading these papers:
- Bruce W. Shore and Peter L. Knight. "The Jaynes-Cummings model". In: Journal of Modern Optics, vol. 40, no. 7, 1195-1238 (1993). DOI: 10.1080/09500349314551321. URL: https://www.researchgate.net/publication/243401964_The_Jaynes-Cummings_Model
- Fabio D. Bonani. "The Jaynes-Cummings model". (2020). URL: https://www.ifsc.usp.br/~strontium/Teaching/Material2020-1 SFI5814 Atomicamolecular/Fabio - Monograph - Jaynes-Cummings model.pdf
➡️ Check also this Notion page
To clone the repository type:
git clone https://github.com/soniasalomoni/Rabi_oscillations_JCM.git
cd Rabi_oscillations_JCM
To install the dependencies type the command:
pip install -r reqs.txt
To run a test, for example oracle_test.py
, type the command:
cd rabi_model
pytest tests/oracle_test.py
To run an example, for example example/ex_PDF_n
, type:
cd example/ex_PDF_n
chmod u+x job.sh
bash job.sh
The repository is structured in the following folders:
- rabi_model, which contains the actual package;
- examples, which shows two usages examples of the code.
This directory contains the definitions of the classes required to run the simulation.
Each class is a container that collects and organizes the input data according to a physical meaning and logic. This is the hierarchical structure of the classes:
➡️
Atom.py
This class stores the parameters that describe the state of the atom in the cavity:
Cg
: the initial ground state coefficient (float);Ce
: the initial excited state coefficient (float).These parameters should be positive, smaller than 1 and normalized.
➡️
Field.py
This class stores the parameters that describe the cavity field:
avg_n
: the average number of photons (integer);pdf_n
: the probability density function of photons (string);cut_n
: the cut-off number of photons) (integer).In addition, the class implements three physically relevant probability distributions of photons:
Dirac
,Poisson
, andBoseEinstein
.
➡️
System.py
This class stores a
Field
and anAtom
instances.
In addition, the class is enriched by two interaction parameters:
omega
: the interaction coupling (float);delta
: the interaction detuning (float).The class implements a set of complex differential equations through the
Rabi_model
method that models the time evolution of the system using the Jaynes-Cummings model Hamiltonian.
➡️
Simulation.py
This class contains a
System
instance and time information required to run a simulation on it:
time
: the simulation duration (float),tstep
: the simulation time step (float).In particular, it is defined an odeint-like function for complex-valued differential equations
odeintz
.
This folder contains several files that are required to run the simulation.
➡️
reading.py
This file handles the input reading.
In particular, a functionread_txt()
reads the parameter from a .txt file. By default, input.txt is the default input file but there is also the possibility to specify its name through the first argument.
➡️
plotting.py
This file handles the graphical visualization of the evolution of the inversion function.
The plot is saved as a .png file ifsave_png
in the input file is set toTrue
.
➡️
saving.py
This file handles the produces a .txt file containing the inversion function if
save_txt
in the input file is set toTrue
. These data can be used later on to do more complex plots.
In this folder, the main functions of the program are tested. The testing is mainly performed using the hypothesis library.
➡️
test_Atom.py
This test file checks if
Atom
istances are correctly initialized when valid states are given to the constructor, and viceversa, if errors are correctly raised when invalid states are provided.
➡️
test_Field.py
This test file checks if
Field
istances are correctly initialized when valid parameters are passed to the constructor, and viceversa, if errors are correctly raised when invalid parameters are provided. Moreover, a property test is performed on theDirac
,Poisson
, andBoseEinstein
methods.
➡️
test_System.py
This test file checks if
System
istances are correctly initialized when valid parameters are passed to the constructor, and viceversa, if errors are correctly raised when invalid parameters are provided. Moreover, it is tested the physical meaning of the atomic state time evolution determined by the model implemented in the class.
➡️
test_Simulation.py
This test file checks if
Simulation
istances are correctly initialized when valid parameters are passed to the constructor, and viceversa, if errors are correctly raised when invalid parameters are provided. Finally, it is tested that during the simulations the internal parameters evolve correctly or remain contant as expected
➡️
oracle_test.py
This test file checks if the numerical solution that we obtain executing the simulation is compatible with the analytical solution provided by the theory. With this test we make sure that the algorithm used to solve the complex-differential equation is correct. An analytical solution is only available in this simplified case; if we want to extend our model to effects not considered so far, the numerical solution becomes the only viable one.
Each example folder contains two files:
➡️
job.sh
The jobscript contains the setup information needed to automatize the run of
rabi.py
on different input files.
➡️
rabi.py
The python script performs the four steps (reading, running, plotting and saving) sequentially.
In this example, the jobscript runs rabi.py
changing the type of PDF pdf_n
(Dirac, Poisson, BoseEinstein) while keeping unchanged the rest of input parameters. The label of the output files are also modified accordingly in order to not override them.
In this example it is used the default input file name input.txt.
In this example the jobscript runs rabi.py
varying the average number of photons avg_n
(10, 30, 50) for a field in a coherent state (Poisson PDF) and keeping unchanged the rest of input parameters. The label of the output files are also modified accordingly in order to not override the files. One can modify the selected PDF to observe the different behavior of Rabi oscillations as a function of avg_n
.
In this example the input file name is changed according to the PDF used.