laserfields 0.4.0__tar.gz → 0.4.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- laserfields-0.4.2/.github/workflows/python-package.yml +36 -0
- laserfields-0.4.2/PKG-INFO +59 -0
- laserfields-0.4.2/README.md +44 -0
- laserfields-0.4.2/examples/examples.ipynb +456 -0
- laserfields-0.4.2/laserfields/__init__.py +35 -0
- laserfields-0.4.2/laserfields/laserfields.py +405 -0
- {laserfields-0.4.0 → laserfields-0.4.2}/pyproject.toml +5 -0
- laserfields-0.4.2/tests/__init__.py +0 -0
- laserfields-0.4.2/tests/laserdat.dat +701 -0
- laserfields-0.4.2/tests/test_all.py +138 -0
- laserfields-0.4.0/PKG-INFO +0 -45
- laserfields-0.4.0/README.md +0 -31
- laserfields-0.4.0/examples/examples.ipynb +0 -383
- laserfields-0.4.0/laserfields/__init__.py +0 -11
- laserfields-0.4.0/laserfields/laserfields.py +0 -364
- {laserfields-0.4.0 → laserfields-0.4.2}/.gitignore +0 -0
- {laserfields-0.4.0 → laserfields-0.4.2}/LICENSE +0 -0
- {laserfields-0.4.0 → laserfields-0.4.2}/examples/laserdat.dat +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
|
|
2
|
+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
|
|
3
|
+
|
|
4
|
+
name: Python package
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches: [ "main" ]
|
|
9
|
+
pull_request:
|
|
10
|
+
branches: [ "main" ]
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
strategy:
|
|
17
|
+
fail-fast: false
|
|
18
|
+
matrix:
|
|
19
|
+
python-version: ["3.9", "3.10", "3.11"]
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
- uses: chartboost/ruff-action@v1
|
|
24
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
25
|
+
uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: ${{ matrix.python-version }}
|
|
28
|
+
cache: 'pip'
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
run: |
|
|
31
|
+
python -m pip install --upgrade pip
|
|
32
|
+
python -m pip install pytest flit
|
|
33
|
+
flit install --only-deps
|
|
34
|
+
- name: Test with pytest
|
|
35
|
+
run: |
|
|
36
|
+
pytest
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: laserfields
|
|
3
|
+
Version: 0.4.2
|
|
4
|
+
Summary: Python library for describing time-dependent laserfields by Johannes Feist.
|
|
5
|
+
Author-email: Johannes Feist <johannes.feist@gmail.com>
|
|
6
|
+
Requires-Python: >=3.7
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: numpy >=1.15
|
|
11
|
+
Requires-Dist: scipy >=1.0
|
|
12
|
+
Requires-Dist: numba >=0.49
|
|
13
|
+
Project-URL: Home, https://github.com/jfeist/pylaserfields
|
|
14
|
+
|
|
15
|
+
# laserfields
|
|
16
|
+
|
|
17
|
+
`laserfields` is a python library to describe the time-dependent electric fields
|
|
18
|
+
of a laser pulse, and can be installed with `pip install laserfields` or `conda
|
|
19
|
+
-c conda-forge install laserfields`. It implements the same pulse shapes and
|
|
20
|
+
most of the features of the [laserfields
|
|
21
|
+
library](https://github.com/jfeist/laserfields) written in Fortran (and as the
|
|
22
|
+
Julia variant [LaserFields.jl](https://github.com/jfeist/LaserFields.jl)),
|
|
23
|
+
please see the documentation of that library for the parameter meanings,
|
|
24
|
+
conventions used, etc. In particular, the "main" function
|
|
25
|
+
`make_laserfield(**kwargs...)` accepts the same parameters as the Fortran
|
|
26
|
+
library parameter files as keyword arguments, and returns an instance of a
|
|
27
|
+
subtype of the base class `LaserField` depending on the parameters. E.g., to
|
|
28
|
+
create a Gaussian pulse with a duration (defined as the FWHM of the intensity)
|
|
29
|
+
of 6 fs, a wavelength of 800 nm, a peak intensity of 1e14 W/cm^2, and with the
|
|
30
|
+
peak at time t=7fs, one should call
|
|
31
|
+
```python
|
|
32
|
+
lf = make_laserfield(form="gaussianI", is_vecpot=true, lambda_nm=800,
|
|
33
|
+
intensity_Wcm2=1e16, duration_as=6000, peak_time_as=7000)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Given a `LaserField` instance `lf`, the functions `lf.E(t)`,
|
|
37
|
+
`lf.E_fourier(ω)`, `lf.A(t)`, and `lf.A_fourier(ω)` can be used to obtain,
|
|
38
|
+
respectively, the electric field as a function of time, its Fourier transform
|
|
39
|
+
(implemented for most pulse shapes), the vector potential as a function of time,
|
|
40
|
+
and its Fourier transform. Calling the instance as a function, `lf(t)` returns
|
|
41
|
+
the electric field, i.e., is equivalent to `lf.E(t)`. The notebooks in the
|
|
42
|
+
`examples` folder show some ways to use the library, including how to define a
|
|
43
|
+
set of fields through a YAML configuration file.
|
|
44
|
+
|
|
45
|
+
In addition to the pulses described by each `LaserField` instance, the library
|
|
46
|
+
also implements a `LaserFieldCollection` class that can be used to combine
|
|
47
|
+
multiple fields into a single effective one (i.e., the sum of the individual
|
|
48
|
+
ones). It is also a `LaserField` instance and supports much of the same
|
|
49
|
+
interface. Note that some of the parameters it contains are just "best-effort"
|
|
50
|
+
values and may not be fully meaningful for the combined field - e.g., for the
|
|
51
|
+
carrier frequency `lf.ω0`, it returns the highest value in the collection, to
|
|
52
|
+
support use cases where this is used to define maximum time step in a numerical
|
|
53
|
+
propagation, or the maximum frequency evaluated in a Fourier transform.
|
|
54
|
+
|
|
55
|
+
The "effective" duration of the pulse for n-photon processes can be obtained as
|
|
56
|
+
`lf.Teff(n_photon)`, which is the integral over the pulse intensity envelope to
|
|
57
|
+
the n-th power (i.e., electric field envelope to the (2n)th power)
|
|
58
|
+
over the pulse, see, e.g., https://doi.org/10.1103/PhysRevA.77.043420 (Eq. 14).
|
|
59
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# laserfields
|
|
2
|
+
|
|
3
|
+
`laserfields` is a python library to describe the time-dependent electric fields
|
|
4
|
+
of a laser pulse, and can be installed with `pip install laserfields` or `conda
|
|
5
|
+
-c conda-forge install laserfields`. It implements the same pulse shapes and
|
|
6
|
+
most of the features of the [laserfields
|
|
7
|
+
library](https://github.com/jfeist/laserfields) written in Fortran (and as the
|
|
8
|
+
Julia variant [LaserFields.jl](https://github.com/jfeist/LaserFields.jl)),
|
|
9
|
+
please see the documentation of that library for the parameter meanings,
|
|
10
|
+
conventions used, etc. In particular, the "main" function
|
|
11
|
+
`make_laserfield(**kwargs...)` accepts the same parameters as the Fortran
|
|
12
|
+
library parameter files as keyword arguments, and returns an instance of a
|
|
13
|
+
subtype of the base class `LaserField` depending on the parameters. E.g., to
|
|
14
|
+
create a Gaussian pulse with a duration (defined as the FWHM of the intensity)
|
|
15
|
+
of 6 fs, a wavelength of 800 nm, a peak intensity of 1e14 W/cm^2, and with the
|
|
16
|
+
peak at time t=7fs, one should call
|
|
17
|
+
```python
|
|
18
|
+
lf = make_laserfield(form="gaussianI", is_vecpot=true, lambda_nm=800,
|
|
19
|
+
intensity_Wcm2=1e16, duration_as=6000, peak_time_as=7000)
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Given a `LaserField` instance `lf`, the functions `lf.E(t)`,
|
|
23
|
+
`lf.E_fourier(ω)`, `lf.A(t)`, and `lf.A_fourier(ω)` can be used to obtain,
|
|
24
|
+
respectively, the electric field as a function of time, its Fourier transform
|
|
25
|
+
(implemented for most pulse shapes), the vector potential as a function of time,
|
|
26
|
+
and its Fourier transform. Calling the instance as a function, `lf(t)` returns
|
|
27
|
+
the electric field, i.e., is equivalent to `lf.E(t)`. The notebooks in the
|
|
28
|
+
`examples` folder show some ways to use the library, including how to define a
|
|
29
|
+
set of fields through a YAML configuration file.
|
|
30
|
+
|
|
31
|
+
In addition to the pulses described by each `LaserField` instance, the library
|
|
32
|
+
also implements a `LaserFieldCollection` class that can be used to combine
|
|
33
|
+
multiple fields into a single effective one (i.e., the sum of the individual
|
|
34
|
+
ones). It is also a `LaserField` instance and supports much of the same
|
|
35
|
+
interface. Note that some of the parameters it contains are just "best-effort"
|
|
36
|
+
values and may not be fully meaningful for the combined field - e.g., for the
|
|
37
|
+
carrier frequency `lf.ω0`, it returns the highest value in the collection, to
|
|
38
|
+
support use cases where this is used to define maximum time step in a numerical
|
|
39
|
+
propagation, or the maximum frequency evaluated in a Fourier transform.
|
|
40
|
+
|
|
41
|
+
The "effective" duration of the pulse for n-photon processes can be obtained as
|
|
42
|
+
`lf.Teff(n_photon)`, which is the integral over the pulse intensity envelope to
|
|
43
|
+
the n-th power (i.e., electric field envelope to the (2n)th power)
|
|
44
|
+
over the pulse, see, e.g., https://doi.org/10.1103/PhysRevA.77.043420 (Eq. 14).
|