diff --git a/paddle_quantum/trotter.py b/paddle_quantum/trotter.py index b3798f8d1de14c92890c4f4939c0552a4a8ec3e0..14dfedaaf1f1e484311630b9f7b58e5da53cc441 100644 --- a/paddle_quantum/trotter.py +++ b/paddle_quantum/trotter.py @@ -260,14 +260,19 @@ def __add_first_order_trotter_block(circuit, tau, grouped_hamiltonian, reverse=F assert isinstance(hamiltonian, Hamiltonian) # decompose the Hamiltonian into 3 lists coeffs, pauli_words, sites = hamiltonian.decompose_with_sites() - if pauli_words==['XX','YY','ZZ']: - optimal_circuit(circuit,[tau*i for i in coeffs],sites[0]) - else: - # apply rotational gate of each term - for term_index in range(len(coeffs)): + # apply rotational gate of each term + term_index = 0 + while term_index