Visualizing quantum gates
To help us understand quantum gates, we can use the ch6_r1_quantum_gate_ui.py
sample program.
This recipe differs a bit from the ones that we have seen so far. Up until now, we have mainly just used Qiskit® commands inside a Python wrapper, with no actual coding beyond that. This time, we start out by building a rudimentary Python implementation to create a very basic before-after gate exploration UI. When you run the program, it prompts you to select an initial qubit state and a gate to apply to your qubit; then it creates a visualization to show you the gate action on the qubit.
The script builds your circuit for you and then shows the basic minimum circuit that supports the gate, the state vector, and a Bloch sphere or Q-sphere visualization that corresponds to the gate action. The visualization highlights the qubit's state before the gate, and how the state changes after the gate.
Hybrid classical/quantum programs
So, what we are...