SPDX-FileCopyrightText: Copyright (C) 2024-2025 Carrie A Weidner c.weidner@bristol.ac.uk
SPDX-FileCopyrightText: Copyright (C) 2024-2025 Sean Patrick O'Neil seanonei@usc.edu
SPDX-FileCopyrightText: Copyright (C) 2024-2025 SM Shermer lw1660@gmail.com
SPDX-FileCopyrightText: Copyright (C) 2025 FC Langbein frank@langbein.orgSPDX-License-Identifier: AGPL-3.0-or-later
This repository contains the optimization code used to synthesize controllers for state transfer via energy landscape shaping in an optical lattice. It has code to optimize directly for the differences in on-site potential to maximize the fidelity of state transfer as well as code to optimize a specific DMD pattern to realize the on-site potential differences. The repository additionally contains some simple analysis code to determine the differential sensitivity of the fidelity error to drift between the lattice and DMD and changes in DMD light intensity.
Version 1.0: initial release
Routine | Description |
---|---|
Optimize_Delta_Direct.m |
This routine is designed to be run from the root directory and optimizes the on-site potentials differences \data\controllers directory. |
OptimAtomChain_Delta.m |
This script is called by Optimize_Delta_Direct.m and employs MATLAB's fmincon function to optimize the individual |
AtomChainHamil_Delta.m |
This is called on by OptimAtomChain_Delta.m and generates the Hamiltonian determined by the on-site potential differences |
sort_Delta_controllers.m |
This routine load the controllers saved in the \data\controllers directory, sorts for fidelity error less than a user-specified threshold, and saves the result as a single file in \data\useable
|
Routine | Description |
---|---|
generate_DMD_optim_results.m |
This is the main routine for generating DMD patterns that approximate the Optimize_Delta_Direct.m . The script saves the resulting DMD patterns in the \data\DMD_patterns directory. |
DMD_optim.m |
This routine is called on by generate_DMD_optim_results.m and executes the optimization for a specific DMD array to generate a given target vector of h=1 and w=1 for single pixel optimization), number of "on" (super)pixels to optimize over, normalized light power, and red/blue light detuning. |
DMD_setup.m |
This script computes the DMD parameters based on the power and color of the light employed. |
DMD_init_fct.m |
This script builds the point spread function (PSF) based on the geometry of system and color and power of incident light. |
DefineProblemSO_var_superpixel.m |
This script establishes the optimization options and objective function for the combined surrogate optimization. |
DMD_eval_superpixel.m |
This script computes the on-site potentials and |
DMD_eval_fid_err_V.m |
This script computes the fidelity error over time generated by a given DMD pattern. |
Routine | Description |
---|---|
sort_DMD_patterns.m |
This routine sort the DMD patterns produced by generate_DMD_optim_results.m for a user-defined threshold on the read-out time and fidelity error and saves the result as a single file ./data/useable/useable_controller_DMD_optim.mat |
compute_sensitivity_DMD_optim.m |
This routine computes the sensitivity to drift and sensitivity to changes in laser power for the controllers saved in ./data/useable/useable_controller_DMD_optim.mat and saves the results in ./data/results/useable_controllers_sens_data.mat . |
dexpma.m |
This script computes the augmented matrix exponential used in the differential sensitivity computations when called by compute_sensitivity_DMD_optim.m . |
drift.m |
This script is called by compute_sensitivity_DMD_optim.m and returns the change in on-site potentials to drift in an arbitrary 2D direction. |
generate_Vxy.m |
This script is called on by drift.m and computes the electric field and potential over the entire lattice grid as a function of x- and y-coordinates. |
power_change.m |
This script is called on by compute_sensitivity_DMD_optim.m and returns the change in the on-site potentials due to changes in DMD light power. |
build_summary_table_sensitivity.m |
This script builds a summary table of the controllers and sensitivity data saved in ./data/results/useable_controllers_sens_data.mat and saves as a table in ./data_results/useable_sensitivity_summary.xlsx . |
AtomChainParam.m |
This script is called by build_summary_table_sensitivity.m to generate proper time scaling. |
plot_useable_solutions.m |
Generates summary plots of the useable controllers and sensitivity data and saves in ./data/figures/useable . |
plot_scatter.m |
Generates scatter plots of sensitivity data and saves in ./data/figures/scatter . |
paper_plotting.m |
Generates Figures 1, 3, and 4 in the paper. |
timetrace_plotting.m |
Generates Figure 2 in the paper. |
Note : The synthesis code described in the table above passes the variables between function calls. If running on a single machine, these routines can be made more efficient by defining PSF
, opt
, num
,ind
,target
,x0
,h
,w
, and px_max
as global variables and modifying the code appropriately.
The following folder hierarchy in the data
folder are created automatically when the optimization and analysis code above is executed.
Directory | Contents |
---|---|
./data/controllers |
This directory contains the Optimize_Delta_Direct.m . |
./data/DMD_patterns |
This directory contains the DMD patterns optimized with generate_DMD_optim_results.m using the controllers in ./data/useable/useable_sym.mat as the target. |
./data/useable |
This folder contains the file useable_sym.mat with usable useable_controllers_DMD_optim.mat with the useable DMD patterns output by the sorting routines. |
./data/results |
This directory contains the useable_controllers_sens_data.mat file generated by compute_sensitivity_DMD_optim.m and the useable_sensitivity_summary.xlsx file generated by build_summary_table_sensitivity.m . |
./data/figures/solutions |
This directory contains the summary plots for the controller and sensitivity data produced by plot_useable_solutions.m . |
./data/figures/scatter |
This directory contains the sensitivity data scatter plots produced by plot_scatter.m . |