I have a question regarding tax losses of stock options. If I purchase a put and do not exercise it, is the cost I paid for the put considered a tax loss?

example: I own 100 shares of XYZ and I want to protect my position, so I purchase a put. The stock goes up, so I do not need to exercise the put option. The put expires worthless. I do not sell the stock. Is the cost I paid for the put considered an investment loss?