Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
apchytr committed Oct 24, 2024
1 parent b5c4334 commit 5e98362
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion mrmustard/lab_dev/states/dm.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def __getitem__(self, modes: int | Sequence[int]) -> State:
idxz_conj = [i + len(self.modes) for i, m in enumerate(self.modes) if m not in modes]
ansatz = self.ansatz.trace(idxz, idxz_conj)

return self._from_attributes(Representation(ansatz, wires), self.name)
return DM(Representation(ansatz, wires), self.name)

def __rshift__(self, other: CircuitComponent) -> CircuitComponent:
r"""
Expand Down
10 changes: 3 additions & 7 deletions tests/test_lab_dev/test_states/test_dm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

"""Tests for the density matrix."""

# pylint: disable=protected-access, unspecified-encoding, missing-function-docstring, expression-not-assigned, pointless-statement
# pylint: disable=unspecified-encoding, missing-function-docstring, expression-not-assigned, pointless-statement

from itertools import product
import numpy as np
Expand Down Expand Up @@ -346,13 +346,9 @@ def test_expectation_error(self):
def test_rshift(self):
ket = Coherent([0, 1], 1)
unitary = Dgate([0], 1)
u_component = CircuitComponent._from_attributes(
unitary.representation, unitary.name
) # pylint: disable=protected-access
u_component = CircuitComponent(unitary.representation, unitary.name)
channel = Attenuator([1], 1)
ch_component = CircuitComponent._from_attributes(
channel.representation, channel.name
) # pylint: disable=protected-access
ch_component = CircuitComponent(channel.representation, channel.name)

dm = ket >> channel

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

"""Tests for the ``GaussRandNoise`` class."""

# pylint: disable=protected-access, missing-function-docstring, expression-not-assigned
# pylint: disable=missing-function-docstring, expression-not-assigned

import numpy as np

Expand Down

0 comments on commit 5e98362

Please sign in to comment.