Loading examples/qsharp/FTQC/Bell/bell_driver.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -3,10 +3,10 @@ // Include the external QSharp function. // With EntryPoint() annotation, there are 3 functions generated: // QCOR__TestBell__body(): raw Q# callable // QCOR__TestBell__body(): raw Q# callable (marked internal) // QCOR__TestBell(): EntryPoint type (with result printing), no return // QCOR__TestBell__Interop(): InteropFriendly function (type casting to C-type function) qcor_include_qsharp(QCOR__TestBell, void, int64_t) qcor_include_qsharp(QCOR__TestBell__Interop, int64_t, int64_t) // Compile with: // Include both the qsharp source and this driver file Loading @@ -16,6 +16,9 @@ qcor_include_qsharp(QCOR__TestBell, void, int64_t) // Run with: // $ ./a.out int main() { QCOR__TestBell(1024); auto one_count = QCOR__TestBell__Interop(1024); std::cout << "One count: " << one_count << "\n"; // In the range of Bell experiment: 50-50 qcor_expect(one_count > 400 && one_count < 700); return 0; } No newline at end of file Loading
examples/qsharp/FTQC/Bell/bell_driver.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -3,10 +3,10 @@ // Include the external QSharp function. // With EntryPoint() annotation, there are 3 functions generated: // QCOR__TestBell__body(): raw Q# callable // QCOR__TestBell__body(): raw Q# callable (marked internal) // QCOR__TestBell(): EntryPoint type (with result printing), no return // QCOR__TestBell__Interop(): InteropFriendly function (type casting to C-type function) qcor_include_qsharp(QCOR__TestBell, void, int64_t) qcor_include_qsharp(QCOR__TestBell__Interop, int64_t, int64_t) // Compile with: // Include both the qsharp source and this driver file Loading @@ -16,6 +16,9 @@ qcor_include_qsharp(QCOR__TestBell, void, int64_t) // Run with: // $ ./a.out int main() { QCOR__TestBell(1024); auto one_count = QCOR__TestBell__Interop(1024); std::cout << "One count: " << one_count << "\n"; // In the range of Bell experiment: 50-50 qcor_expect(one_count > 400 && one_count < 700); return 0; } No newline at end of file