Fixed a factor of 2. U_E, as defined in the code is 2x the peak energy. After the fix, I have quantitative agreement between the Q HFSS gives, and the Q coupling calculated with this code. This is for qubit + resonator system who's only loss is through a single port. I get Qhfss = 7.138332e+03 and Qpyepr=7.387072e+03. So I think we are good now.
Fixed a factor of 2. U_E, as defined in the code is 2x the peak energy. After the fix, I have quantitative agreement between the Q HFSS gives, and the Q coupling calculated with this code. This is for qubit + resonator system who's only loss is through a single port. I get Qhfss = 7.138332e+03 and Qpyepr=7.387072e+03. So I think we are good now.