Skip to content

Commit

Permalink
the ansatz evolution according to hamiltonian
Browse files Browse the repository at this point in the history
  • Loading branch information
WanJiawang committed Dec 5, 2023
1 parent c00671d commit e9fefac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/quafu/algorithms/integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,14 @@ def test_run(self):
)
ansatz_multi = QAOAAnsatz(hamiltonian_multi, num_layers=num_layers)
ansatz_multi.draw_circuit()
ansatz_multi.plot_circuit(title='MULTI QUBITS')
plt.show()
# ansatz_multi.plot_circuit(title='MULTI QUBITS')
# plt.show()

hamiltonian = Hamiltonian.from_pauli_list(
[("IIIZZ", 1), ("IIZIZ", 1), ("IZIIZ", 1), ("ZIIIZ", 1)]
)
# ref_mat = np.load("tests/quafu/algorithms/data/qaoa_hamiltonian.npy")
ref_mat = np.load("data/qaoa_hamiltonian.npy")
ref_mat = np.load("tests/quafu/algorithms/data/qaoa_hamiltonian.npy")
# ref_mat = np.load("data/qaoa_hamiltonian.npy")
assert np.array_equal(ref_mat, hamiltonian.get_matrix())
ansatz = QAOAAnsatz(hamiltonian, num_layers=num_layers)
ansatz.draw_circuit()
Expand Down

0 comments on commit e9fefac

Please sign in to comment.