Skip to main content

pyLGS

pyLGS performs simulations of the atomic physics of cw, modulated, and pulsed laser guide stars. The effects of the full atomic structure, atomic velocity distribution, one or multiple pump fields, the geomagnetic field, velocity-changing and spin-randomizing collisions, and atomic recoil are all taken into account.

Installation

pyLGS can be installed with pip:

pip install pylgs

How to use

Import the package:

from pylgs.lgssystem import LGSSystem

List available atomic systems for an LGS model:

LGSSystem.builtins()
['Na330',
 'Na589+569',
 'Na589+569+repump',
 'NaD1',
 'NaD1_Toy',
 'NaD2',
 'NaD2_Repump']

Show a level diagram for one of the atomic systems:

LGSSystem.diagram("NaD2_Repump", "ToScale")

Print some information about the system:

LGSSystem.info("NaD2_Repump")

Atomic levels

$\text{3S}{\frac{1}{2}}$, $\text{3P}{\frac{3}{2}}$

Pump transitions

  1. $\text{3S}{\frac{1}{2}}\land F=1\to \text{3P}{\frac{3}{2}}$
  2. $\text{3S}{\frac{1}{2}}\land F=2\to \text{3P}{\frac{3}{2}}$

Transition wavelengths

  • $\text{3P}{\frac{3}{2}}\to \text{3S}{\frac{1}{2}}$: 589.158 nm

Substructure

  • Hyperfine structure included
  • Zeeman structure included
  • 24 total sublevels

Density matrix elements

  • All populations included
  • All Zeeman coherences (between same level and same F) included
  • All hyperfine coherences (between same level and different F) neglected
  • Optical coherences (between different levels) included for pump transitions only
  • 374 total density matrix elements

Input parameters

  • BeamTransitRatePerS
  • BFieldG
  • MagneticAzimuthDegrees
  • MagneticZenithDegrees
  • RecoilParameter
  • SDampingCollisionRatePerS
  • TemperatureK
  • VccRatePerS
  • DetuningHz1
  • DetuningHz2
  • EllipticityDegrees1
  • EllipticityDegrees2
  • IntensitySI1
  • IntensitySI2
  • LaserWidthHz1
  • LaserWidthHz2
  • PolarizationAngleDegrees1
  • PolarizationAngleDegrees2

Load the atomic system and set values for parameters that will not be varied:

lgs = LGSSystem(
    'NaD2_Repump', 
    {
        'EllipticityDegrees1': 45.,
        'PolarizationAngleDegrees1': 0,
        'DetuningHz1': 1.0832e9,
        'LaserWidthHz1': 10.0e6,
        'EllipticityDegrees2': 45.,
        'PolarizationAngleDegrees2': 0,
        'DetuningHz2': -6.268e8 + 1.e8,
        'LaserWidthHz2': 10.0e6,
        'MagneticZenithDegrees': 45.,
        'MagneticAzimuthDegrees': 45.,
        'SDampingCollisionRatePerS': 4081.63,
        'BeamTransitRatePerS': 131.944,
        'VccRatePerS': 28571.,
        'TemperatureK': 185.,
        'RecoilParameter': 1
    }
)

Define sample values for the varying parameters:

params = {'IntensitySI1': 5., 'IntensitySI2': 46., 'BFieldG': 0.5}

Build a steady-state model with adaptively refined velocity groups based on the sample parameters:

model, sol = lgs.adaptive_stationary_model(params, rtol=.002)

Find the total return flux:

model.total_flux(sol).item()
7728.733460031644

Plot the return flux as a function of atomic velocity:

model.flux_distribution(sol).visualize(markers=True)

Plot the ground and excited state populations as a function of atomic velocity:

model.level_population_distribution(sol).visualize()

Plot the real and imaginary parts of all density-matrix elements:

model.velocity_normalize(sol).visualize(line_width=1)

LGS systems

The LGS system models are based on systems of equations generated using the AtomicDensityMatrix package for Mathematica, together with an add-on package that has not yet been released, but will be available in the near future. If you are interested in modeling an LGS scheme that is not currently available as a built-in system, you can create an issue describing it and I will consider adding it as a built-in.

Development

pyLGS is developed with the nbdev system for “literate” programming1 using Jupyter notebooks. The source code, documentation source, and tests are co-mingled in Jupyter notebooks (.ipynb files) contained in the nbs directory. The source code is exported to create the module (.py) files in the pylgs directory. Documentation is generated from the Jupyter notebooks using the Quarto publishing system. Tests are run by batch evaluation of the notebooks.

Copyright © 2023 onward Simon Rochester (Rochester Scientific, LLC). Licensed under the GNU General Public License - Version 3 (the “License”); you may not use this project’s files except in compliance with the License. A copy of the License is provided in the LICENSE file in this repository.

  1. or possibly “semi-literate” programming ↩

Metadata

Release files for pylgs 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pylgs 0.5.0
File Size Uploaded
pylgs-0.5.0.tar.gz 20.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for pylgs 0.5.0
File Interpreter ABI Platform
pylgs-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.0 MB

Release files / pylgs-0.5.0.tar.gz

Download URL pylgs-0.5.0.tar.gz
Size 20.8 MB
Tags Source
SHA-256 checksum
How to use checksums
c28abb2e5dfbaed1c4d8f7066a14324485faa68127c36ab94d7283ee5f67ef1b
BLAKE2b-256 checksum
How to use checksums
f8da379adb7af94e8a338833487606f421688e275e9bb113988f9a9b546cf341
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pylgs-0.5.0-py3-none-any.whl

Download URL pylgs-0.5.0-py3-none-any.whl
Size 1.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
08693e6e1a8d351f88440d71a569a576827a43066433c1b31ea438dc8193e296
BLAKE2b-256 checksum
How to use checksums
c667e01271734d718be5dd8333a739bf8115cfb710176767a1499a7fd3731548
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page