@@ -223,22 +223,24 @@ def shear(self) -> None:
223223 Used when the leading matrix is nilpotent, this shifts the polynomial degrees
224224 of the variables to expose the hidden sub-exponential growths.
225225 """
226- g = self ._compute_shear_slope ()
226+ slope = self ._compute_shear_slope ()
227227
228- if g == sp .S .Zero :
228+ if slope == sp .S .Zero :
229229 self ._check_eigenvalue_blindness (self .M .coeffs [0 ][0 , 0 ])
230230 self ._is_reduced = True
231231 return
232232
233- if not g .is_integer :
234- g , b = g .as_numer_denom ()
235- self .M , self .S_total = self .M .ramify (b ), self .S_total .ramify (b )
236- self .p *= b
237- self .precision *= b
233+ shift , ramification = slope .as_numer_denom ()
234+ self .M , self .S_total = (
235+ self .M .ramify (ramification ),
236+ self .S_total .ramify (ramification ),
237+ )
238+ self .p *= ramification
239+ self .precision *= ramification
238240
239- true_valid_precision , max_shift = self ._check_shear_truncation (g )
241+ true_valid_precision , max_shift = self ._check_shear_truncation (shift )
240242
241- logger .debug (f"SHEAR: Computed slope { g = } . Max shift: { max_shift = } terms." )
243+ logger .debug (f"SHEAR: Computed shift { shift = } . Max shift: { max_shift = } terms." )
242244 if max_shift > 0 :
243245 padded_coeffs = (
244246 self .S_total .coeffs + [Matrix .zeros (self .dim , self .dim )] * max_shift
@@ -252,12 +254,12 @@ def shear(self) -> None:
252254 f"Remaining buffer: { self .S_total .precision - max_shift } "
253255 )
254256
255- S_sym = Matrix .diag (* [t ** (i * g ) for i in range (self .dim )])
257+ S_sym = Matrix .diag (* [t ** (i * shift ) for i in range (self .dim )])
256258 S_series = SeriesMatrix .from_matrix (S_sym , n , self .p , self .S_total .precision )
257259
258260 self .S_total = self .S_total * S_series
259261
260- self .M , h = self .M .shear_coboundary (g , true_valid_precision )
262+ self .M , h = self .M .shear_coboundary (shift , true_valid_precision )
261263 self .precision = true_valid_precision
262264
263265 if h != 0 :
@@ -310,11 +312,11 @@ def _compute_shear_slope(self) -> sp.Rational:
310312
311313 p1 , p2 = lower_hull [0 ], lower_hull [1 ]
312314 steepest_slope = sp .Rational (p2 [1 ] - p1 [1 ], p2 [0 ] - p1 [0 ])
313- g = - steepest_slope
315+ slope = - steepest_slope
314316
315317 logger .debug (f"NEWTON: Lower hull points: { lower_hull } " )
316- logger .debug (f"NEWTON: Computed slope { g = } " )
317- return max (sp .S .Zero , g )
318+ logger .debug (f"NEWTON: Computed { slope = } " )
319+ return max (sp .S .Zero , slope )
318320
319321 def _check_eigenvalue_blindness (self , exp_base : sp .Expr ) -> None :
320322 """
0 commit comments