Skip to content

Commit af89fed

Browse files
author
vtomole
committed
Format
1 parent 9709653 commit af89fed

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

src/openfermion/utils/_trotter_exp_to_qgates_test.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,14 @@ def test_exceptions(self):
3232
# Test exceptions in trotter_operator_grouping()
3333

3434
with self.assertRaises(ValueError):
35-
_ = [i for i in trotter_operator_grouping(self.qo1, trotter_order=0)]
35+
_ = [
36+
i for i in trotter_operator_grouping(self.qo1, trotter_order=0)
37+
]
3638

3739
with self.assertRaises(ValueError):
38-
_ = [i for i in trotter_operator_grouping(self.qo1, trotter_order=4)]
40+
_ = [
41+
i for i in trotter_operator_grouping(self.qo1, trotter_order=4)
42+
]
3943

4044
with self.assertRaises(TypeError):
4145
_ = [i for i in trotter_operator_grouping(42)]
@@ -46,17 +50,22 @@ def test_exceptions(self):
4650

4751
emptyTO = []
4852
with self.assertRaises(TypeError):
49-
_ = [i for i in trotter_operator_grouping(self.qo1,
50-
term_ordering=emptyTO)]
53+
_ = [
54+
i for i in trotter_operator_grouping(self.qo1,
55+
term_ordering=emptyTO)
56+
]
5157

5258
# Too few ops for 2nd-order
5359
with self.assertRaises(ValueError):
54-
_ = [i for i in trotter_operator_grouping(self.opA, trotter_order=2)]
60+
_ = [
61+
i for i in trotter_operator_grouping(self.opA, trotter_order=2)
62+
]
5563

5664
# Too few ops for 3rd-order
5765
with self.assertRaises(ValueError):
58-
_ = [i for i in trotter_operator_grouping(self.opA,
59-
trotter_order=3)]
66+
_ = [
67+
i for i in trotter_operator_grouping(self.opA, trotter_order=3)
68+
]
6069

6170
def compare_qubop_lists(self, gold, res):
6271
# Compare lists of operators. Used in most test functions.

0 commit comments

Comments
 (0)