Commit b22ae086 authored by Daniel Brown's avatar Daniel Brown
Browse files

trace 2 output now shows the roundtrip gouy phase of a cavity and the mode separation frequency

parent 2f2d776f
......@@ -43,10 +43,12 @@ syntax change:
o The 'quantum_scaling' parameter in the kat.ini file has been
replaced by dedicated 'scale' commands, see below.
o The parameter 'epsilon_c' in kat.ini has been removed, instead
'amplitude_scaling' can be used for related scaling of light amplitides
'amplitude_scaling' can be used for related scaling of light amplitudes
versus light power, see below.
added features:
o Cavity `trace 2` output will now show the roundtrip Gouy phase in degrees
and the mode separation frequency.
o Added a homodyne detector output. The main usage is:
hd name phase node1 node2
......
......@@ -1994,6 +1994,8 @@ typedef struct cavity {
double FSR; //!< free spectral range
double FWHM; //!< full width at half maximum
double pole; //!< cavity pole (FWHM/2)
ABCD_t Mx, My; // Roundtrip matrices
} cavity_t;
//! information describing a Gaussian beam
......
......@@ -3908,10 +3908,8 @@ void compute_cavity_params(void) {
}
if (!err_x && !err_y) {
eigen_x =
multiply_ABCD(multiply_ABCD(eigen1_x, inv_ABCD(temp_x)), eigen2_x);
eigen_y =
multiply_ABCD(multiply_ABCD(eigen1_y, inv_ABCD(temp_y)), eigen2_y);
eigen_x = multiply_ABCD(multiply_ABCD(eigen1_x, inv_ABCD(temp_x)), eigen2_x);
eigen_y = multiply_ABCD(multiply_ABCD(eigen1_y, inv_ABCD(temp_y)), eigen2_y);
} else {
bug_error("errxy1");
}
......@@ -3946,6 +3944,9 @@ void compute_cavity_params(void) {
eigen_x = inv_ABCD(eigen_x);
eigen_y = inv_ABCD(eigen_y);
cavity->Mx = eigen_x;
cavity->My = eigen_y;
int m_x = check_ABCD(eigen_x, &cavity->stability_x);
int m_y = check_ABCD(eigen_y, &cavity->stability_y);
......@@ -4227,7 +4228,32 @@ void compute_cavity_params(void) {
message(" FWHM: %sHz (pole: %sHz)\n",
xdouble_form(cavity->FWHM),
xdouble_form(cavity->pole));
if(cavity->stable){
if(cavity->stability_x == cavity->stability_y) {
double gouy_rt = 2 * acos( msign(cavity->Mx.B) * sqrt((cavity->stability_x+1)/2));
if(gouy_rt > PI) gouy_rt -= TWOPI;
message(" RT Gouy: %s deg (mode sep.: %sHz)\n",
xdouble_form(gouy_rt*DEG),
xdouble_form(gouy_rt/TWOPI * cavity->FSR));
} else {
double gouyx_rt = 2 * acos( msign(cavity->Mx.B) * sqrt((cavity->stability_x+1)/2));
double gouyy_rt = 2 * acos( msign(cavity->My.B) * sqrt((cavity->stability_y+1)/2));
if(gouyx_rt > PI) gouyx_rt -= TWOPI;
if(gouyy_rt > PI) gouyy_rt -= TWOPI;
message(" (x) RT Gouy: %s deg, mode sep. %sHz\n",
xdouble_form(gouyx_rt*DEG),
xdouble_form(gouyx_rt/TWOPI * cavity->FSR));
message(" (y) RT Gouy: %s deg, mode sep. %sHz\n",
xdouble_form(gouyy_rt*DEG),
xdouble_form(gouyy_rt/TWOPI * cavity->FSR));
}
}
/*
message(" finesse : %g, round-trip power loss: %g\n",
finesse(1.0 - cavity_power), 1.0 - cavity_power);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment