Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
astralcai committed Sep 17, 2024
1 parent f386714 commit 9aa6d4e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion tests/devices/default_qubit/test_default_qubit.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def circuit():

# pylint: disable=protected-access
def test_applied_modifiers():
"""Test that defualt qubit has the `single_tape_support` and `simulator_tracking`
"""Test that default qubit has the `single_tape_support` and `simulator_tracking`
modifiers applied.
"""
dev = DefaultQubit()
Expand Down
2 changes: 1 addition & 1 deletion tests/devices/test_default_clifford.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

# pylint: disable=protected-access
def test_applied_modifiers():
"""Test that defualt qubit has the `single_tape_support` and `simulator_tracking`
"""Test that default qubit has the `single_tape_support` and `simulator_tracking`
modifiers applied.
"""
dev = qml.device("default.clifford")
Expand Down
30 changes: 15 additions & 15 deletions tests/transforms/test_tape_expand.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_device_and_stopping_expansion(self):
"""Test that passing a device alongside a stopping condition ensures
that all operations are expanded to match the devices default gate
set"""
dev = qml.device("defualt.mixed", wires=1)
dev = qml.device("default.mixed", wires=1)
expand_fn = qml.transforms.create_expand_fn(device=dev, depth=10, stop_at=self.crit_0)

with qml.queuing.AnnotatedQueue() as q:
Expand All @@ -82,7 +82,7 @@ def test_device_and_stopping_expansion(self):
def test_device_only_expansion(self):
"""Test that passing a device ensures that all operations are expanded
to match the devices default gate set"""
dev = qml.device("defualt.mixed", wires=1)
dev = qml.device("default.mixed", wires=1)
expand_fn = qml.transforms.create_expand_fn(device=dev, depth=10)

with qml.queuing.AnnotatedQueue() as q:
Expand Down Expand Up @@ -428,7 +428,7 @@ def custom_basic_entangler_layers(weights, wires, **kwargs):
class TestCreateCustomDecompExpandFn:
"""Tests for the custom_decomps argument for devices"""

@pytest.mark.parametrize("device_name", ["default.qubit", "defualt.mixed"])
@pytest.mark.parametrize("device_name", ["default.qubit", "default.mixed"])
def test_string_and_operator_allowed(self, device_name):
"""Test that the custom_decomps dictionary accepts both strings and operator classes as keys."""

Expand All @@ -449,7 +449,7 @@ def circuit():
assert op.name != "Hadamard"
assert op.name != "CNOT"

@pytest.mark.parametrize("device_name", ["default.qubit", "defualt.mixed"])
@pytest.mark.parametrize("device_name", ["default.qubit", "default.mixed"])
def test_no_custom_decomp(self, device_name):
"""Test that sending an empty dictionary results in no decompositions."""

Expand All @@ -475,7 +475,7 @@ def circuit():
orig_op.name == decomp_op.name for orig_op, decomp_op in zip(original_ops, decomp_ops)
]

@pytest.mark.parametrize("device_name", ["default.qubit", "defualt.mixed"])
@pytest.mark.parametrize("device_name", ["default.qubit", "default.mixed"])
def test_no_custom_decomp_template(self, device_name):
"""Test that sending an empty dictionary results in no decomposition
when a template is involved, except the decomposition expected from the device."""
Expand All @@ -501,7 +501,7 @@ def circuit():
orig_op.name == decomp_op.name for orig_op, decomp_op in zip(original_ops, decomp_ops)
]

@pytest.mark.parametrize("device_name", ["default.qubit", "defualt.mixed", "lightning.qubit"])
@pytest.mark.parametrize("device_name", ["default.qubit", "default.mixed", "lightning.qubit"])
def test_one_custom_decomp(self, device_name):
"""Test that specifying a single custom decomposition works as expected."""

Expand All @@ -526,7 +526,7 @@ def circuit():

assert decomp_ops[2].name == "CNOT"

@pytest.mark.parametrize("device_name", ["default.qubit", "defualt.mixed"])
@pytest.mark.parametrize("device_name", ["default.qubit", "default.mixed"])
def test_no_decomp_with_depth_zero(self, device_name):
"""Test that specifying a single custom decomposition works as expected."""

