Skip to content

Commit

Permalink
Pep8 fixes
Browse files Browse the repository at this point in the history
Just some small pep8 fixes.
  • Loading branch information
nwlambert committed Feb 24, 2024
1 parent 0f68d90 commit 3315727
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
5 changes: 2 additions & 3 deletions qutip/solver/heom/bofin_solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,10 +965,9 @@ def steady_state(
else:
L = L.tocsc()
solution = spsolve(L, b_mat)
data = _data.Dense(solution[:n ** 2].reshape((n, n), order = 'F'))

data = _data.Dense(solution[:n ** 2].reshape((n, n), order='F'))
data = _data.mul(_data.add(data, data.adjoint()), 0.5)

steady_state = Qobj(data, dims=self._sys_dims)

solution = solution.reshape((self._n_ados, n, n))
Expand Down
10 changes: 4 additions & 6 deletions qutip/tests/solver/heom/test_bofin_solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,14 +740,14 @@ def test_pure_dephasing_model_bosonic_bath(
assert rho_final == ado_state.extract(0)
else:
assert_raises_steady_state_time_dependent(hsolver)



def test_steady_state_bosonic_bath(
self, atol=1e-3
):
H_sys = 0.25 * sigmaz() + 0.5 * sigmay()
H_sys = 0.25 * sigmaz() + 0.5 * sigmay()

bath = DrudeLorentzBath(sigmaz(), lam=0.025, gamma=0.05, T=1/0.95, Nk=2)
bath = DrudeLorentzBath(sigmaz(), lam=0.025,
gamma=0.05, T=1/0.95, Nk=2)
options = {"nsteps": 15000, "store_states": True}
hsolver = HEOMSolver(H_sys, bath, 5, options=options)

Expand All @@ -758,8 +758,6 @@ def test_steady_state_bosonic_bath(
rho_final, ado_state = hsolver.steady_state()
fid = fidelity(rho_final, result.states[-1])
np.testing.assert_allclose(fid, 1.0, atol=atol)



@pytest.mark.parametrize(['terminator'], [
pytest.param(True, id="terminator"),
Expand Down

0 comments on commit 3315727

Please sign in to comment.