Skip to content

Commit

Permalink
remove unused fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
albi3ro committed Sep 13, 2024
1 parent adbf1fb commit c2083d1
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions tests/test_vqe.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,41 +193,6 @@ def amp_embed_and_strong_ent_layer(params, wires=None):
(amp_embed_and_strong_ent_layer, (EMBED_PARAMS, LAYER_PARAMS)),
]

#####################################################
# Device


@pytest.fixture(scope="function", name="mock_device")
def mock_device_fixture(monkeypatch):
with monkeypatch.context() as m:
m.setattr(qml.devices.LegacyDevice, "__abstractmethods__", frozenset())
m.setattr(
qml.devices.LegacyDevice,
"_capabilities",
{"supports_tensor_observables": True, "model": "qubit"},
)
m.setattr(
qml.devices.LegacyDevice,
"operations",
["RX", "RY", "Rot", "CNOT", "Hadamard", "StatePrep"],
)
m.setattr(
qml.devices.LegacyDevice,
"observables",
["PauliX", "PauliY", "PauliZ", "Hadamard", "Hermitian"],
)
m.setattr(qml.devices.LegacyDevice, "short_name", "MockDevice")
m.setattr(qml.devices.LegacyDevice, "expval", lambda self, x, y, z: 1)
m.setattr(qml.devices.LegacyDevice, "var", lambda self, x, y, z: 2)
m.setattr(qml.devices.LegacyDevice, "sample", lambda self, x, y, z: 3)
m.setattr(qml.devices.LegacyDevice, "apply", lambda self, x, y, z: None)

def get_device(wires=1):
return qml.LegacyDevice(wires=wires) # pylint:disable=abstract-class-instantiated

yield get_device


#####################################################
# Queues

Expand Down

0 comments on commit c2083d1

Please sign in to comment.