Skip to content

Commit 0fb203b

Browse files
committed
docstrings; test case names
1 parent 6ba6928 commit 0fb203b

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

tests/test_measurements.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -694,8 +694,8 @@ def circuit():
694694
assert len(binned_samples) == len(shot_vec)
695695
assert sum(sum(v for v in bin.values()) for bin in binned_samples) == sum(shot_vec)
696696

697-
def test_counts_state_jax(self, tol):
698-
"Check jax interface with state vector counts"
697+
def test_counts_jax(self, tol):
698+
"""Check jax interface with computational basis state counts"""
699699
n_shots = 10
700700
dev = qml.device("default.qubit", wires=3, shots=n_shots)
701701

@@ -707,7 +707,7 @@ def circuit():
707707
assert res == {"000": n_shots}
708708

709709
def test_counts_operator_jax(self, tol):
710-
"Check jax interface with observable measurement counts"
710+
"""Check jax interface with observable measurement counts"""
711711
n_shots = 10
712712
dev = qml.device("default.qubit", wires=3, shots=n_shots)
713713

@@ -718,8 +718,8 @@ def circuit():
718718
res = circuit()
719719
assert res == {1: n_shots}
720720

721-
def test_counts_state_tf(self, tol):
722-
"Check TensorFlow interface with state vector counts"
721+
def test_counts_tf(self, tol):
722+
"""Check TensorFlow interface with computational basis state counts"""
723723
n_shots = 10
724724
dev = qml.device("default.qubit", wires=3, shots=n_shots)
725725

@@ -731,7 +731,7 @@ def circuit():
731731
assert res == {"000": n_shots}
732732

733733
def test_counts_operator_tf(self, tol):
734-
"Check TensorFlow interface with observable measurement counts"
734+
"""Check TensorFlow interface with observable measurement counts"""
735735
n_shots = 10
736736
dev = qml.device("default.qubit", wires=3, shots=n_shots)
737737

@@ -742,8 +742,8 @@ def circuit():
742742
res = circuit()
743743
assert res == {1: n_shots}
744744

745-
def test_counts_state_torch(self, tol):
746-
"Check pyTorch interface with state vector counts"
745+
def test_counts_torch(self, tol):
746+
"""Check pyTorch interface with computational basis state counts"""
747747
n_shots = 10
748748
dev = qml.device("default.qubit", wires=3, shots=n_shots)
749749

@@ -755,7 +755,7 @@ def circuit():
755755
assert res == {"000": n_shots}
756756

757757
def test_counts_operator_torch(self, tol):
758-
"Check pyTorch interface with observable measurement counts"
758+
"""Check pyTorch interface with observable measurement counts"""
759759
n_shots = 10
760760
dev = qml.device("default.qubit", wires=3, shots=n_shots)
761761

@@ -766,8 +766,8 @@ def circuit():
766766
res = circuit()
767767
assert res == {1: n_shots}
768768

769-
def test_counts_state_jax_binned(self, tol):
770-
"Check jax interface with state vector counts"
769+
def test_counts_jax_binned(self, tol):
770+
"""Check jax interface with computational basis state counts"""
771771
shot_vec = (10, 10)
772772
dev = qml.device("default.qubit", wires=3, shots=shot_vec)
773773

@@ -780,7 +780,7 @@ def circuit():
780780
assert res[1] == {"000": shot_vec[1]}
781781

782782
def test_counts_operator_jax_binned(self, tol):
783-
"Check jax interface with observable measurement counts"
783+
"""Check jax interface with observable measurement counts"""
784784
shot_vec = (10, 10)
785785
dev = qml.device("default.qubit", wires=3, shots=shot_vec)
786786

@@ -792,8 +792,8 @@ def circuit():
792792
assert res[0] == {1: shot_vec[0]}
793793
assert res[1] == {1: shot_vec[1]}
794794

795-
def test_counts_state_tf_binned(self, tol):
796-
"Check TensorFlow interface with state vector counts"
795+
def test_counts_tf_binned(self, tol):
796+
"""Check TensorFlow interface with computational basis state counts"""
797797
shot_vec = (10, 10)
798798
dev = qml.device("default.qubit", wires=3, shots=shot_vec)
799799

@@ -806,7 +806,7 @@ def circuit():
806806
assert res[1] == {"000": shot_vec[1]}
807807

808808
def test_counts_operator_tf_binned(self, tol):
809-
"Check TensorFlow interface with observable measurement counts"
809+
"""Check TensorFlow interface with observable measurement counts"""
810810
shot_vec = (10, 10)
811811
dev = qml.device("default.qubit", wires=3, shots=shot_vec)
812812

@@ -818,8 +818,8 @@ def circuit():
818818
assert res[0] == {1: shot_vec[0]}
819819
assert res[1] == {1: shot_vec[1]}
820820

821-
def test_counts_state_torch_binned(self, tol):
822-
"Check pyTorch interface with state vector counts"
821+
def test_counts_torch_binned(self, tol):
822+
"""Check pyTorch interface with computational basis state counts"""
823823
shot_vec = (10, 10)
824824
dev = qml.device("default.qubit", wires=3, shots=shot_vec)
825825

@@ -832,7 +832,7 @@ def circuit():
832832
assert res[1] == {"000": shot_vec[1]}
833833

834834
def test_counts_operator_torch_binned(self, tol):
835-
"Check pyTorch interface with observable measurement counts"
835+
"""Check pyTorch interface with observable measurement counts"""
836836
shot_vec = (10, 10)
837837
dev = qml.device("default.qubit", wires=3, shots=shot_vec)
838838

0 commit comments

Comments
 (0)