Quantum circuits are represented by diagrams similar to musical staves. Here, we will create a simple quantum circuit and visualize it step-by-step.
First, we define our quantum circuit using the Q`...` syntax:
Next, we generate an ASCII diagram of the circuit to visualize it:
We can inspect the circuit's text representation:
Finally, we evaluate the circuit and report its outcomes:
We can also try executing the circuit to get a random outcome based on the probabilities: