Skip to content

Commit

Permalink
Remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericgig committed Aug 16, 2023
1 parent a6d0b32 commit 4585c69
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 51 deletions.
7 changes: 7 additions & 0 deletions qutip/core/data/herm_matmul.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
from qutip.core.data.base cimport idxint, Data
from qutip.core.data.dense cimport Dense
from qutip.core.data.csr cimport CSR
from qutip.core.data.dia cimport Dia

cpdef Dense herm_matmul_dia_dense_dense(
Dia left, Dense right,
idxint subsystem_size=*, double complex scale=*,
Data out=*
)

cpdef Dense herm_matmul_csr_dense_dense(
CSR left, Dense right,
Expand Down
22 changes: 1 addition & 21 deletions qutip/core/data/src/matmul_diag_vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,30 +115,10 @@ void _matmul_diag_vector_herm(
row += 1;
ptr += 2;
if (row == subsystem_size){
col += 1;
row = 0;
col += 1;
}
}

/*
for (IntT row=0; row<subsystem_size; row++){
for (IntT col=row; col<subsystem_size; col++){
ptr = (row*subsystem_size + col)*2;
if (ptr < start_out * 2){continue;}
if (ptr > (start_out + length) * 2){idx += 2; continue;}
out_dbl[ptr] += idx*10000;
idx += 2;
}
if (ptr > start_out * 2){idx += 2 * (row+1);}
}
for (IntT row=0; row<subsystem_size; row++){
for (IntT col=0; col<row; col++){
}
}
*/
}

template void _matmul_diag_vector_herm<>(
Expand Down
26 changes: 0 additions & 26 deletions qutip/solver/brmesolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,29 +374,3 @@ def options(self):
@options.setter
def options(self, new_options):
Solver.options.fset(self, new_options)

"""
def _apply_options(self, keys):
need_new_rhs = self.rhs is not None and not self.rhs.isconstant
need_new_rhs &= (
'sparse_eigensolver' in keys or 'tensor_type' in keys
)
if need_new_rhs:
self.rhs = self._prepare_rhs()
if hasattr(self, "_rhs") and "use_herm_matmul" in keys:
self._rhs = self._update_rhs()
# Ensure the integrator is reset
keys = set(keys)
keys.add('method')
if self._integrator is None or not keys:
pass
elif 'method' in keys or need_new_rhs:
state = self._integrator.get_state()
self._integrator = self._get_integrator()
self._integrator.set_state(*state)
else:
self._integrator.options = self._options
self._integrator.reset(hard=True)
"""
4 changes: 2 additions & 2 deletions qutip/solver/solver_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ class Solver:
_reset_options = {"method"}
resultclass = Result

def __init__(self, rhs=None, *, options=None):
def __init__(self, rhs, *, options=None):
if isinstance(rhs, (QobjEvo, Qobj)):
self.rhs = QobjEvo(rhs)
elif rhs is not None:
TypeError("The rhs must be a QobjEvo")
self.options = options
self._state_metadata = {}
self._integrator = self._get_integrator()
self._state_metadata = {}
self.stats = self._initialize_stats()

def _initialize_stats(self):
Expand Down
4 changes: 2 additions & 2 deletions qutip/tests/core/data/test_specialized_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
(Dia, Dense, data.herm_matmul_dia_dense_dense),
(Dense, CSR, data.herm_matmul_data),
])
def test_herm_matmul(op_type, state_type, function):
N = 20
@pytest.mark.parametrize("N", [1, 2, 5, 10, 25])
def test_herm_matmul(N, op_type, state_type, function):
H = qutip.rand_herm(N, dtype=op_type)
a = qutip.destroy(N, dtype=op_type)
L = qutip.liouvillian(H, [a]).to(op_type).data
Expand Down

0 comments on commit 4585c69

Please sign in to comment.