Showing 61 of 125 total issues
Function sample
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def sample(self, rng, state, n_samples, method='cond', n_group=1,
Function sample
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def sample(self, rng, state, n_samples, method, n_group=1, mode='auto',
Function _local_sum_identity
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _local_sum_identity(mpas, embed_tensor=None):
"""Implement a special case of :func:`local_sum`.
See :func:`local_sum` for a description. We return an MPA with
smaller rank than naive embed+MPA-sum.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function reductions_mpo
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def reductions_mpo(mpa, width=None, startsites=None, stopsites=None):
"""Iterate over MPO partial traces of an MPO
The support of the i-th result is :code:`range(startsites[i],
stopsites[i])`.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function approx_range_finder
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def approx_range_finder(A, sketch_size, n_iter, piter_normalizer='auto',
randstate=np.random):
"""Computes an orthonormal matrix whose range approximates the range of A.
Parameters
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _sample_cond
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _sample_cond(self, rng, state, mode, n_samples, n_group, out, eps):
Function _eig_sum_minimize_locally
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def _eig_sum_minimize_locally(
Function randomized_svd
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def randomized_svd(M, n_components, n_oversamples=10, n_iter='auto',
Function eig_sum
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def eig_sum(mpas, num_sweeps, var_sites=2,
Function eig
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def eig(mpo, num_sweeps, var_sites=2,
Function random_mpa
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def random_mpa(sites, ldim, rank, randstate=None, normalized=False,
Function random_mpo
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def random_mpo(sites, ldim, rank, randstate=None, hermitian=False,
Function _eig_sum_leftvec_add
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _eig_sum_leftvec_add(
Function _eig_sum_rightvec_add
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _eig_sum_rightvec_add(
Function _sample_direct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _sample_direct(self, rng, state, mode, n_samples, out, eps):
Function _mppl_lfun_estimator
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _mppl_lfun_estimator(self, est_coeff, est_funs, other, n_samples,
Function _random_op
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _random_op(sites, ldim, hermitian=False, normalized=False, randstate=None,
Function lfun_from
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def lfun_from(self, other, coeff, state, mode='auto', other_weights=None,
Function compression_svd
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def compression_svd(array, rank, direction='right', retproj=False):
"""Re-implement MPArray.compress('svd') but on the level of the dense
array representation, i.e. it truncates the Schmidt-decompostion
on each bipartition sequentially.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function est_lfun
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def est_lfun(self, coeff, funs, samples, weights=None, eps=1e-10):