Skip to content

Commit 551e3e3

Browse files
committed
Run files through format-incremental
1 parent f36db0e commit 551e3e3

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/openfermion/linalg/sparse_tools.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# See the License for the specific language governing permissions and
1111
# limitations under the License.
1212
"""This module provides functions to interface with scipy.sparse."""
13+
1314
import itertools
1415
from functools import reduce
1516
import warnings
@@ -119,7 +120,7 @@ def jordan_wigner_sparse(fermion_operator, n_qubits=None):
119120
# Extract triplets from sparse_term.
120121
sparse_matrix = sparse_matrix.tocoo(copy=False)
121122
values_list.append(sparse_matrix.data)
122-
(row, column) = sparse_matrix.nonzero()
123+
row, column = sparse_matrix.nonzero()
123124
row_list.append(row)
124125
column_list.append(column)
125126

@@ -179,7 +180,7 @@ def qubit_operator_sparse(qubit_operator, n_qubits=None):
179180
# Extract triplets from sparse_term.
180181
sparse_matrix = kronecker_operators(sparse_operators)
181182
values_list.append(sparse_matrix.tocoo(copy=False).data)
182-
(column, row) = sparse_matrix.nonzero()
183+
column, row = sparse_matrix.nonzero()
183184
column_list.append(column)
184185
row_list.append(row)
185186

@@ -1230,7 +1231,7 @@ def boson_operator_sparse(operator, trunc, hbar=1.0):
12301231

12311232
# Extract triplets from sparse_term.
12321233
values_list.append(term_operator.tocoo(copy=False).data)
1233-
(row, column) = term_operator.nonzero()
1234+
row, column = term_operator.nonzero()
12341235
column_list.append(column)
12351236
row_list.append(row)
12361237

src/openfermion/linalg/sparse_tools_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# See the License for the specific language governing permissions and
1111
# limitations under the License.
1212
"""Tests for sparse_tools.py."""
13+
1314
import os
1415

1516
import unittest

0 commit comments

Comments
 (0)