diff --git a/src/stim/stabilizers/pauli_string_iter.inl b/src/stim/stabilizers/pauli_string_iter.inl index 6f741eb81..9064e62d7 100644 --- a/src/stim/stabilizers/pauli_string_iter.inl +++ b/src/stim/stabilizers/pauli_string_iter.inl @@ -56,7 +56,6 @@ void PauliStringIterator::find_set_bits(simd_bits &cur_perm, std::vector::next_qubit_permutation(simd_bits &cur_perm) { } } size_t next_zero = count_trailing_zeros(t1_inv); - // std::cout << next_zero << " " << num_zeros << std::endl; - // std::cout << " >> t1 " << t1.u64[0] << " " << t1.u64[1] << std::endl; - // std::cout << " >> t1 inv" << t1_inv.u64[0] << " " << t1_inv.u64[1] << " " << ~0 << std::endl; for (size_t w = 0; w < cur_perm.num_u64_padded(); w++) { if (next_zero / 64 == w) { if ((next_zero + 1) % 64 == 0) { @@ -155,13 +151,11 @@ void PauliStringIterator::next_qubit_permutation(simd_bits &cur_perm) { t2.u64[w] = ones_bit; } } - // std::cout << " >> t2 " << t2.u64[0] << " " << t2.u64[1] << std::endl; size_t words = (next_zero - num_zeros - 1) / 64; for (size_t w = 0; w < words; w++) { t3.u64[w] = ~0ULL; } t3.u64[words] = (1ULL << (next_zero - num_zeros - 1 - words * 64)) - 1; - // std::cout << " >> t3 " << t3.u64[0] << " " << t3.u64[1] << std::endl; cur_perm = t1; cur_perm ^= t2; cur_perm |= t3; @@ -225,80 +219,24 @@ bool PauliStringIterator::iter_next_weight() { // If num_qubits is a multiple of 64 we can't left shift by 64 without overflowing, hence this conditional. uint64_t val = result.num_qubits % 64 == 0 ? ~0ULL : (1ULL << result.num_qubits - max_word * 64) - 1; ones_mask_with_val(terminal, val, max_word); - // std::cout << std::endl; - // std::cout << "TERMINAL :::: " << cur_w << " " << cur_p << std::endl; - // for (size_t w = 0; w < terminal.num_u64_padded(); w++) { - // std::cout << terminal.u64[w] << " "; - // } - // std::cout << std::endl; // Account for overflow if num_qubits == cur_w size_t min_word = result.num_qubits - cur_w ? (result.num_qubits - cur_w + 64 - 1) / 64 - 1 : cur_w / 64; - // std::cout << min_word << std::endl; val = (result.num_qubits - cur_w) % 64 == 0 ? ~0ULL : (1ULL << ((result.num_qubits - cur_w) - min_word * 64)) - 1; - // std::cout << val << " " << (result.num_qubits - cur_w - 1 % 64) << " " - // << (1ULL << ((result.num_qubits - cur_w) - max_word * 64)) - 1 << std::endl; - // std::cout << "MASK :::: " - // << " " << min_word << " " << max_word << " " << val << std::endl; ones_mask_with_val(mask, val, min_word); - // std::cout << "SET " << std::endl; - // for (size_t w = 0; w < terminal.num_u64_padded(); w++) { - // std::cout << mask.u64[w] << " "; - // } - // std::cout << std::endl; - // std::cout << "T: " << max_word << " " << result.num_qubits << " " << terminal.u64[0] << " " << mask.u64[0] - // << " " << ~0ULL << " " << cur_w << std::endl; terminal ^= mask; - // for (size_t w = 0; w < terminal.num_u64_padded(); w++) { - // std::cout << terminal.u64[w] << " "; - // } - // std::cout << cur_perm.num_bits_padded() << " " << terminal.num_bits_padded() << std::endl; - // std::cout << terminal.u64[0] << " " << terminal.u64[1] << std::endl; - // exit(1); set_bits.resize(cur_w); } while (cur_p < SIZE_MAX) { // Find which bits are set in our current permutation. - // std::cout << set_bits.size() << std::endl; - // std::vector set_bits; - // std::cout << cur_p << " " << cur_k << std::endl; find_set_bits(cur_perm, set_bits); - // for (size_t w = 0; w < set_bits.size(); w++) { - // std::cout << set_bits[w] << " "; - // } - // std::cout << std::endl; if (!iter_all_cur_perm(set_bits)) { // Find the next permutation of cur_w qubits among num_qubit possible // locations. The qubit patterns are represented as bits with the // location of the set bits signifying where the Paulis should be // populated. E.g. 0011 means qubits 0 and 1 should get paulis, 0101 // means sites 0 and 2, etc. - // std::cout << cur_perm.u64[0] << " " << cur_perm.u64[1] << " " << terminal.u64[0] << " " << - // terminal.u64[1] - // << std::endl; - // if (cur_p == 8256 - 1) { - // std::cout << cur_p << std::endl; - // for (size_t w = 0; w < terminal.num_u64_padded(); w++) { - // std::cout << terminal.u64[w] << " "; - // } - // std::cout << std::endl; - // for (size_t w = 0; w < terminal.num_u64_padded(); w++) { - // std::cout << cur_perm.u64[w] << " "; - // } - // std::cout << std::endl; - // // exit(1); - // } if (cur_perm == terminal) { - // std::cout << "TERMINAL" << std::endl; - // for (size_t w = 0; w < terminal.num_u64_padded(); w++) { - // std::cout << terminal.u64[w] << " "; - // } - // std::cout << std::endl; - // for (size_t w = 0; w < terminal.num_u64_padded(); w++) { - // std::cout << cur_perm.u64[w] << " "; - // } - // std::cout << std::endl; - // std::cout << result.num_qubits << " " << cur_p << " " << cur_w << std::endl; terminal.clear(); return false; }