This post is about a small error naming a variable which you could fix to avoid misunderstandings from the readers.
I believe there is a small bug in the code template for the exercise, as the density_matrix is defined by calling circuit(target_state) when the actual variable is called target_state_vector.
This last screenshot is my solution to the exercise and has the correct code, I believe.
Thanks a lot for providing the Codebook and the exercises!