Expand All @@ -550,7 +550,7 @@ def circuit():
assert decomp_ops[0].name == "Hadamard"
assert decomp_ops[1].name == "CNOT"

@pytest.mark.parametrize("device_name", ["default.qubit", "defualt.mixed"])
@pytest.mark.parametrize("device_name", ["default.qubit", "default.mixed"])
def test_one_custom_decomp_gradient(self, device_name):
"""Test that gradients are still correctly computed after a decomposition
that performs transpilation."""
Expand Down Expand Up @@ -581,7 +581,7 @@ def circuit(x):
decomp_ops = qml.workflow.construct_batch(decomp_qnode, level=None)(x)[0][0].operations
assert all(op.name == name for op, name in zip(decomp_ops, expected_ops))

@pytest.mark.parametrize("device_name", ["default.qubit", "defualt.mixed"])
@pytest.mark.parametrize("device_name", ["default.qubit", "default.mixed"])
def test_nested_custom_decomp(self, device_name):
"""Test that specifying two custom decompositions that have interdependence
works as expected."""
Expand Down Expand Up @@ -619,7 +619,7 @@ def circuit():

assert decomp_ops[4].name == "CZ"

@pytest.mark.parametrize("device_name", ["default.qubit", "defualt.mixed"])
@pytest.mark.parametrize("device_name", ["default.qubit", "default.mixed"])
def test_nested_custom_decomp_with_template(self, device_name):
"""Test that specifying two custom decompositions that have interdependence
works as expected even when there is a template."""
Expand Down Expand Up @@ -665,7 +665,7 @@ def circuit():
assert np.isclose(decomp_ops[6].parameters[0], np.pi / 2)
assert decomp_ops[6].wires == Wires(1)

@pytest.mark.parametrize("device_name", ["default.qubit", "defualt.mixed"])
@pytest.mark.parametrize("device_name", ["default.qubit", "default.mixed"])
def test_custom_decomp_template_to_template(self, device_name):
"""Test that decomposing a template into another template and some
gates yields the correct results."""
Expand Down Expand Up @@ -700,7 +700,7 @@ def circuit():
assert decomp_ops[4].name == "CNOT"
assert decomp_ops[4].wires == Wires([0, 1])

@pytest.mark.parametrize("device_name", ["default.qubit", "defualt.mixed"])
@pytest.mark.parametrize("device_name", ["default.qubit", "default.mixed"])
def test_custom_decomp_different_depth(self, device_name):
"""Test that alternative expansion depths can be specified."""

Expand Down Expand Up @@ -746,7 +746,7 @@ def circuit():
decomp_ops = qml.workflow.construct_batch(circuit3, level=None)()[0][0].operations
assert len(decomp_ops) == 5

@pytest.mark.parametrize("device_name", ["default.qubit", "defualt.mixed"])
@pytest.mark.parametrize("device_name", ["default.qubit", "default.mixed"])
def test_custom_decomp_with_adjoint(self, device_name):
"""Test that applying an adjoint in the circuit results in the adjoint
undergoing the custom decomposition."""
Expand All @@ -771,7 +771,7 @@ def circuit():
assert decomp_ops[1].name == "Hadamard"
assert decomp_ops[1].wires == Wires("a")

@pytest.mark.parametrize("device_name", ["default.qubit", "defualt.mixed"])
@pytest.mark.parametrize("device_name", ["default.qubit", "default.mixed"])
def test_custom_decomp_with_control(self, device_name):
"""Test that decomposing a controlled version of a gate uses the custom decomposition
for the base gate."""
Expand Down Expand Up @@ -807,7 +807,7 @@ def circuit():
def test_custom_decomp_in_separate_context_legacy_opmath(self):
"""Test that the set_decomposition context manager works."""

dev = qml.device("defualt.mixed", wires=2)
dev = qml.device("default.mixed", wires=2)

@qml.qnode(dev)
def circuit():
Expand Down

0 comments on commit 9aa6d4e

Please sign in to comment.