Skip to content

Commit

Permalink
fix some
Browse files Browse the repository at this point in the history
  • Loading branch information
Glacialte committed Jan 18, 2024
1 parent 9c6f128 commit 61b50b1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion qulacs/gate/gate_npair_qubit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class FusedSWAP : public QuantumGate {
: qubit_index1(_qubit_index1), qubit_index2(_qubit_index2), block_size(_block_size) {
UINT upper_index = std::max(_qubit_index1, _qubit_index2);
UINT lower_index = std::min(_qubit_index1, _qubit_index2);
if (upper_index > (lower_index + block_size - 1)) {
if (upper_index <= (lower_index + block_size - 1)) {
throw std::runtime_error(
"FusedSwap: upper index must be bigger than lower_index + block_size - 1");
}
Expand Down
2 changes: 1 addition & 1 deletion qulacs/gate/update_ops_npair_qubit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void fusedswap_gate(UINT target_qubit_index_0,
UINT upper_index, lower_index;
upper_index = std::max(target_qubit_index_0, target_qubit_index_1);
lower_index = std::min(target_qubit_index_0, target_qubit_index_1);
if (n_qubits > (upper_index + block_size - 1)) {
if (n_qubits <= (upper_index + block_size - 1)) {
throw std::runtime_error(
"FusedSwap: num of qubits must be bigger than upper_index + block_size - 1");
}
Expand Down

0 comments on commit 61b50b1

Please sign in to comment.