Pylcp

92 views
Skip to first unread message

dou li

unread,
Apr 24, 2024, 8:45:39 AM4/24/24
to pylcp

Hello!

Thanks very much for your fancy work.

I have reproduced the figure from your previous paper using formulas.

https://doi.org/10.1088/1367-2630/ad02ea

1.pic.jpg

Now, I want to replicate them using pylcp, but the generated plots are not meeting my expectations. Can you please provide the source code for reference?

I am looking forward to your reply.


Eckel, Stephen P. (Fed)

unread,
May 6, 2024, 10:13:25 AM5/6/24
to dou li, pylcp
Hello,

Below you can find a code snippet that generated Fig. 1 of our paper.  Hope that helps!

Best,

-Steve

import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import axes3d
import pylcp
from pylcp.gratings import (infiniteGratingMOTBeams, maskedGaussianGratingMOTBeams)

# Define the laser beams:
det = -1.5
beta = 1.0
Nb = 3
thetad = np.pi/4
laserBeams = infiniteGratingMOTBeams(det, beta, Nb, thetad)

# Next, define the magnetic field:
magField = pylcp.quadrupoleMagneticField(1.0)

# Define the F=0->F=1 Hamiltonian:
Hg, Bgq = pylcp.hamiltonians.singleF(F=0, gF=0, muB=1)
He, Beq = pylcp.hamiltonians.singleF(F=1, gF=1, muB=1)

dijq = pylcp.hamiltonians.dqij_two_bare_hyperfine(0, 1)

hamiltonian = pylcp.hamiltonian(Hg, He, Bgq, Beq, dijq)

# Now run the calculation:
z = np.arange(-10., 10.1, 0.05)+1e-5
v = np.arange(-10., 10.1, 0.05)

trap_01 = pylcp.rateeq(laserBeams, magField, hamiltonian,
                       include_mag_forces=False)

trap_01.generate_force_profile(
    [np.zeros(z.shape), np.zeros(z.shape), z],
    [np.zeros(z.shape), np.zeros(z.shape), np.zeros(z.shape)]
    )


# Make the figure:
fig, ax = plt.subplots(nrows=1, ncols=1, num="Simple Forces",
                       figsize=(3.25, 2.75))

linspec = ['-.','--','-']
colors = ['C0', 'C0', 'C0']
ax.plot(z, trap_01.profile['0'].F[2], 'k-')
        #label='$F=0\\rightarrow F''=1$ (s)')
#ax.plot(z, Fzsimple, '-', linewidth=0.5, label='$F=0\\rightarrow F''=1$')
ax.plot(z[z>0], trap_01.profile['0'].Rijl['g->e'][z>0, 0, 0, -1]*\
        (trap_01.profile['0'].Neq[z>0, 0] -
         trap_01.profile['0'].Neq[z>0, -1]),
        '-', linewidth=0.75, color='C1', label='$+k, \sigma^+$')
ax.plot(z[z<0], trap_01.profile['0'].Rijl['g->e'][z<0, 0, 0, 0]*\
        (trap_01.profile['0'].Neq[z<0, 0] -
         trap_01.profile['0'].Neq[z<0, 1]),
        '-', linewidth=0.75, color='C1')
lbls = ['$\sigma^-$', '$\pi$', '$\sigma^+$']
for ii in range(3):
    ax.plot(z[z>0],
            np.sum(trap_01.profile['0'].Rijl['g->e'][z>0, 1::, 0, ii], axis=1)*\
            (trap_01.profile['0'].Neq[z>0, 0]-trap_01.profile['0'].Neq[z>0, ii+1])*
            trap_01.laserBeams['g->e'].kvec()[1][2],
            linspec[ii], linewidth=0.75, color=colors[ii], label='$-k$, ' + lbls[ii])
    ax.plot(z[z<0],
            np.sum(trap_01.profile['0'].Rijl['g->e'][z<0, 1::, 0, 2-ii], axis=1)*
            (trap_01.profile['0'].Neq[z<0, 0]-
             trap_01.profile['0'].Neq[z<0, 3-ii])*\
            trap_01.laserBeams['g->e'].kvec()[1][2],
            linspec[ii], linewidth=0.75, color=colors[ii])

ax.set_xlabel('$z/(\hbar\Gamma/\mu_B B\')$')
ax.set_ylabel('$f_z/(\hbar k \Gamma)$')
ax.set_xlim(-10, 10)


Dr. Stephen Eckel
Physicist
Sensor Sciences Division
Fundamental Thermodynamics Group
100 Bureau Drive, Stop 8364
Gaithersburg, MD 20899-8364
(301) 975-8571

On Apr 24, 2024, at 8:45 AM, 'dou li' via pylcp <py...@googlegroups.com> wrote:

Hello!

Thanks very much for your fancy work.

I have reproduced the figure from your previous paper using formulas.

https://doi.org/10.1088/1367-2630/ad02ea

<1.pic.jpg>

Now, I want to replicate them using pylcp, but the generated plots are not meeting my expectations. Can you please provide the source code for reference?

I am looking forward to your reply.



--
You received this message because you are subscribed to the Google Groups "pylcp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylcp+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylcp/7159e37f-fe52-443b-a3d0-1da9280dde96n%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<1.pic.jpg>

Reply all
Reply to author
Forward
0 new messages