Example Challenge

Example Challenge: Prepare |0⟩ or |1⟩

33 other teams have completed this challenge.

You need to log in to be able to submit solutions!

You are given a single qubit, prepared in the |0⟩ state, and a Result that is either Zero or One.

Prepare the qubit in the |0⟩ or |1⟩ state that corresponds to the provided Result value.

You should implement the following Solve operation to make that happen and keep the signature of the operation exactly as it is.

Go ahead and copy/paste the following template in your Q# project in Visual Studio Code to start working on the solution.

Below, you can find a possible solution and additionally, just for reference, the code that will be executed internally to validate the submitted solution.

You should only submit the Solve operation with your implemented solution, or in this example case, a copy from the provided solution below.

An unhandled error has occurred. Reload 🗙