From the course: Quantum Computing Fundamentals

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Phase shift gates with Qiskit

Phase shift gates with Qiskit

- [Olivia] To demonstrate some of the phase shift gates with Qiskit, we'll use this simple circuit, which initializes three qubits with Hadamard gates. On the block spheres below, we can see that that means all three of their state vectors are pointing in the same direction along the X-axis. Now, to apply an S-gate to the middle qubit, I'll type circuit.s and give it the index of 1. While we're at it, let's go ahead and apply an S-dagger gate to the last qubit by typing circuit.sdg with an index of 2. I'll click the Run All button to run all the cells and we can see the updated circuit diagram and visualizations on the block spheres. Remember that the left qubit shows the state that all three qubits were in before we applied the S-gates. The S-gate phase shifted the middle qubit by pi over two radians, which rotated it 90 degrees counterclockwise around the Z-axis, and the S-dagger gate phase shifted the third qubit…

Contents