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

Bragg cavity spectroscopy #2

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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
1,750 changes: 896 additions & 854 deletions docs/source/_static/fundamentals_cavity_angles.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/source/api/potentials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,4 @@ Time dependent variables
~linear_ramp
~s_ramp
~quench
~probe_pulse
6 changes: 6 additions & 0 deletions docs/source/stubs/torchgpe.utils.potentials.probe_pulse.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
torchgpe.utils.potentials.probe\_pulse
======================================

.. currentmodule:: torchgpe.utils.potentials

.. autofunction:: probe_pulse
5 changes: 4 additions & 1 deletion docs/source/user_guide/fundamentals.potentials.rst
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,14 @@ DispersiveCavity
- :py:attr:`cavity_angle` (the angle of the cavity with respect to the horizontal),
- :py:attr:`pump_angle` (the angle of the pump with respect to the horizontal),
- :py:attr:`waist` (the waist of the gaussian pump beam).
- :py:attr:`cavity_probe` (the on-axis probe field. Supports time-dependent parameters).

Note that the lattice depth is expressed in units of the recoil energy :math:`E_r = \hbar^2 k^2 / 2m`, where the wave number :math:`k` is computed from the :math:`d_2` pulse of the atomic species the gas is made of, and the specified atomic detuning.
Additionally, observe that :py:attr:`atomic_detuning`, :py:attr:`cavity_detuning` and :py:attr:`cavity_decay` have to be considered frequencies. The corresponding rates are obtained by the potential itself, by multiplying them by :math:`2 \pi`.

Finally, :py:attr:`waist` is the waist of the gaussian pump beam. It defaults to infinity, which corresponds to a plane wave. Note that differently from the :class:`~torchgpe.bec2D.potentials.Lattice` potential, the :class:`~torchgpe.bec2D.potentials.DispersiveCavity` potential does not account for the wavefront curvature and the Gouy phase.
:py:attr:`waist` is the waist of the gaussian pump beam. It defaults to infinity, which corresponds to a plane wave. Note that differently from the :class:`~torchgpe.bec2D.potentials.Lattice` potential, the :class:`~torchgpe.bec2D.potentials.DispersiveCavity` potential does not account for the wavefront curvature and the Gouy phase.

Finally, an additional on-axis probe field can be added to the potential via the :py:attr:`cavity_probe`. This is useful to study the response of the system to a perturbation. A pre-defined probe field is defined in :py:meth:`~torchgpe.utils.potentials.probe_pulse`

.. image:: ../_static/fundamentals_cavity_angles.svg
:align: center
Expand Down
9 changes: 6 additions & 3 deletions torchgpe/bec2D/potentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,10 @@ class DispersiveCavity(NonLinearPotential):
cavity_angle (float, optional): The angle in the 2D plane of the cavity. Defaults to :math:`0`
pump_angle (float, optional): The angle in the 2D plane of the transversal pump. Defaults to :math:`\\pi/3`
waist (float, optional): the waist of the gaussian beam. Defaults to infinity
cavity_probe (Union[float, Callable], optional): The on-axis cavity probe. It can be set to be either a constant or a function of time. Defaults to :math:`0`
"""

def __init__(self, lattice_depth: Union[float, Callable], atomic_detuning: float, cavity_detuning: Union[float, Callable], cavity_decay: float, cavity_coupling: float, cavity_angle: float = 0, pump_angle: float = np.pi/3, waist: float = np.inf):
def __init__(self, lattice_depth: Union[float, Callable], atomic_detuning: float, cavity_detuning: Union[float, Callable], cavity_decay: float, cavity_coupling: float, cavity_angle: float = 0, pump_angle: float = np.pi/3, waist: float = np.inf, cavity_probe: Union[float, Callable] = 0):

super().__init__()

Expand All @@ -195,13 +196,15 @@ def __init__(self, lattice_depth: Union[float, Callable], atomic_detuning: float
self.cavity_angle = cavity_angle
self.pump_angle = pump_angle
self.waist = waist
self.cavity_probe = cavity_probe

def on_propagation_begin(self):
self.is_time_dependent = any_time_dependent_variable(
self.cavity_detuning, self.lattice_depth)
self.cavity_detuning, self.lattice_depth, self.cavity_probe)

self._cavity_detuning = time_dependent_variable(self.cavity_detuning)
self._lattice_depth = time_dependent_variable(self.lattice_depth)
self._cavity_probe = time_dependent_variable(self.cavity_probe)

self.g0 = 2*np.pi*self.cavity_coupling
self._atomic_detuning = 2*np.pi*self.atomic_detuning
Expand Down Expand Up @@ -253,7 +256,7 @@ def get_alpha(self, psi: torch.tensor, time: float = None):

self.eta = np.sqrt(self._lattice_depth(time))*self.eta_prefactor

alpha = self.c1*self.eta*order/self.c6
alpha = (self.c1*self.eta*order + self._cavity_probe(time)*(self.Er/spconsts.hbar))/self.c6

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Shouldn't we remove line 259?
  2. For real time evolution 260 will work, however for the imaginary time evolution we have "time"=None, which causes problems with callable cavity_probe(). I agree that it is not so useful in the imaginary time but we can allow in the imaginary time evolution to have stationary probes that do not change in time; constant cavity_probe(). That's why initially I had if clause discriminating with None value for the time and two different way of cavity_probe being calculated.


return alpha

Expand Down
17 changes: 17 additions & 0 deletions torchgpe/utils/potentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,23 @@ def quench(v0=1, v1=0, quench_time=1):
"""
return lambda t: v0 if t < quench_time else v1


def probe_pulse(amplitude, detuning, t0 = 0, phase = 0):
"""Implements a probe pulse with a givem amplitude, detuning, and phase.

Args:
amplitude (float): The amplitude of the pulse.
detuning (float): The detuning between the cavity's transverse pump frequency and the probe frequency.
t0 (float, optional): The time at which the pulse starts. Defaults to :math:`0`.
phase (float, optional): The phase of the pulse. Defaults to :math:`0`.

Returns:
float: The value of the pulse at time :math:`t`
"""
omega = 2*torch.pi*detuning
return lambda t: 0 if t<t0 else amplitude * torch.exp(1j*(omega*t + phase))


# --- Potential base classes ---


Expand Down
Loading