Skip to content

Commit

Permalink
Update autocorrelation.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
lange50 committed Feb 12, 2024
1 parent 2fbdde8 commit f8ba15d
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions figures/Autocorrelation/autocorrelation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,46 @@
" return x, y\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def g2_simulation_fun(tlist, w, j, gamma, I, Isat, dephasing, alpha, A, xoffset, yoffset, frequency='blue'):\n",
" tlist = np.array(tlist)\n",
" w = np.float64(w) * (-1) ** (frequency == 'red')\n",
" \"\"\"\n",
" delta is the total frequency detuning between two molecules\n",
" \"\"\"\n",
" \n",
" N = 2 # number of molecules\n",
" J = j*np.ones([N,N]) # J matrix (units of Gamma=1) only uppder triangle used\n",
" Gamma = gamma*np.ones([N,N]) # Gamma matrix. Only upper triangle used.\n",
" np.fill_diagonal(Gamma, 1) # set all diagonals to 1. \n",
" Omega = np.sqrt(I / 2 / Isat)*(np.ones(N) - 1e-1*np.random.rand(N) ) # add random to see non-bright modes\n",
"\n",
" delta = 2 * np.sqrt(w**2 - j**2)\n",
" Delta = [-delta / 2, delta / 2] # Detuning of laser to each molecule.\n",
" Ns = 4; DWFactor = alpha; vibrelax = 500; # Ns = 2 or 4, number of states in molecules. 2 (no vibration) or 4 (2 vibrations in each). DWFactor (0 to 1). vibrelax is the relaxation rate from v=1 to v=0 for ground and excited. Currently DWFactor does not modify Drive. \n",
" q = Collective.Collective(N=N, Ns=Ns)\n",
"\n",
" normalized_tlist = np.linspace(0, np.max(tlist) + np.abs(xoffset), 150)\n",
" # y = q.Calculate_g2(N, Ns, w, Delta, normalized_tlist, J, Gamma, Omega, dephasing, DWFactor, vibrelax, plot=False)\n",
" y = q.Calculate_g2(N, Ns, w, Delta, normalized_tlist, J, Gamma, Omega, dephasing, DWFactor, vibrelax, plot=False)\n",
" return interp1d(\n",
" np.concatenate([\n",
" -np.flip(normalized_tlist) - xoffset,\n",
" normalized_tlist - xoffset\n",
" ]), \n",
" np.concatenate([\n",
" np.flip(A * y / y[-1] + yoffset),\n",
" A * y / y[-1] + yoffset\n",
" ]),\n",
" fill_value='extrapolate'\n",
" )(tlist)"
]
},
{
"cell_type": "code",
"execution_count": 25,
Expand Down Expand Up @@ -310,6 +350,13 @@
"# plt.savefig(r'C:\\Users\\chris\\Box\\HoodLab\\Papers\\superradiance_2023\\data\\sm_bunching' + \"\\\\bunching.pdf\")\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 5,
Expand Down

0 comments on commit f8ba15d

Please sign in to comment.