Showing 49 of 316 total issues
Function file_data_store
has a Cognitive Complexity of 73 (exceeds 20 allowed). Consider refactoring. Open
def file_data_store(filename, data, numtype="complex", numformat="decimal",
sep=","):
"""Stores a matrix of data to a file to be read by an external program.
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 hinton
has a Cognitive Complexity of 68 (exceeds 20 allowed). Consider refactoring. Open
def hinton(rho, x_basis=None, y_basis=None, color_style="scaled",
label_top=True, *, cmap=None, colorbar=True, fig=None, ax=None):
"""Draws a Hinton diagram to visualize a density matrix or superoperator.
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 _eigs_csr
has a Cognitive Complexity of 48 (exceeds 20 allowed). Consider refactoring. Open
def _eigs_csr(data, isherm, vecs, eigvals, num_large, num_small, tol, maxiter):
"""
Internal functions for computing eigenvalues and eigenstates for a sparse
matrix.
"""
- 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 file_data_read
has a Cognitive Complexity of 48 (exceeds 20 allowed). Consider refactoring. Open
def file_data_read(filename, sep=None):
"""Retrieves an array of data from the requested file.
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 _generic_pmap
has a Cognitive Complexity of 37 (exceeds 20 allowed). Consider refactoring. Open
def _generic_pmap(task, values, task_args, task_kwargs, reduce_func,
timeout, fail_fast, num_workers,
progress_bar, progress_bar_kwargs,
setup_executor, extract_result, shutdown_executor):
"""
- 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
Qobj
has 78 functions (exceeds 75 allowed). Consider refactoring. Open
class Qobj:
"""
A class for representing quantum objects, such as quantum operators and
states.
Function _wigner_laguerre
has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring. Open
def _wigner_laguerre(rho, xvec, yvec, g, parallel):
r"""
Using Laguerre polynomials from scipy to evaluate the Wigner function for
the density matrices :math:`|m><n|`, :math:`W_{mn}`. The total Wigner
function is calculated as :math:`W = \sum_{mn} \rho_{mn} W_{mn}`.
- 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 smesolve
has 15 arguments (exceeds 10 allowed). Consider refactoring. Open
def smesolve(
Function simdiag
has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring. Open
def simdiag(ops, evals: bool = True, *,
tol: float = 1e-14, safe_mode: bool = True):
"""Simultaneous diagonalization of commuting Hermitian matrices.
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 ssesolve
has 14 arguments (exceeds 10 allowed). Consider refactoring. Open
def ssesolve(
Function tensor
has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring. Open
def tensor(*args):
"""Calculates the tensor product of input operators.
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 _eigs_dense
has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring. Open
def _eigs_dense(data, isherm, vecs, eigvals, num_large, num_small):
"""
Internal functions for computing eigenvalues and eigenstates for a dense
matrix.
"""
- 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 _generic_pmap
has 13 arguments (exceeds 10 allowed). Consider refactoring. Open
def _generic_pmap(task, values, task_args, task_kwargs, reduce_func,
Function matrix_histogram
has 13 arguments (exceeds 10 allowed). Consider refactoring. Open
def matrix_histogram(M, x_basis=None, y_basis=None, limits=None,
Function mcsolve
has 13 arguments (exceeds 10 allowed). Consider refactoring. Open
def mcsolve(H, state, tlist, c_ops=(), e_ops=None, ntraj=500, *,
Function plot_wigner
has 13 arguments (exceeds 10 allowed). Consider refactoring. Open
def plot_wigner(rho, xvec=None, yvec=None, method='clenshaw', projection='2d',
Function anim_matrix_histogram
has 13 arguments (exceeds 10 allowed). Consider refactoring. Open
def anim_matrix_histogram(Ms, x_basis=None, y_basis=None, limits=None,
Function anim_wigner
has 13 arguments (exceeds 10 allowed). Consider refactoring. Open
def anim_wigner(rhos, xvec=None, yvec=None, method='clenshaw', projection='2d',
Function nm_mcsolve
has 12 arguments (exceeds 10 allowed). Consider refactoring. Open
def nm_mcsolve(H, state, tlist, ops_and_rates=(), e_ops=None, ntraj=500, *,
Avoid deeply nested control flow statements. Open
if n != N - 1:
f.write(sep)
f.write("\n")