code: def build_gy(self, dae):
          
          if not self.n:
              idx = range(dae.m)
              dae.set_jac(Gy, 1e-6, idx, idx)
              return
  
          Vn = polar(1.0, dae.y[self.a])
          Vc = mul(dae.y[self.v], Vn)
          Ic = self.Y * Vc
  
          diagVn = spdiag(Vn)
          diagVc = spdiag(Vc)
          diagIc = spdiag(Ic)
  
          dS = self.Y * diagVn
          dS = diagVc * conj(dS)
          dS += conj(diagIc) * diagVn
  
          dR = diagIc
          dR -= self.Y * diagVc
          dR = diagVc.H.T * dR
  
          self.gy_store = sparse([[dR.imag(), dR.real()], [dS.real(),
                                                           dS.imag()]])
  
          return self.gy_store
docs: Build line Jacobian matrix