Ql: loaded quality factor, Qc: coupling quality factor, Qi: internal quality factor. overcoupled regime: Qc<Qi, for Qc<<Qi we have Qc~Ql and the S11 shows only a phase signal.
In [76]:
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from IPython.display import display
%matplotlib inline
First, we generate some fake data which we can fit later:
In [77]:
from resonator_tools import circuit
fr = 7e9 #resonance frequency in Hz
Qi = 200e3
Qc = 400e3
freq = np.linspace(fr-0.5e6, fr+0.5e6, 1000)
port1 = circuit.reflection_port() #define a reflection port
noise = np.random.normal(loc=1.0,scale=0.01,size=(len(freq),))
S11 = noise * port1._S11_directrefl(freq,fr=fr,Ql=Qi*Qc/(Qc+Qi),Qc=Qc,a=1.,alpha=0.,delay=.0)
port1.add_data(freq,S11)
Let's plot the data:
In [78]:
plt.rcParams["figure.figsize"] = [10,5]
port1.plotrawdata()
...and fit it: (since we know the electric delay, we tell it the program, this makes it more accurate)
In [79]:
port1.autofit(electric_delay=0.)
...and plot the result:
In [80]:
port1.plotall()
Next, let us have a look at the fit results. Here, we convert the dictionary of results into a dataframe to display it in a nicer way.
In [81]:
display(pd.DataFrame([port1.fitresults]).applymap(lambda x: "{0:.2e}".format(x)))
Finally, we can calculate the single photon limit, i.e., the input power necessary to maintain one photon on average in the resonator:
In [82]:
print 'Single photon limit: %.2f dBm' % port1.get_single_photon_limit()
Or, we can compute the photons in the resonator for a given power:
In [83]:
print 'At -100dBm, we have %.2e photons in the resonator' % port1.get_photons_in_resonator(-100)
Here, we study the case where internal losses become negigible, and the amplitude signal vanishes.
First, we generate some fake data which we can fit later:
In [84]:
from resonator_tools import circuit
fr = 7e9 #resonance frequency in Hz
Qi = 10000e3
Qc = 100e3
freq = np.linspace(fr-0.5e6, fr+0.5e6, 1000)
port2 = circuit.reflection_port() #define a reflection port
noise = np.random.normal(loc=1.,scale=0.04,size=(len(freq),))
S11 = noise * port1._S11_directrefl(freq,fr=fr,Ql=Qi*Qc/(Qc+Qi),Qc=Qc,a=1.,alpha=0.,delay=.0)
port2.add_data(freq,S11)
Let's plot the data:
In [85]:
port2.plotrawdata()
Here, we see that the amplitude signal completely vanishes in the noise
Fit the signal:
IMPORTANT: In the presence of a lot of noise, it is necessary to specify the electric delay by hand
In [86]:
port2.autofit(electric_delay=0.)
...and plot the result:
In [87]:
port2.plotall()
Next, let us have a look at the fit results. Here, we convert the dictionary of results into a dataframe to display it in a nicer way.
In [88]:
display(pd.DataFrame([port2.fitresults]).applymap(lambda x: "{0:.2e}".format(x)))
Finally, we can calculate the single photon limit, i.e., the input power necessary to maintain one photon on average in the resonator:
In [89]:
print 'Single photon limit: %.2f dBm' % port2.get_single_photon_limit()
Or, we can compute the photons in the resonator for a given power:
In [90]:
print 'At -100dBm, we have %.2e photons in the resonator' % port2.get_photons_in_resonator(-100)