Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# from: https://discourse.julialang.org/t/easy-workflow-file-for-setting-up-github-actions-ci-for-your-julia-package/49765
name: CI
on:
pull_request:
branches:
- main
push:
branches:
- main
tags: '*'
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.7' # The minimum Julia version that your package supports. E.g. if your package requires Julia 1.5 or higher, change this to '1.5'.
- '1' # Leave this line unchanged. '1' will automatically expand to the latest stable 1.x release of Julia.
- 'nightly'
os:
- ubuntu-latest
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- run: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- run: |
julia --project=docs -e '
using Documenter: doctest, DocMeta
using MoleculeSpectrum
DocMeta.setdocmeta!(MoleculeSpectrum, :DocTestSetup, :(using MoleculeSpectrum;); recursive=true)
doctest(MoleculeSpectrum)'
- run: julia --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 JILA KRb Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

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 OR COPYRIGHT HOLDERS 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.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# MoleculeSpectrum.jl

[![CI Actions Status](https://github.com/cal-miller-harvard/MoleculeSpectrum/actions/workflows/ci.yml/badge.svg)](https://github.com/cal-miller-harvard/MoleculeSpectrum/actions)

Compute the energy levels of diatomic ${}^{1} \Sigma$ molecules in magnetic, electric, and optical fields.

Documentation is available [here](https://cal-miller-harvard.github.io/MoleculeSpectrum).

# Todo
- [x] Add transition strengths
- [ ] Dump to file, and/or dataframes?
- [ ] Graphing
- [x] Improve code organization
- [ ] Documentation
- [ ] Make it build!
- [x] Documentation
- [x] Make it build!
- [ ] Finish documenting all functions
- [ ] Document units of all numeric quantities
- [ ] Remove unnecessary types in function arguments (?)
- [ ] API ergonomics
- [x] ExternalFields
Expand Down
3 changes: 1 addition & 2 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[deps]
HalfIntegers = "f0d1745a-41c9-11e9-1dd9-e5d34d218721"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
MoleculeSpectrum = "35893526-f1dd-48d2-8180-97f6707ed43b"
WignerSymbols = "9f57e263-0b3d-5e2e-b1be-24f2bb48858b"
23 changes: 18 additions & 5 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
push!(LOAD_PATH,"../src/")

using Documenter, MoleculeSpectrum

makedocs(sitename="MoleculeSpectrum documentation")
push!(LOAD_PATH,"../src/")

using Documenter, MoleculeSpectrum

makedocs(
sitename="MoleculeSpectrum Documentation",
format = Documenter.HTML(
prettyurls = get(ENV, "CI", nothing) == "true"
),
pages = [
"MoleculeSpectrum" => "index.md",
"API Documentation" => "api.md"
]
)

deploydocs(
repo = "github.com/cal-miller-harvard/MoleculeSpectrum.jl.git", #TODO: Change to your username
)
109 changes: 109 additions & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# MoleculeSpectrum.jl API Documentation

```@meta
CurrentModule = MoleculeSpectrum
DocTestSetup = quote
using MoleculeSpectrum
end
```

## Contents
```@contents
Pages = ["api.md"]
Depth = 4
```

## Molecular Parameters
### Molecular Parameters
```@docs
MolecularParameters
KRb_Parameters_Neyenhuis
KRb_Parameters_Ospelkaus
DEFAULT_MOLECULAR_PARAMETERS
TOY_MOLECULE_PARAMETERS
```
### Polarizability Parameters
```@docs
Polarizability
KRb_Polarizability
```
### Zeeman Parameters
```@docs
ZeemanParameters
KRb_Zeeman
```
### Nuclear Parameters
```@docs
NuclearParameters
KRb_Nuclear_Neyenhuis
KRb_Nuclear_Ospelkaus
```

## Vectors and Tensors
### Spherical vectors
```@docs
SphericalVector
VectorX
VectorY
VectorZ
```
### Unit vectors
```@docs
SphericalUnitVector
UnitVectorX
UnitVectorY
UnitVectorZ
```
### Tensors
```@docs
T⁽¹⁾
T⁽²⁾
get_tensor_component
tensor_dot
```

## States
### Types
```@docs
State
KRbState
```
### Functions
```@docs
index_to_state
state_to_index
order_by_overlap_with
max_overlap_with
find_closest_basis_state
decompose_to_basis_states
```

## Fields
```@docs
ExternalFields
DEFAULT_FIELDS
TEST_FIELDS
```

## Hamiltonians
```@docs
hamiltonian
HamiltonianParts
make_hamiltonian_parts
make_krb_hamiltonian_parts
```

## Spectra and Analysis
```@docs
Spectrum
calculate_spectrum
get_energy
get_energy_difference
find_transition_strengths
plot_transition_strengths
calculate_dipolar_interaction
```

## Index
```@index
```
36 changes: 21 additions & 15 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
```@meta
CurrentModule = MoleculeSpectrum
```

```@docs
State(N, mₙ, I₁, mᵢ₁, I₂, mᵢ₂)
```

```@docs
plot_transition_strengths(spectrum::Spectrum, g::State, frequency_range; polarization::SphericalUnitVector=Unpolarized())
```

```@docs
transition_strengths(spectrum::Spectrum, g::State, frequency_range; polarization::SphericalUnitVector=Unpolarized())
```
# MoleculeSpectrum.jl

Computes the energy levels of diatomic ${}^{1} \Sigma$ molecules in magnetic, electric, and optical fields.

# Todo
- [x] Add transition strengths
- [ ] Dump to file, and/or dataframes?
- [ ] Graphing
- [x] Improve code organization
- [ ] Documentation
- [ ] Make it build!
- [ ] Remove unnecessary types in function arguments (?)
- [ ] API ergonomics
- [x] ExternalFields
- [ ] Get dipole matrix elements
- [ ] More generally... inspect any matrix element?
- [ ] Make more `calculate` functions polymorphic over `State`, eigenstate index, etc
- [ ] ...
- [x] Switch to `get_eigenstates` function
- [x] Explicitly type fields of all structs
- [ ] Many more tests!!!
Loading