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.

Pauli-Z gate with Qiskit

Pauli-Z gate with Qiskit

- [Instructor] The Qiskit method to add the Pauli-Z gate to a quantum circuit is similar to the methods for adding X and Y gates. To demonstrate that, we'll start with a single qubit in its initial zero computational basis state. Notice that the first element of our state vector has the real value one and that all numbers within that state vector are positive. This is the plain and simple zero basis state. Now let's apply the Pauli-Z operation to it by calling circuit.z and then passing in the index value zero for the first qubit. I'll click the Run All button to run all of these notebook cells and the state vector after applying the Pauli-Z gate is exactly the same as before. We went from the zero state to the zero state. Nothing too exciting. Now let's see what happens when we apply the Pauli-Z gate to a qubit in a state other than one of our computational basis states of zero or one. To create a side-by-side…

Contents