Skip to content

Commit

Permalink
fix qnn_test
Browse files Browse the repository at this point in the history
  • Loading branch information
qtzhuang committed Mar 6, 2024
1 parent cc59cd3 commit f59aae5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/quafu/algorithms/qnn_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def test_torch_layer_qnn(self):
"""Use QuantumNeuralNetwork ansatz"""
weights = np.random.randn(2, 2)
entangle_layer = BasicEntangleLayers(weights, 2)
qnn = QuantumNeuralNetwork(2, [entangle_layer])
qnn = QuantumNeuralNetwork(2, entangle_layer)
batch_size = 1

# Legacy invokation style
Expand All @@ -172,7 +172,7 @@ def test_torch_layer_qnn_real_machine(self):
"""Use QuantumNeuralNetwork ansatz"""
weights = np.random.randn(2, 2)
entangle_layer = BasicEntangleLayers(weights, 2)
qnn = QuantumNeuralNetwork(2, [entangle_layer], backend="ScQ-P10")
qnn = QuantumNeuralNetwork(2, entangle_layer, backend="ScQ-P10")
qnn.measure([0, 1], [0, 1])
batch_size = 1

Expand Down Expand Up @@ -200,7 +200,7 @@ def test_classification_on_random_dataset(self, num_epochs, batch_size):
num_qubits = num_classes
weights = np.random.randn(num_qubits, 2)
entangle_layer = BasicEntangleLayers(weights, 2)
qnn = QuantumNeuralNetwork(num_qubits, [entangle_layer])
qnn = QuantumNeuralNetwork(num_qubits, entangle_layer)
# qnn_model = ModelQuantumNeuralNetworkNative(qnn)
qnn_model = ModelStandardCircuit(qnn)

Expand Down

0 comments on commit f59aae5

Please sign in to comment.