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

Rename elements #9

Draft
wants to merge 1 commit 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 webpage/example-notebooks/multi-mode_interactions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
" ions=[C], com_frequencies=(x=νᵣ, y=νᵣ, z=νₐ), \n",
" vibrational_modes=(x=[1], z=[1])\n",
" )\n",
"T = Trap(configuration=chain, B=4e-4, Bhat=ẑ, δB=0, lasers=[L])\n",
"T = Chamber(configuration=chain, B=4e-4, Bhat=ẑ, δB=0, lasers=[L])\n",
"# set laser parameters\n",
"L.k = (x̂ + ẑ)/√2\n",
"L.ϵ = ẑ\n",
Expand Down
2 changes: 1 addition & 1 deletion webpage/example-notebooks/ramped_molmer_sorensen.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
"chain = LinearChain(\n",
" ions=[C, C], com_frequencies=(x=3e6,y=3e6,z=2.5e5), vibrational_modes=(;z=[1])\n",
" )\n",
"T = Trap(configuration=chain, B=6e-4, Bhat=(x̂ + ẑ)/√2, lasers=[L1, L2]);"
"T = Chamber(configuration=chain, B=6e-4, Bhat=(x̂ + ẑ)/√2, lasers=[L1, L2]);"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion webpage/example-notebooks/two_ion_vaet.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
" ions=[C, C], com_frequencies=(x=3e6,y=3e6,z=1e6), \n",
" vibrational_modes=(x=[1], z=[1])\n",
" )\n",
"T = Trap(configuration=chain, B=6e-4, Bhat=(x̂ + ẑ)/√2, lasers=[L1, L2])\n",
"T = Chamber(configuration=chain, B=6e-4, Bhat=(x̂ + ẑ)/√2, lasers=[L1, L2])\n",
"\n",
"axial_mode = T.configuration.vibrational_modes.z[1]\n",
"radial_mode = T.configuration.vibrational_modes.x[1]\n",
Expand Down
52 changes: 26 additions & 26 deletions webpage/tutorial-notebooks/getting_started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,10 @@
"\\item \\texttt{stark\\_shift::OrderedDict}: A dictionary with keys denoting the selected levels and values, a real number for describing a shift of the level's energy. This is just a convenient way to add Stark shifts to the simulation without additional resources\n",
"\n",
"\n",
"\\item \\texttt{ionnumber}: When the ion is added to an \\texttt{IonConfiguration}, this value keeps track of its order in the chain\n",
"\\item \\texttt{ionnumber}: When the ion is added to an \\texttt{IonTrap}, this value keeps track of its order in the chain\n",
"\n",
"\n",
"\\item \\texttt{position}: When the ion is added to an \\texttt{IonConfiguration}, this value keeps track of its physical position in meters\n",
"\\item \\texttt{position}: When the ion is added to an \\texttt{IonTrap}, this value keeps track of its physical position in meters\n",
"\n",
"\\end{itemize}\n"
],
Expand Down Expand Up @@ -411,8 +411,8 @@
" * `sublevel_aliases::Dict{String,Tuple}`: Dict specifying aliases assigned to sublevels, in the format `alias => sublevel`\n",
" * `shape`::Vector{Int}: Dimension of the Hilbert space\n",
" * `stark_shift::OrderedDict`: A dictionary with keys denoting the selected levels and values, a real number for describing a shift of the level's energy. This is just a convenient way to add Stark shifts to the simulation without additional resources\n",
" * `ionnumber`: When the ion is added to an `IonConfiguration`, this value keeps track of its order in the chain\n",
" * `position`: When the ion is added to an `IonConfiguration`, this value keeps track of its physical position in meters\n"
" * `ionnumber`: When the ion is added to an `IonTrap`, this value keeps track of its order in the chain\n",
" * `position`: When the ion is added to an `IonTrap`, this value keeps track of its physical position in meters\n"
],
"text/plain": [
"\u001b[36m Ca40(selected_sublevels::Vector{Tuple}[, starkshift::Dict])\u001b[39m\n",
Expand Down Expand Up @@ -460,10 +460,10 @@
" of the level's energy. This is just a convenient way to add Stark\n",
" shifts to the simulation without additional resources\n",
"\n",
" • \u001b[36mionnumber\u001b[39m: When the ion is added to an \u001b[36mIonConfiguration\u001b[39m, this\n",
" • \u001b[36mionnumber\u001b[39m: When the ion is added to an \u001b[36mIonTrap\u001b[39m, this\n",
" value keeps track of its order in the chain\n",
"\n",
" • \u001b[36mposition\u001b[39m: When the ion is added to an \u001b[36mIonConfiguration\u001b[39m, this value\n",
" • \u001b[36mposition\u001b[39m: When the ion is added to an \u001b[36mIonTrap\u001b[39m, this value\n",
" keeps track of its physical position in meters"
]
},
Expand Down Expand Up @@ -509,8 +509,8 @@
"* `sublevel_aliases::Dict{String,Tuple}`: Dict specifying aliases assigned to sublevels, in the format `alias => sublevel`\n",
"* `shape`::Vector{Int}: Dimension of the Hilbert space\n",
"* `stark_shift::OrderedDict`: A dictionary with keys denoting the selected levels and values, a real number for describing a shift of the level's energy. This is just a convenient way to add Stark shifts to the simulation without additional resources\n",
"* `ionnumber`: When the ion is added to an `IonConfiguration`, this value keeps track of its order in the chain\n",
"* `position`: When the ion is added to an `IonConfiguration`, this value keeps track of its physical position in meters\n",
"* `ionnumber`: When the ion is added to an `IonTrap`, this value keeps track of its order in the chain\n",
"* `position`: When the ion is added to an `IonTrap`, this value keeps track of its physical position in meters\n",
"````"
]
},
Expand Down Expand Up @@ -741,7 +741,7 @@
"Collapsed": "false"
},
"source": [
"To include the center of mass motion of the ion in our simulation, we need to add it to an `IonConfiguration`:"
"To include the center of mass motion of the ion in our simulation, we need to add it to an `IonTrap`:"
]
},
{
Expand All @@ -764,7 +764,7 @@
" ions=[C], com_frequencies=(x=3e6,y=3e6,z=1e6), \n",
" vibrational_modes=(;z=[1])\n",
" )\n",
"print(typeof(chain) <: IonConfiguration)"
"print(typeof(chain) <: IonTrap)"
]
},
{
Expand Down Expand Up @@ -823,7 +823,7 @@
"Collapsed": "false"
},
"source": [
"The last thing we need to construct is a `Trap`, which collects all of these objects that we've defined."
"The last thing we need to construct is a `Chamber`, which collects all of these objects that we've defined."
]
},
{
Expand All @@ -834,7 +834,7 @@
},
"outputs": [],
"source": [
"T = Trap(configuration=chain, B=4e-4, Bhat=ẑ, δB=0, lasers=[L]);"
"T = Chamber(configuration=chain, B=4e-4, Bhat=ẑ, δB=0, lasers=[L]);"
]
},
{
Expand All @@ -843,7 +843,7 @@
"Collapsed": "false"
},
"source": [
"A `Trap` specifically associates an `IonConifiguration` and a set of lasers. It keeps track of which lasers point at which ions and with how much scaled strength (to model e.g. crosstalk). It also keeps track of the magnetic field. In this case we've set the magnetic field to have a strength of 4 Gauss and to point in the ẑ-direction. δB can be used to model a time-dependent magnetic field, which for example, might be useful to model noise -- for now we set it to 0.\n",
"A `Chamber` specifically associates an `IonConifiguration` and a set of lasers. It keeps track of which lasers point at which ions and with how much scaled strength (to model e.g. crosstalk). It also keeps track of the magnetic field. In this case we've set the magnetic field to have a strength of 4 Gauss and to point in the ẑ-direction. δB can be used to model a time-dependent magnetic field, which for example, might be useful to model noise -- for now we set it to 0.\n",
"\n",
"```{note}\n",
"Though, mathematically, `C.basis ⊗ configuration.vibrational_modes.z[1].basis` is equivalent to `configuration.vibrational_modes.z[1].basis ⊗ C.basis`, when converted to the space of 2D matrices the description of these two bases will be different. Equivalence is maintained provided that the order is consistent throughout the description of the problem, but this requires us to set a convention. For a trap composed of a linear chain of ions, IonSim's convention is: ion₁ ⊗ ion₂ ⊗ ... ⊗ ionₙ ⊗ mode₁ ⊗ mode₂ ⊗ ... ⊗ modeₙ, where the ion bases are ordered according to the order in `T.configuration.ions` and the vibrational modes are ordered according to the order in `[T.configuration.vibrational_modes.x, T.configuration.vibrational_modes.y, T.configuration.vibrational_modes.z`].\n",
Expand Down Expand Up @@ -876,7 +876,7 @@
"source": [
"Let's start off by simulating rabi oscillations between the two considered states of our ion. First we have to update some of the parameters in our system.\n",
"\n",
"First let's set the wavelength of our laser. Here we want to set the wavelength such that the laser is resonant with the `\"S\" -> \"D\"` transition in the `Ion` `C`. This can be done with the function `transitionwavlength` and passing in the arguments `C` (the ion), `(\"S\", \"D\")` (the transition), and `T` (the trap in which `C` resides). By including `T` in our function call, the `transitionwavlength` takes into account the energy shift due to the magnetic field inside the `Trap` `T`."
"First let's set the wavelength of our laser. Here we want to set the wavelength such that the laser is resonant with the `\"S\" -> \"D\"` transition in the `Ion` `C`. This can be done with the function `transitionwavlength` and passing in the arguments `C` (the ion), `(\"S\", \"D\")` (the transition), and `T` (the trap in which `C` resides). By including `T` in our function call, the `transitionwavlength` takes into account the energy shift due to the magnetic field inside the `Chamber` `T`."
]
},
{
Expand Down Expand Up @@ -966,7 +966,7 @@
"\n",
"\\begin{verbatim}\n",
"Efield_from_pi_time(\n",
" pi_time::Real, T::Trap, laser_index::Int, ion_index::Int, \n",
" pi_time::Real, T::Chamber, laser_index::Int, ion_index::Int, \n",
" transition::Union{Tuple{String,String},Vector{<:String}}\n",
" )\n",
"\\end{verbatim}\n",
Expand All @@ -987,7 +987,7 @@
"\n",
"```\n",
"Efield_from_pi_time(\n",
" pi_time::Real, T::Trap, laser_index::Int, ion_index::Int, \n",
" pi_time::Real, T::Chamber, laser_index::Int, ion_index::Int, \n",
" transition::Union{Tuple{String,String},Vector{<:String}}\n",
" )\n",
"```\n",
Expand All @@ -1006,7 +1006,7 @@
" Alternatively, one may use\n",
"\n",
"\u001b[36m Efield_from_pi_time(\u001b[39m\n",
"\u001b[36m pi_time::Real, T::Trap, laser_index::Int, ion_index::Int, \u001b[39m\n",
"\u001b[36m pi_time::Real, T::Chamber, laser_index::Int, ion_index::Int, \u001b[39m\n",
"\u001b[36m transition::Union{Tuple{String,String},Vector{<:String}}\u001b[39m\n",
"\u001b[36m )\u001b[39m\n",
"\n",
Expand Down Expand Up @@ -1076,7 +1076,7 @@
"text/latex": [
"\\begin{verbatim}\n",
"hamiltonian(\n",
" T::Trap; timescale::Real=1e-6, lamb_dicke_order::Union{Vector{Int},Int}=1, \n",
" T::Chamber; timescale::Real=1e-6, lamb_dicke_order::Union{Vector{Int},Int}=1, \n",
" rwa_cutoff::Real=Inf, displacement=\"truncated\", time_dependent_eta=false\n",
" )\n",
"\\end{verbatim}\n",
Expand Down Expand Up @@ -1112,7 +1112,7 @@
"text/markdown": [
"```\n",
"hamiltonian(\n",
" T::Trap; timescale::Real=1e-6, lamb_dicke_order::Union{Vector{Int},Int}=1, \n",
" T::Chamber; timescale::Real=1e-6, lamb_dicke_order::Union{Vector{Int},Int}=1, \n",
" rwa_cutoff::Real=Inf, displacement=\"truncated\", time_dependent_eta=false\n",
" )\n",
"```\n",
Expand All @@ -1137,7 +1137,7 @@
],
"text/plain": [
"\u001b[36m hamiltonian(\u001b[39m\n",
"\u001b[36m T::Trap; timescale::Real=1e-6, lamb_dicke_order::Union{Vector{Int},Int}=1, \u001b[39m\n",
"\u001b[36m T::Chamber; timescale::Real=1e-6, lamb_dicke_order::Union{Vector{Int},Int}=1, \u001b[39m\n",
"\u001b[36m rwa_cutoff::Real=Inf, displacement=\"truncated\", time_dependent_eta=false\u001b[39m\n",
"\u001b[36m )\u001b[39m\n",
"\n",
Expand Down Expand Up @@ -1211,7 +1211,7 @@
"````{toggle}\n",
"```\n",
"hamiltonian(\n",
" T::Trap; timescale::Real=1e-6, lamb_dicke_order::Union{Vector{Int},Int}=1, \n",
" T::Chamber; timescale::Real=1e-6, lamb_dicke_order::Union{Vector{Int},Int}=1, \n",
" rwa_cutoff::Real=Inf, displacement=\"truncated\", time_dependent_eta=false\n",
" )\n",
"```\n",
Expand Down Expand Up @@ -2532,12 +2532,12 @@
"set_sublevel_alias!(C, Dict(\"S\" => (\"S1/2\", -1/2),\n",
" \"D\" => (\"D5/2\", -5/2)))\n",
"\n",
"# Create a new Trap with the new Ion\n",
"# Create a new Chamber with the new Ion\n",
"chain = LinearChain(\n",
" ions=[C], com_frequencies=(x=3e6,y=3e6,z=1e6), \n",
" vibrational_modes=(;z=[1]))\n",
"\n",
"T = Trap(configuration=chain, B=4e-4, Bhat=ẑ, δB=0, lasers=[L]);\n",
"T = Chamber(configuration=chain, B=4e-4, Bhat=ẑ, δB=0, lasers=[L]);\n",
"\n",
"# Redefine mode for new trap\n",
"mode = T.configuration.vibrational_modes.z[1];\n",
Expand Down Expand Up @@ -2743,7 +2743,7 @@
" ions=[C], com_frequencies=(x=3e6,y=3e6,z=1e6), \n",
" vibrational_modes=(;z=[1]))\n",
"\n",
"T = Trap(configuration=chain, B=4e-4, Bhat=ẑ, δB=0, lasers=[L]);\n",
"T = Chamber(configuration=chain, B=4e-4, Bhat=ẑ, δB=0, lasers=[L]);\n",
"\n",
"mode = T.configuration.vibrational_modes.z[1];"
]
Expand Down Expand Up @@ -2862,7 +2862,7 @@
" ions=[C, C], com_frequencies=(x=3e6,y=3e6,z=1e6), \n",
" vibrational_modes=(;z=[1])\n",
" )\n",
"T = Trap(configuration=chain, B=4e-4, Bhat=(x̂ + ẑ)/√2, lasers=[L1, L2]);"
"T = Chamber(configuration=chain, B=4e-4, Bhat=(x̂ + ẑ)/√2, lasers=[L1, L2]);"
]
},
{
Expand Down Expand Up @@ -3171,7 +3171,7 @@
" ions=[C, C, C, C, C, C], com_frequencies=(x=3e6,y=3e6,z=1e6), \n",
" vibrational_modes=(;z=[1])\n",
" )\n",
"T = Trap(configuration=chain, B=4e-4, Bhat=(x̂ + ẑ)/√2, lasers=[L1, L2])\n",
"T = Chamber(configuration=chain, B=4e-4, Bhat=(x̂ + ẑ)/√2, lasers=[L1, L2])\n",
"global_beam!(T, L1) # set L1 to shine equally on all ions\n",
"global_beam!(T, L2) # set L2 to shine equally on all ions\n",
"mode = T.configuration.vibrational_modes.z[1]\n",
Expand Down
24 changes: 12 additions & 12 deletions webpage/tutorial-notebooks/media/graph.dot
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ node [
]

// Edges
RotationalMode -> IonConfiguration
Ion -> IonConfiguration
VibrationalMode -> IonConfiguration
IonConfiguration -> Trap
Lasers -> Trap
RotationalMode -> IonTrap
Ion -> IonTrap
VibrationalMode -> IonTrap
IonTrap -> Chamber
Lasers -> Chamber

// Node attributes
Ion [
Expand All @@ -29,18 +29,18 @@ Ion [
position::Real\l}"
]

IonConfiguration [
label="{Ring \<: IonConfiguration | not implemented}\
|{LinearChain \<: IonConfiguration|\
IonTrap [
label="{Ring \<: IonTrap | not implemented}\
|{LinearChain \<: IonTrap|\
ions::Vector\{\<:Ion\}\l\
com_frequencies::NamedTuple\{(:x,:y,:z)\}\l\
vibrational_modes::NamedTuple\{(:x,:y,:z),Tuple\{Vararg\{Vector\{VibrationalMode\},3\}\}\}\l\
|full_normal_mode_description::NamedTuple\{(:x,:y,:z)\}\l }"
]

Trap [
label="{Trap|\
configuration::\<:IonConfiguration\l\
Chamber [
label="{Chamber|\
configuration::\<:IonTrap\l\
B::Real\l\
Bhat::NamedTuple\{(:x,:y,:z)\}\l\
∇B::Real\l\
Expand All @@ -59,7 +59,7 @@ Lasers [
ϕ::Function\l\
pointing::Vector\{Tuple\{Int,Real\}\}\l}"
]
VibrationalMode [
VibrationalMode [
label="{VibrationalMode \<: IonSimBasis|\
ν::Real\l\
δν::Function\l\
Expand Down