Simulating Quantum Gates in Python

In this lesson, we shall define the quantum gates using NumPy and Python.

In the last chapter, we saw the definitions of various quantum gates (shortened as ‘gates’ henceforth) and the operations they perform. As you would recall, gates are matrices. We can use NumPy to define multi-dimensional arrays or lists. In fact, we encourage you to try defining some basic gates studied earlier in the code editor below. Once you are confident, you can compare your implementations with ours and see how well you did.

Get hands-on with 1200+ tech skills courses.