I am having challenges with Microsoft Q#. I wrote this short code and it says it can only occur at a global scope.
How do I fix this error? Any ideas? Thank you
Quantum Computing Stack Exchange is a question and answer site for engineers, scientists, programmers, and computing professionals interested in quantum computing. It only takes a minute to sign up.Sign up to join this community
This error is about the “global scope” of the namespace declaration, which is unrelated to the “global phase” mentioned in your Q# code.
In Q# Jupyter notebooks, code is automatically wrapped in a namespace - there is no need to declare one in your code. If you remove the
namespace Quantum.Kata.SingleQubitGates declaration from your code, it should work.