The Sounds of Circuitry

Quantum circuits are represented by diagrams similar to musical staves. Here, we will create a simple quantum circuit and visualize it step-by-step.

Step 1: Define the Circuit

First, we define our quantum circuit using the Q`...` syntax:

Step 2: Generate the ASCII Diagram

Next, we generate an ASCII diagram of the circuit to visualize it:

Step 3: Inspect the Circuit

We can inspect the circuit's text representation:


    

Step 4: Evaluate and Report the Circuit

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: