import numpy as np
# Create an 7x7 matrix of zeros
matrix = np.zeros((7, 7))
# Use np.indices to create a 2D array of row and column indices
indices = np.indices((7, 7))
# Use bitwise XOR to determine if the sum of the row and column indices is odd
mask = (indices[0] + indices[1]) % 2
# Set the elements where the mask is 1 to 1
matrix[mask == 1] = 1
print(matrix)