code: def apply_givens(Q, v, k):
      
      for j in range(k):
          Qloc = Q[j]
          v[j:j+2] = np.dot(Qloc, v[j:j+2])
docs: Apply the first k Givens rotations in Q to v.
  
      Parameters
      ----------
      Q : list
          list of consecutive 2x2 Givens rotations
      v : array
          vector to apply the rotations to
      k : int
          number of rotations to apply.
  
      Returns
      -------
      v is changed in place
  
      Notes
      -----
      This routine is specialized for GMRES.  It assumes that the first Givens
      rotation is for dofs 0 and 1, the second Givens rotation is for
      dofs 1 and 2, and so on.