Skip to content

Commit

Permalink
Address nit
Browse files Browse the repository at this point in the history
  • Loading branch information
a-corni committed Dec 17, 2024
1 parent fed600d commit cdb7404
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pulser-simulation/pulser_simulation/hamiltonian.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,9 @@ def _build_operator(
except KeyError:
raise ValueError(f"{operator} is not a valid operator")
elif isinstance(operator, qutip.Qobj):
operator = operator.to(qutip.core.data.CSR)
operator = operator.to("CSR")
else:
operator = qutip.Qobj(operator).to(qutip.core.data.CSR)
operator = qutip.Qobj(operator).to("CSR")
for qubit in qubits:
k = self._qid_index[qubit]
op_list[k] = operator
Expand Down Expand Up @@ -527,8 +527,7 @@ def make_interaction_term(masked: bool = False) -> qutip.Qobj:
return 0 * self.build_operator([("I", "global")])

# make interaction term
with qutip.CoreOptions(default_dtype="CSR"):
dipole_interaction = cast(qutip.Qobj, 0)
dipole_interaction = cast(qutip.Qobj, 0)
for q1, q2 in itertools.combinations(self._qdict.keys(), r=2):
if (
self._bad_atoms[q1]
Expand Down

0 comments on commit cdb7404

Please sign in to comment.