The most general quantum black box is a unitary operator , defined by the property that applying , and then the adjoint , does nothing:

The adjoint is shorthand for the complex conjugate of each matrix entry, followed by the transpose, .

Write a function which checks if an array of complex numbers is unitary.

Tip. You will find the np.identity, np.allclose, np.conjugate and np.transpose methods useful.

or to submit your code

To interact with codercises, please switch to a larger screen size.

Learning Objectives:

  • Describe how unitarity arises from preservation of marginal probabilities.