OBE solving with many levels

85 views
Skip to first unread message

Sid Wright

unread,
Aug 1, 2022, 8:42:56 AM8/1/22
to pylcp
Hi,

First of all, many thanks for a great open source package! 

I've been doing simulations for laser cooling of AlF molecules, and had a question about speed. I'm simulating for optical cycling/molasses of the Q(1) line, which involves 72 hyperfine states in total (36 ground, 36 excited). Pylcp does this extremely fast, taking a few seconds to simulate up to Gamma*t = 1000. By far the slowest part seems to be building the obes (pylcp.obe(args) ), which I assume is because of the basis set size. The matrix elements are first imported from externally made .csv files, and the hamiltonian and d_q terms are then assigned manually, which is of course fast. I use the inbuilt infinitePlaneWave laser beam function for the laser beams, and set a zero constant magnetic field. It takes then about 5 minutes to build the hamiltonian. 

My problem comes when trying to generate force curves, because the pylcp.obe function requires explicit values for detuning and intensity of the laser beams (I think!). I can generate enough points for a force curve in a minute, but have to wait to rebuild the obes for a new parameter set each time. Is there a way around this (e.g. to assign values to intensity and detuning after building the OBEs, so that they only need to be built once for a given laser configuration?) 

Many thanks, 

Sid Wright 

Eckel, Stephen P. (Fed)

unread,
Aug 4, 2022, 1:22:02 PM8/4/22
to Sid Wright, pylcp

Hi Sid,

 

Sorry for the delayed reply.

 

Part of the reason for the long initial construction time for the OBEs is because pylcp computes the coherent portion of the density matrix evolution through commutators, and with 72 basis states, that commutator is going to take a while to evaluate.

 

As for changing parameters of the laser beams or the magnetic fields, you can do that after the OBEs have been initially generated.  What you can do is the following:

 

```

# Make your original obe:

eqn = obe(…)

 

# Calculate what you need:

eqn.generate_force_profile(…)

 

# Now generate your new laserBeams:

newLaserBeams = pylcp.laserBeams(…)

 

# Overwrite the copy of the laser beams originally passed

# when you generated the OBEs:

eqn.laserBeams = newlaserBeams

```

 

I think this will work, but I cannot guarantee it.  When obe is initially called, it actually makes a copy of the laserBeams object you give to it and stores it as an attribute. I coded this in because I was nervous that changing either laserBeams or magField on the fly might have unanticipated consequences.  For your case where you want to change intensity and detuning though, I think this simple hack will work.

 

What you absolutely cannot change is the Hamiltonian. If you are putting the detunings on the Hamiltonian rather than on the laserBeams, I’m afraid you will have to regenerate the OBEs everytime.

 

Good luck!

 

-Steve

--
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/105180c6-4b2e-4529-832c-0e8cca3aac98n%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sid Wright

unread,
Aug 5, 2022, 7:53:36 AM8/5/22
to pylcp
Hi Steve,

Thanks again also for a quick response to this question. It seems that overwriting the laser beams works, although as a minor modification to your above suggested code, you have to specify the key to the dictionary of laser beams:

eqn.laserBeams[key] = newlaserBeams

where "key" for the dictionary is found with eqn.laserBeams.keys() 

This seems to work, so that changing the laser beams then produces different populations versus time. I will check it holds for the force curves, I would assume so. I included detunings in the laser beams rather than the Hamiltonian, so this should be a full solution to my problem.

Thanks a lot!

Sid

Reply all
Reply to author
Forward
0 new messages