Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding config-style definitions for ion species properties #109

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: ['1']
julia-version: ['1', 'nightly']
julia-arch: [x64]
os: [ubuntu-latest, windows-latest, macOS-latest]
exclude:
Expand Down
3 changes: 0 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@ version = "0.5.0"
FunctionWrappers = "069b7b12-0de2-55c6-9aab-29f3d0a68a2e"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56"
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
PolynomialRoots = "3a141323-8675-5d76-9d11-e1df1406c778"
QuantumOptics = "6e0679c1-51ea-5a7c-ac74-d61b76210b0c"
QuantumOpticsBase = "4f57444f-1401-5e15-980d-4471b28d5678"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
WignerSymbols = "9f57e263-0b3d-5e2e-b1be-24f2bb48858b"
YAML = "ddb6d928-2868-570f-bddf-ab3f9cf99eb6"

Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ julia> using Pkg
julia> Pkg.add("IonSim")
julia> Pkg.add("IJulia")
```
The last line adds Jupyter compatibility, so you'll have the option to start a Julia kernel from Jupyter notebook. This is the suggested way
to interact with IonSim.
The last line adds Jupyter compatibility, so you'll have the option to start a Julia kernel from Jupyter notebook.

### Updating IonSim

Expand Down
36 changes: 36 additions & 0 deletions configs/ions/be9.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "Be9"
shortname: "⁹Be"
mass: 1.496508080073e-26
charge: 1
nuclearspin: 0.5
full_level_structure:
S1/2f=1: {n: 2, l: 0, j: 0.5, f: 1, E: 0.78126104631e+9}
S1/2f=2: {n: 2, l: 0, j: 0.5, f: 2, E: -0.468756627786e+9}
P1/2f=1: {n: 2, l: 1, j: 0.5, f: 1, E: 957.2010729076436e+12}
P1/2f=2: {n: 2, l: 1, j: 0.5, f: 2, E: 957.2008357076436e+12}
P3/2f=0: {n: 2, l: 1, j: 1.5, f: 0, E: 957.3965669467407e+12}
P3/2f=1: {n: 2, l: 1, j: 1.5, f: 1, E: 957.3965659267407e+12}
P3/2f=2: {n: 2, l: 1, j: 1.5, f: 2, E: 957.3965638867406e+12}
P3/2f=3: {n: 2, l: 1, j: 1.5, f: 3, E: 957.3965608267406e+12}
full_transitions:
- {from: S1/2f=1, to: P1/2f=1, multipole: E1, einsteinA: 19.4000000e+9}
- {from: S1/2f=1, to: P1/2f=2, multipole: E1, einsteinA: 19.4000000e+9}
- {from: S1/2f=2, to: P1/2f=1, multipole: E1, einsteinA: 19.4000000e+9}
- {from: S1/2f=2, to: P1/2f=2, multipole: E1, einsteinA: 19.4000000e+9}
- {from: S1/2f=1, to: P3/2f=0, multipole: E1, einsteinA: 19.4000000e+9}
- {from: S1/2f=1, to: P3/2f=1, multipole: E1, einsteinA: 19.4000000e+9}
- {from: S1/2f=1, to: P3/2f=2, multipole: E1, einsteinA: 19.4000000e+9}
- {from: S1/2f=2, to: P1/2f=1, multipole: E1, einsteinA: 19.4000000e+9}
- {from: S1/2f=2, to: P1/2f=2, multipole: E1, einsteinA: 19.4000000e+9}
- {from: S1/2f=2, to: P1/2f=3, multipole: E1, einsteinA: 19.4000000e+9}

# Optional fields
default_sublevel_selection:
- ["S1/2f=1", "all"]
- ["S1/2f=2", "all"]
- ["P1/2f=1", "all"]
- ["P1/2f=2", "all"]
- ["P3/2f=0", "all"]
- ["P3/2f=1", "all"]
- ["P3/2f=2", "all"]
- ["P3/2f=3", "all"]
28 changes: 28 additions & 0 deletions configs/ions/ca40.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Ca40"
shortname: "⁴⁰Ca"
mass: 6.635943757345042e-26
charge: 1
nuclearspin: 0
full_level_structure:
S1/2: {n: 4, l: 0, j: 0.5, f: 0.5 , E: 0.0}
D3/2: {n: 3, l: 2, j: 1.5, f: 1.5 , E: 4.09335071228e+14}
D5/2: {n: 3, l: 2, j: 2.5, f: 2.5 , E: 4.1115503183857306e+14}
P1/2: {n: 4, l: 1, j: 0.5, f: 0.5 , E: 7.554e+14}
P3/2: {n: 4, l: 1, j: 1.5, f: 1.5 , E: 7.621e+14}
full_transitions:
- {from: "S1/2", to: "D5/2", multipole: "E2", einsteinA: 8.562e-1}
- {from: "S1/2", to: "P1/2", multipole: "E1", einsteinA: 1.299e+8}
- {from: "D3/2", to: "P1/2", multipole: "E1", einsteinA: 1.060e+7}
- {from: "S1/2", to: "D3/2", multipole: "E2", einsteinA: 9.259e-1}
- {from: "S1/2", to: "P3/2", multipole: "E1", einsteinA: 1.351e+8}
- {from: "D3/2", to: "P3/2", multipole: "E1", einsteinA: 1.110e+6}
- {from: "D5/2", to: "P3/2", multipole: "E1", einsteinA: 9.901e+6}

# Optional fields
default_sublevel_selection:
- ["S1/2", "all"]
- ["D5/2", "all"]

gfactors:
S1/2: 2.00225664
D5/2: 1.2003340
37 changes: 37 additions & 0 deletions configs/ions/mg25.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "Mg25"
shortname: "²⁵Mg"
mass: 4.1489954812e-26
charge: 1
nuclearspin: 2.5
full_level_structure:
S1/2f=2: {n: 3, l: 0, j: 0.5, f: 2, E: 1.043445158e+9}
S1/2f=3: {n: 3, l: 0, j: 0.5, f: 3, E: -0.745317970e+9}
P1/2f=2: {n: 3, l: 1, j: 0.5, f: 2, E: 1069.3408690519877e+12}
P1/2f=3: {n: 3, l: 1, j: 0.5, f: 3, E: 1069.3405639519879e+12}
P3/2f=1: {n: 3, l: 1, j: 1.5, f: 1, E: 1072.0853411194748e+12}
P3/2f=2: {n: 3, l: 1, j: 1.5, f: 2, E: 1072.0853033394746e+12}
P3/2f=3: {n: 3, l: 1, j: 1.5, f: 3, E: 1072.0852466694748e+12}
P3/2f=4: {n: 3, l: 1, j: 1.5, f: 4, E: 1072.0851711094747e+12}

full_transitions:
- {from: "S1/2f=2", to: "P1/2f=2", multipole: "E1", einsteinA: 41.3e+6}
- {from: "S1/2f=2", to: "P1/2f=3", multipole: "E1", einsteinA: 41.3e+6}
- {from: "S1/2f=3", to: "P1/2f=2", multipole: "E1", einsteinA: 41.3e+6}
- {from: "S1/2f=3", to: "P1/2f=3", multipole: "E1", einsteinA: 41.3e+6}
- {from: "S1/2f=2", to: "P3/2f=1", multipole: "E1", einsteinA: 41.3e+6}
- {from: "S1/2f=2", to: "P3/2f=2", multipole: "E1", einsteinA: 41.3e+6}
- {from: "S1/2f=2", to: "P3/2f=3", multipole: "E1", einsteinA: 41.3e+6}
- {from: "S1/2f=3", to: "P1/2f=2", multipole: "E1", einsteinA: 41.3e+6}
- {from: "S1/2f=3", to: "P1/2f=3", multipole: "E1", einsteinA: 41.3e+6}
- {from: "S1/2f=3", to: "P1/2f=4", multipole: "E1", einsteinA: 41.3e+6}

# Optional fields
default_sublevel_selection:
- ["S1/2f=2", "all"]
- ["S1/2f=3", "all"]
- ["P1/2f=2", "all"]
- ["P1/2f=3", "all"]
- ["P3/2f=1", "all"]
- ["P3/2f=2", "all"]
- ["P3/2f=3", "all"]
- ["P3/2f=4", "all"]
80 changes: 80 additions & 0 deletions configs/ions/yb171.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: "Yb171"
shortname: "¹⁷¹Yb"
mass: 28.8384644689030595108e-26
charge: 1
nuclearspin: 0.5
full_level_structure:
"S1/2f=0": {n: 6, l: 0, j: 0.5, f: 0, E: -9.48210909315e+9}
"S1/2f=1": {n: 6, l: 0, j: 0.5, f: 1, E: 3.16070303105e+9}
"D3/2f=0": {n: 5, l: 2, j: 1.5, f: 1, E: 6.88342460964640e+14}
"D3/2f=1": {n: 5, l: 2, j: 1.5, f: 2, E: 6.88350470564640e+14}
"D5/2f=2": {n: 5, l: 2, j: 2.5, f: 2, E: 7.29477895985202e+14}
"D5/2f=3": {n: 5, l: 2, j: 2.5, f: 3, E: 7.29474121985202e+14}
"P1/2f=0": {n: 6, l: 1, j: 0.5, f: 0, E: 8.112913749003559e+14}
"P1/2f=1": {n: 6, l: 1, j: 0.5, f: 1, E: 8.112934798003559e+14}
"[3/2]1/2f=0": {n: 6, l: null, j: 0.5, f: 0, E: 1.008917341058788e+15}
"[3/2]1/2f=1": {n: 6, l: null, j: 0.5, f: 1, E: 1.008917341058788e+15}
"[3/2]3/2f=1": {n: 6, l: null, j: 1.5, f: 1, E: 8.621425511314839e+14}
"[3/2]3/2f=2": {n: 6, l: null, j: 1.5, f: 2, E: 8.621425511314839e+14}
"[5/2]5/2f=2": {n: 6, l: null, j: 2.5, f: 2, E: 9.70461163716380e+14}
"[5/2]5/2f=3": {n: 6, l: null, j: 2.5, f: 3, E: 9.70461163716380e+14}
"F7/2f=3": {n: 6, l: 3, j: 3.5, f: 3, E: 6.42115934728750e+14}
"F7/2f=4": {n: 6, l: 3, j: 3.5, f: 4, E: 6.42119554728750e+14}

full_transitions:
# Laser lines
# 411nm
- {from: "S1/2f=0", to: "D5/2f=2", multipole: "E2", einsteinA: 22}
- {from: "S1/2f=1", to: "D5/2f=2", multipole: "E2", einsteinA: 22}
- {from: "S1/2f=1", to: "D5/2f=3", multipole: "E2", einsteinA: 22}
# 369nm
- {from: "S1/2f=0", to: "P1/2f=1", multipole: "E1", einsteinA: 1.155e+8}
- {from: "S1/2f=1", to: "P1/2f=0", multipole: "E1", einsteinA: 1.155e+8}
- {from: "S1/2f=1", to: "P1/2f=1", multipole: "E1", einsteinA: 1.155e+8}
# 935nm
- {from: "D3/2f=1", to: "[3/2]1/2f=0", multipole: "E1", einsteinA: 1.2e+5}
- {from: "D3/2f=1", to: "[3/2]1/2f=1", multipole: "E1", einsteinA: 1.2e+5}
- {from: "D3/2f=2", to: "[3/2]1/2f=1", multipole: "E1", einsteinA: 1.2e+5}
# 760nm
- {from: "F7/2f=3", to: "[3/2]3/2f=1", multipole: "E2", einsteinA: 5.0e+4}
- {from: "F7/2f=3", to: "[3/2]3/2f=2", multipole: "E2", einsteinA: 5.0e+4}
- {from: "F7/2f=4", to: "[3/2]3/2f=2", multipole: "E2", einsteinA: 5.0e+4}
# 638nm
# 976nm
# 861nm
# Decay lines
# P1/2 -> D3/2
- {from: "P1/2f=0", to: "D3/2f=1", multipole: "E1", einsteinA: 5.7e+5}
- {from: "P1/2f=1", to: "D3/2f=2", multipole: "E1", einsteinA: 5.7e+5}
- {from: "P1/2f=1", to: "D3/2f=2", multipole: "E1", einsteinA: 5.7e+5}
# [3/2]1/2 -> S1/2
- {from: "[3/2]1/2f=0", to: "S1/2f=1", multipole: "E1", einsteinA: 8.05e+7}
- {from: "[3/2]1/2f=1", to: "S1/2f=0", multipole: "E1", einsteinA: 8.05e+7}
- {from: "[3/2]1/2f=1", to: "S1/2f=1", multipole: "E1", einsteinA: 8.05e+7}
# [3/2]3/2 -> S1/2
- {from: "[3/2]1/2f=0", to: "S1/2f=1", multipole: "E1", einsteinA: 5.125e+7}
- {from: "[3/2]1/2f=1", to: "S1/2f=0", multipole: "E1", einsteinA: 5.125e+7}
- {from: "[3/2]1/2f=1", to: "S1/2f=1", multipole: "E1", einsteinA: 5.125e+7}

# Optional fields
default_sublevel_selection:
- ["S1/2f=0", "all"]
- ["S1/2f=1", "all"]
- ["P1/2f=0", "all"]
- ["P1/2f=1", "all"]

gfactors:
"S1/2f=0": 1.998
"S1/2f=1": 1.998
"D5/2f=2": 1.202
"D5/2f=3": 1.202
"F7/2f=3": 1.145
"F7/2f=4": 1.145
"[3/2]1/2f=0": 1.32
"[3/2]1/2f=1": 1.32
"[3/2]3/2f=1": 1.44
"[3/2]3/2f=2": 1.44

nonlinear_zeeman:
- {level: "S1/2f=0", sublevel: 0, coeffs: [0.0, 0.0, -155.305]}
- {level: "S1/2f=1", sublevel: 0, coeffs: [0.0, 0.0, 155.305]}
2 changes: 1 addition & 1 deletion src/IonSim.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ abstract type IonSimBasis <: Basis end
export IonSimBasis

include("constants.jl")
include("ionproperties.jl")
include("ions.jl")
include("vibrationalmodes.jl")
include("lasers.jl")
Expand All @@ -42,7 +43,6 @@ include("chambers.jl")
include("operators.jl")
include("hamiltonians.jl")
include("timeevolution.jl")
include("species/_include_species.jl")

module analytical
include("analyticfunctions.jl")
Expand Down
2 changes: 1 addition & 1 deletion src/hamiltonians.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Constructs the Hamiltonian for `chamber` as a function of time. Return type is a
`h(t::Real, ψ)` that, itself, returns a `QuantumOptics.SparseOperator`.

**args**
* `timescale`: e.g. a value of 1e-6 will take time to be in μs
* `timescale`: e.g. a value of 1e-6 will take time to be in ``\\mu s``
* `lamb_dicke_order`: Only consider terms that change the phonon number by up to this value.
If this is an `Int`, then the cutoff is applied to all modes. If this is a `Vector{Int}`,
then `lamb_dicke_order[i]` is applied to the iᵗʰ mode, according to the order in
Expand Down
Loading