#include <cudaq.h>
#include <iostream>

// 量子カーネルの定義
struct bell_pair {
    void operator()() __qpu__ {
        cudaq::qvector q(2);  // 2つの物理量子ビットを確保
        h(q[0]);              // アダマールゲート
        cx(q[0], q[1]);       // CNOT（制御X）ゲート
        mz(q);                // 全量子ビットを測定
    }
};

int main() {
    // 実行と1000回サンプリング
    auto counts = cudaq::sample(bell_pair{});
    
    // 結果の出力
    for (auto&& [bits, count] : counts) {
        std::cout << bits << ": " << count << "\n";
    }
    return 0;
}
