Showing 51 of 317 total issues
Avoid deeply nested control flow statements. Open
if np.imag(data[m, n]) >= 0.0:
f.write("%.10f+%.10fj" % (np.real(data[m, n]),
np.imag(data[m, n])))
else:
f.write("%.10f%.10fj" % (np.real(data[m, n]),
Avoid deeply nested control flow statements. Open
if n != N - 1:
f.write(sep)
f.write("\n")
Function __init__
has 12 arguments (exceeds 10 allowed). Consider refactoring. Open
def __init__(
Avoid deeply nested control flow statements. Open
if m == n:
W += real(rho[m, m] * (-1) ** m * genlaguerre(m, 0)(B))
elif n > m:
W += 2.0 * real(rho[m, n] * (-1) ** m *
Avoid deeply nested control flow statements. Open
if n != N - 1:
f.write(sep)
f.write("\n")
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 np.imag(data[m, n]) >= 0.0:
f.write("%.10e+%.10ej" % (np.real(data[m, n]),
np.imag(data[m, n])))
else:
f.write("%.10e%.10ej" % (np.real(data[m, n]),
Avoid deeply nested control flow statements. Open
if n != N - 1:
f.write(sep)
f.write("\n")
Function correlation_2op_2t
has 11 arguments (exceeds 10 allowed). Consider refactoring. Open
def correlation_2op_2t(H, state0, tlist, taulist, c_ops, a_op, b_op,
Function rcsolve
has 11 arguments (exceeds 10 allowed). Consider refactoring. Open
def rcsolve(Hsys, psi0, tlist, e_ops, Q, wc, alpha, N, w_th, sparse=False,
Function correlation_3op_2t
has 11 arguments (exceeds 10 allowed). Consider refactoring. Open
def correlation_3op_2t(H, state0, tlist, taulist, c_ops, a_op, b_op, c_op,
Function steadystate
has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring. Open
def steadystate(A, c_ops=[], *, method='direct', solver=None, **kwargs):
"""
Calculates the steady state for quantum evolution subject to the supplied
Hamiltonian or Liouvillian operator and (if given a Hamiltonian) a list of
collapse operators.
- 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 solve_csr_dense
has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring. Open
def solve_csr_dense(matrix: Union[CSR, Dia], target: Dense, method=None,
options: dict={}) -> Dense:
"""
Solve ``Ax=b`` for ``x``.
- 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 _find_mkl
has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring. Open
def _find_mkl():
"""
Finds the MKL runtime library for the Anaconda and Intel Python
distributions.
"""
- 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
Avoid too many return
statements within this function. Open
return (fidelity(oper_choi, target_choi)/d)**2
Avoid too many return
statements within this function. Open
return Qobj(_data.add(A, A.adjoint()), dims=dims,
Avoid too many return
statements within this function. Open
return process_fidelity(target, oper) # reverse order
Avoid too many return
statements within this function. Open
return Qobj(out_data,
Avoid too many return
statements within this function. Open
return composite(*(arg.dag() for arg in args)).dag()
Avoid too many return
statements within this function. Open
return self._sum_abs.sum_states