In this question we need to return a Boolean value how to return a Boolean value in this code
def is_hermitian(matrix):
"""Check whether a matrix is hermitian.
Args:
matrix: (array(array[complex]))
Returns:
bool: True if the matrix is Hermitian, False otherwise
"""
##################
# YOUR CODE HERE #
##################
if matrix == matrix.conj().T:
B = 1
return B# Return the boolean value
matrix_1 = np.array([[1,1j],[-1j,1]])
matrix_2 = np.array([[1,2],[3,4]])
print("Is matrix [[1,1j],[-1j,1]] Hermitian?")
print(is_hermitian(matrix_1))
print("Is matrix [[1,2],[3,4]] Hermitian?")
print(is_hermitian(matrix_2))
I have to return B as 1 so I am not getting wrong