Python For Quantum Mechanics#
Week 3: Tutorial#
Exercise 1: Making a matrix with a function#
Create a function that returns a square matrix of 0.0+0.0j
s, with a specified size.
Using the above function or otherwise, create a function that returns the identity matrix for a specific size.
Exercise 2: Making Matrix Operations#
Create a function that takes a list as input and finds it’s matrix transpose.
Make a similar function that takes a list as input and finds it’s matrix hermitian(transpose-conjugate).
Exercise 3: Making binary matrix functions#
Now, using the above functions, create a function that takes two lists as inputs, and returns a matrix of their sum.
Similarly create a function that takes two matrices as inputs, and returns their difference.
Similarly create a function that takes in a scalar and a list as inputs, and returns their product as a matrix.
Excercise 4: Vector Class#
Make a vector class. Add any attributes or methods that you think would be useful.