Skip to content

Commit

Permalink
apply more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
multiphaseCFD committed Sep 17, 2024
1 parent a83e5d7 commit c8444f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions pennylane_lightning/lightning_tensor/_tensornet.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,7 @@ def gate_matrix_decompose(gate_ops_matrix, wires, max_mpo_bond_dim, c_dtype):
"""Permute and decompose a gate matrix into MPO sites. This method return the MPO sites in the Fortran order of the ``cutensornet`` backend. Note that MSB in the Pennylane convention is the LSB in the ``cutensornet`` convention."""
sorted_indexed_wires = sorted(enumerate(wires), key=lambda x: x[1])

Check warning on line 81 in pennylane_lightning/lightning_tensor/_tensornet.py

View check run for this annotation

Codecov / codecov/patch

pennylane_lightning/lightning_tensor/_tensornet.py#L81

Added line #L81 was not covered by tests

sorted_wires = []
original_axes = []
for index, wire in sorted_indexed_wires:
sorted_wires.append(wire)
original_axes.append(index)
original_axes, sorted_wires = zip(*sorted_indexed_wires)

Check warning on line 83 in pennylane_lightning/lightning_tensor/_tensornet.py

View check run for this annotation

Codecov / codecov/patch

pennylane_lightning/lightning_tensor/_tensornet.py#L83

Added line #L83 was not covered by tests

tensor_shape = [2] * len(wires) * 2

Check warning on line 85 in pennylane_lightning/lightning_tensor/_tensornet.py

View check run for this annotation

Codecov / codecov/patch

pennylane_lightning/lightning_tensor/_tensornet.py#L85

Added line #L85 was not covered by tests

Expand Down
2 changes: 1 addition & 1 deletion tests/lightning_tensor/test_tensornet_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def test_gate_matrix_decompose():
gate = scipy.linalg.expm(1j * hermitian)
original_gate = gate.copy() # for later to double check

max_mpo_bond_dim = 2**len(wires)
max_mpo_bond_dim = 2 ** len(wires)

mpos, sorted_wired = gate_matrix_decompose(gate, wires, max_mpo_bond_dim, np.complex128)

Expand Down

0 comments on commit c8444f6

Please sign in to comment.