Simulating an Operation in Python

So far, we’ve learned how to create single and multi-qubit states. We’ve also learned how to represent quantum gates. In this lesson, we’ll put together both pieces and see how we can apply gates to states.

Recall that gates acting on states are simply a representation of matrix multiplication. Both states and gates are matrices. So, multiplying the two is fairly simple, especially when a single qubit is involved. Things get slightly more complicated for multiple qubits and we will get to that in the second half of the lesson.

Get hands-on with 1200+ tech skills courses.