stanfordLINQS / SQcircuit

Superconducting quantum circuit analyzer
BSD 3-Clause "New" or "Revised" License
43 stars 7 forks source link

Not able to solve the circuit using SQcircuit #18

Open quantumparticle1994 opened 1 year ago

quantumparticle1994 commented 1 year ago

Hi, I a trying to simulate the following circuit using SQcircuit.

Screenshot 2023-02-03 at 2 12 31 PM

Running the circuit in SQcircuit is giving the error. Here i am attaching the code as well as the error.

loop1 = sq.Loop()

C1b = 3.2 C2b = 3.2 C1c = 2.4 C2c = 2.4 Ejb = 5.1 Cb = 100 Ejc = 10.5 Cc = 25.8 Cq1 = 48.4 Cq2 = 48.4 Eq1 = 9.02 Eq2 = 9.67 ng = 0.5 ncut = 30 C1b = sq.Capacitor(C1b,"fF") C2b = sq.Capacitor(C2b,"fF") C1c = sq.Capacitor(C1c,"fF") C2c = sq.Capacitor(C2c,"fF") Cc = sq.Capacitor(Cc,"fF") Cb = sq.Capacitor(Cb,"fF") Cq1 = sq.Capacitor(Cq1,"fF") Cq2 = sq.Capacitor(Cq2,"fF") JJ1 =sq.Junction(Eq1,"GHz") JJ2 = sq.Junction(Eq2,"GHz") JJc1 = sq.Junction(Ejc,"GHz", loops = [loop1]) JJc2 = sq.Junction(Ejc,"GHz", loops = [loop1]) JJb = sq.Inductor(Ejb,"nH")

elements = {(0,1): [Cq1,JJ1], (1,2): [C1c], (2,3): [Cc,JJc1,JJc2], (3,4): [C2c], (4,5): [Cq2,JJ2], (5,6): [C1b], (6,7): [Cb,JJb], (7,0): [C2b] }

tc = sq.Circuit(elements)

Error

LinAlgError Traceback (most recent call last)

in 47 } 48 ---> 49 tc = sq.Circuit(elements) ~/opt/anaconda3/lib/python3.7/site-packages/SQcircuit/circuit.py in __init__(self, elements, flux_dist, random) 102 # and B matrix (loop distribution over inductive elements) 103 (self.C, self.L, self.W, self.B, --> 104 self.partial_C, self.partial_L) = self._get_LCWB() 105 106 # initialize the transformation matrix for charge and flux operators. ~/opt/anaconda3/lib/python3.7/site-packages/SQcircuit/circuit.py in _get_LCWB(self) 393 Y = np.concatenate((np.zeros((B_idx - n_loops, n_loops)), 394 np.eye(n_loops)), axis=0) --> 395 bMat = np.linalg.inv(X) @ Y 396 bMat = np.around(bMat, 5) 397 <__array_function__ internals> in inv(*args, **kwargs) ~/opt/anaconda3/lib/python3.7/site-packages/numpy/linalg/linalg.py in inv(a) 540 a, wrap = _makearray(a) 541 _assert_stacked_2d(a) --> 542 _assert_stacked_square(a) 543 t, result_t = _commonType(a) 544 ~/opt/anaconda3/lib/python3.7/site-packages/numpy/linalg/linalg.py in _assert_stacked_square(*arrays) 211 m, n = a.shape[-2:] 212 if m != n: --> 213 raise LinAlgError('Last 2 dimensions of the array must be square') 214 215 def _assert_finite(*arrays): LinAlgError: Last 2 dimensions of the array must be square