예제 #1
0
 def test_LC_double_series_L_double_series_C(self):
     C = 1e-8
     L = 3
     circuit = core.Network([
         core.C(0, 1, C * 2),
         core.C(1, 2, C * 2),
         core.L(2, 3, L / 2),
         core.L(3, 0, L / 2)
     ])
     f, k, A, chi = circuit.f_k_A_chi()
     f_expected = 1 / np.sqrt(L * C) / 2 / np.pi
     self.assertRelativelyClose(f_expected, f)
예제 #2
0
 def parameters(self, Cj, Lj, Cc, Cr, Lr):
     circuit = core.Network([
         core.C(0, 1, Cj),
         core.J(0, 1, Lj),
         core.C(1, 2, Cc),
         core.C(0, 2, Cr),
         core.L(0, 2, Lr)
     ])
     return circuit.f_k_A_chi()
예제 #3
0
 def test_sweeping_LJ_in_fkAchi(self):
     cir = core.Network([
         core.C(0, 1, 100e-15),
         core.J(0, 1, 'L_J'),
         core.C(1, 2, 1e-15),
         core.C(2, 0, 100e-15),
         core.L(2, 0, 10e-9),
         core.R(2, 0, 1e6)
     ])
     [cir.f_k_A_chi(L_J=x) for x in [1e-9, 2e-9]]
예제 #4
0
 def test_sweeping_CJ_array_in_zpf(self):
     C_comp = core.C(0, 1, 'C_J')
     cir = core.Network([
         C_comp,
         core.J(0, 1, 10e-9),
         core.C(1, 2, 1e-15),
         core.C(2, 0, 100e-15),
         core.L(2, 0, 10e-9),
         core.R(2, 0, 1e6)
     ])
     self.assertRelativelyClose(
         C_comp.zpf(mode=1, quantity='charge', C_J=1.5e-9),
         C_comp.zpf(mode=1, quantity='charge', C_J=[1e-9, 1.5e-9, 3e-9])[1])
예제 #5
0
파일: test_core.py 프로젝트: qucat/qucat
    def revaluing_labelled_valued_component_twice(self):
        '''
        Adressing last error appearing in issue #83
        '''
        cir = core.Network(
            [core.L(0, 1, 1),
             core.C(0, 1, 1),
             core.R(0, 1, 'R', 1)])
        try:
            cir.loss_rates(R=1)
        except Exception:
            pass

        with self.assertRaises(ValueError):
            cir.loss_rates(R=1)
예제 #6
0
 def parameters(self, R, L, C):
     circuit = core.Network(
         [core.C(0, 1, C),
          core.L(1, 2, L),
          core.R(0, 2, R)])
     return circuit.f_k_A_chi()