Skip to content

Commit

Permalink
Merge pull request #112 from qtzhuang/zqt
Browse files Browse the repository at this point in the history
fix some mistakes and minor deficiencies
  • Loading branch information
Zhaoyilunnn authored Nov 14, 2023
2 parents d175036 + 8424ef3 commit fb2d5d1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Unit test
on:
push:
pull_request:
branches: ['main']
branches: ['master']
jobs:
unnittest:
name: Unit test
Expand Down
Empty file.
4 changes: 2 additions & 2 deletions quafu/algorithms/layers/basic_entangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __init__(self, weights, num_qubits, rotation="X"):
rotation(str): one-parameter single-qubit gate to use
"""
weights = np.asarray(weights)
"""convert weights to numpy array if weights is list otherwise keep unchanged"""
#convert weights to numpy array if weights is list otherwise keep unchanged
shape = np.shape(weights)

##TODO(qtzhuang): If weights are batched, i.e. dim>3, additional processing is required
Expand Down Expand Up @@ -69,7 +69,7 @@ def _build(self):

elif self.num_qubits > 2:
for i in range(self.num_qubits):
gate_list.append(qeg.CXGate(i,(i+1)%self.num_qubits))
gate_list.append(qeg.CXGate(i, (i+1)%self.num_qubits))

return gate_list

Expand Down
3 changes: 1 addition & 2 deletions tests/quafu/algorithms/angle_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@


class TestAngleEmbedding:
"""Example of angle embedding"""

"""Example of angle embedding"""
def test_build(self):
num_qubits = 4
qc = QuantumCircuit(num_qubits)
Expand Down

0 comments on commit fb2d5d1

Please sign in to comment.