Exemplo n.º 1
0
    def get_photons_in_resonator(self, power, unit='dBm'):
        '''
		returns the average number of photons
		for a given power (defaul unit is 'dbm')
		unit can be 'dBm' or 'watt'
		'''
        if self.fitresults != {}:
            if unit == 'dBm':
                power = dBm2Watt(power)
            fr = self.fitresults['fr']
            k_c = 2 * np.pi * fr / self.fitresults['Qc']
            k_i = 2 * np.pi * fr / self.fitresults['Qi']
            return 4. * k_c / (2. * np.pi * hbar * fr * (k_c + k_i)**2) * power
        else:
            warnings.warn('Please perform the fit first', UserWarning)
            return None
Exemplo n.º 2
0
    def get_photons_in_resonator(self, power, unit='dBm', diacorr=True):
        '''
		returns the average number of photons
		for a given power in units of W
		unit can be 'dBm' or 'watt'
		'''
        if self.fitresults != {}:
            if unit == 'dBm':
                power = dBm2Watt(power)
            fr = self.fitresults['fr']
            if diacorr:
                k_c = 2 * np.pi * fr / self.fitresults['Qc_dia_corr']
                k_i = 2 * np.pi * fr / self.fitresults['Qi_dia_corr']
            else:
                k_c = 2 * np.pi * fr / self.fitresults['absQc']
                k_i = 2 * np.pi * fr / self.fitresults['Qi_no_corr']
            return 4. * k_c / (2. * np.pi * hbar * fr * (k_c + k_i)**2) * power
        else:
            warnings.warn('Please perform the fit first', UserWarning)
            return None