Loading examples/qcor_demos/pirq_workshop/qir_qasm3/demo3_lang_integration/4_qsharp_call_qasm3/op_takes_callable.qs +1 −14 Original line number Diff line number Diff line Loading @@ -4,19 +4,6 @@ open Microsoft.Quantum.Intrinsic; open Microsoft.Quantum.Convert; open Microsoft.Quantum.Canon; // operation ApplyKernelToEachQubit(singleElementOperation : (Qubit => Unit is Adj + Ctl)): Unit { // use q = Qubit[5]; // ApplyToEachCA(singleElementOperation, q); // for idx in 0..4 { // let res = M(q[idx]); // if res == One { // Message("Get one"); // } else { // Message("Get zero"); // } // } // } operation ApplyControlledKernel(singleElementOperation : ((Qubit) => Unit is Adj + Ctl)): Unit { use q = Qubit[2]; Loading @@ -36,7 +23,7 @@ operation ApplyControlledKernel(singleElementOperation : ((Qubit) => Unit is Adj Message("Meas Q1 -> one"); X(q[1]); } else { Message("Meas Q0 -> zero"); Message("Meas Q1 -> zero"); } } } No newline at end of file Loading
examples/qcor_demos/pirq_workshop/qir_qasm3/demo3_lang_integration/4_qsharp_call_qasm3/op_takes_callable.qs +1 −14 Original line number Diff line number Diff line Loading @@ -4,19 +4,6 @@ open Microsoft.Quantum.Intrinsic; open Microsoft.Quantum.Convert; open Microsoft.Quantum.Canon; // operation ApplyKernelToEachQubit(singleElementOperation : (Qubit => Unit is Adj + Ctl)): Unit { // use q = Qubit[5]; // ApplyToEachCA(singleElementOperation, q); // for idx in 0..4 { // let res = M(q[idx]); // if res == One { // Message("Get one"); // } else { // Message("Get zero"); // } // } // } operation ApplyControlledKernel(singleElementOperation : ((Qubit) => Unit is Adj + Ctl)): Unit { use q = Qubit[2]; Loading @@ -36,7 +23,7 @@ operation ApplyControlledKernel(singleElementOperation : ((Qubit) => Unit is Adj Message("Meas Q1 -> one"); X(q[1]); } else { Message("Meas Q0 -> zero"); Message("Meas Q1 -> zero"); } } } No newline at end of file