diff --git a/paddle_quantum/utils.py b/paddle_quantum/utils.py index d2f91c956b4aea3c236dd69f841ac8f9ce20ea85..d1d0ffe22432ca13f604e08ddc011b8fe3f6225f 100644 --- a/paddle_quantum/utils.py +++ b/paddle_quantum/utils.py @@ -924,9 +924,6 @@ class Hamiltonian: """ coefs, pauli_words, sites = self.decompose_with_sites() n_qubit = 1 - for site in sites: - if type(site[0]) is int: - n_qubit = max(n_qubit, max(site) + 1) for site in sites: if type(site[0]) is int: n_qubit = max(n_qubit, max(site) + 1)