@@ -273,7 +273,7 @@ function _check_wrapping_into_paulifreqtracker(psum::PauliSum, max_freq, max_sin
273273
274274 # if max_freq or max_sins are used, and the coefficients are not PathProperties (could be custom)
275275 # then we wrap the coefficients in `PauliFreqTracker`
276- if (max_freq != Inf | max_sins != Inf ) & & ! (coefftype (psum) <: PathProperties )
276+ if (( max_freq != Inf ) | ( max_sins != Inf )) & ! (coefftype (psum) <: PathProperties )
277277 psum = wrapcoefficients (psum, PauliFreqTracker)
278278 return psum
279279 end
@@ -300,7 +300,7 @@ function _check_unwrap_from_paulifreqtracker(::Type{CT}, psum::PauliSum{TT,PFT})
300300 # we need to unwrap the coefficients
301301
302302 # if the original coefficient type (CT) is not PauliFreqTracker (PFT), then unwrap
303- if ! ( CT == PFT)
303+ if CT != PFT
304304 psum = unwrapcoefficients (psum)
305305 end
306306 return psum
@@ -317,21 +317,21 @@ function _checkfreqandsinfields(psum, max_freq, max_sins)
317317
318318 CT = coefftype (psum)
319319
320- if ! (CT <: PathProperties ) && ( max_freq != Inf || max_sins != Inf )
320+ if ! (CT <: PathProperties ) & (( max_freq != Inf ) | ( max_sins != Inf ) )
321321 throw (ArgumentError (
322322 " The `max_freq` and `max_sins` truncations can only be used with coefficients wrapped in `PathProperties` types.\n " *
323323 " Consider using `wrapcoefficients() with the `PauliFreqTracker` type" *
324324 " or use the out-of-place `propagate()` function for automatic conversion." )
325325 )
326326 end
327327
328- if max_freq != Inf && ! hasfield (CT, :freq )
328+ if ( max_freq != Inf ) & ( ! hasfield (CT, :freq ) )
329329 throw (ArgumentError (
330330 " The `max_freq` truncation is used, but the PathProperties type $CT does not have a `freq` field." )
331331 )
332332 end
333333
334- if max_sins != Inf && ! hasfield (CT, :nsins )
334+ if ( max_sins != Inf ) & ( ! hasfield (CT, :nsins ) )
335335 throw (ArgumentError (
336336 " The `max_sins` truncation is used, but the PathProperties type $CT does not have a `nsins` field." )
337337 )
0 commit comments